jackwener/OpenCLI · error · ArgumentError

Argument "video" is required.

Error message

Argument "video" is required.

What it means

validateInstagramReelArgs checks kwargs.video and throws ArgumentError when it is undefined, with a hint to provide --video /path/to/file.mp4. It is the argument-level gate that runs before file validation, enforcing that the required video argument is present at all.

Source

Thrown at clis/instagram/reel.js:33

    return page;
}
function validateVideoPath(input) {
    const resolved = path.resolve(String(input || '').trim());
    if (!resolved) {
        throw new ArgumentError('Video path cannot be empty');
    }
    if (!fs.existsSync(resolved)) {
        throw new ArgumentError(`Video file not found: ${resolved}`);
    }
    const ext = path.extname(resolved).toLowerCase();
    if (!SUPPORTED_VIDEO_EXTENSIONS.has(ext)) {
        throw new ArgumentError(`Unsupported video format: ${ext}`, 'Supported formats: .mp4');
    }
    return resolved;
}
function validateInstagramReelArgs(kwargs) {
    if (kwargs.video === undefined) {
        throw new ArgumentError('Argument "video" is required.', 'Provide --video /path/to/file.mp4');
    }
}
function buildInstagramReelSuccessResult(url) {
    return [{
            status: '✅ Posted',
            detail: 'Single reel shared successfully',
            url,
        }];
}
function isRecoverableReelSessionError(error) {
    if (!(error instanceof CommandExecutionError))
        return false;
    return error.message === 'Instagram reel upload input not found'
        || error.message === 'Instagram reel preview did not appear after upload'
        || error.message === 'Instagram reel upload failed';
}
function buildSafeTempVideoPath(filePath) {
    const ext = path.extname(filePath).toLowerCase() || '.mp4';

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Add the flag: --video /path/to/file.mp4.
  2. Fix flag typos (must be exactly --video).
  3. In programmatic use, pass { video: '<path>' } in kwargs.

Example fix

// before
await runInstagramReel({});
// after
await runInstagramReel({ video: '/tmp/clip.mp4' });
Defensive patterns

Strategy: validation

Validate before calling

if (kwargs.video === undefined) throw new Error('Argument "video" is required. Provide --video /path/to/file.mp4');

Type guard

function hasVideoKey(kwargs) { return kwargs != null && 'video' in kwargs && kwargs.video !== undefined; }

Try / catch

try { await reel(args); } catch (e) { if (e.message.includes('video" is required')) { console.error('Usage: instagram reel --video /path/to/file.mp4'); return; } throw e; }

Prevention

When it happens

Trigger: Running the reel command without the --video flag, or programmatically calling the flow with an args object lacking the video key.

Common situations: CLI misuse (misspelled flag like --vid), wrapper scripts dropping the argument, or calling an internal API with {} kwargs.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/8a9469d3514005ba. Report an issue: GitHub.