{"record":{"id":"8a9469d3514005ba","repo":"jackwener/OpenCLI","slug":"argument-video-is-required","errorCode":null,"errorMessage":"Argument \"video\" is required.","messagePattern":"Argument \"video\" is required\\.","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/instagram/reel.js","lineNumber":33,"sourceCode":"    return page;\n}\nfunction validateVideoPath(input) {\n    const resolved = path.resolve(String(input || '').trim());\n    if (!resolved) {\n        throw new ArgumentError('Video path cannot be empty');\n    }\n    if (!fs.existsSync(resolved)) {\n        throw new ArgumentError(`Video file not found: ${resolved}`);\n    }\n    const ext = path.extname(resolved).toLowerCase();\n    if (!SUPPORTED_VIDEO_EXTENSIONS.has(ext)) {\n        throw new ArgumentError(`Unsupported video format: ${ext}`, 'Supported formats: .mp4');\n    }\n    return resolved;\n}\nfunction validateInstagramReelArgs(kwargs) {\n    if (kwargs.video === undefined) {\n        throw new ArgumentError('Argument \"video\" is required.', 'Provide --video /path/to/file.mp4');\n    }\n}\nfunction buildInstagramReelSuccessResult(url) {\n    return [{\n            status: '✅ Posted',\n            detail: 'Single reel shared successfully',\n            url,\n        }];\n}\nfunction isRecoverableReelSessionError(error) {\n    if (!(error instanceof CommandExecutionError))\n        return false;\n    return error.message === 'Instagram reel upload input not found'\n        || error.message === 'Instagram reel preview did not appear after upload'\n        || error.message === 'Instagram reel upload failed';\n}\nfunction buildSafeTempVideoPath(filePath) {\n    const ext = path.extname(filePath).toLowerCase() || '.mp4';","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/instagram/reel.js#L15-L51","documentation":"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.","triggerScenarios":"Running the reel command without the --video flag, or programmatically calling the flow with an args object lacking the video key.","commonSituations":"CLI misuse (misspelled flag like --vid), wrapper scripts dropping the argument, or calling an internal API with {} kwargs.","solutions":["Add the flag: --video /path/to/file.mp4.","Fix flag typos (must be exactly --video).","In programmatic use, pass { video: '<path>' } in kwargs."],"exampleFix":"// before\nawait runInstagramReel({});\n// after\nawait runInstagramReel({ video: '/tmp/clip.mp4' });","handlingStrategy":"validation","validationCode":"if (kwargs.video === undefined) throw new Error('Argument \"video\" is required. Provide --video /path/to/file.mp4');","typeGuard":"function hasVideoKey(kwargs) { return kwargs != null && 'video' in kwargs && kwargs.video !== undefined; }","tryCatchPattern":"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; }","preventionTips":["Check flag spelling (--video, not --vid or -v)","Parse and validate argv before invoking the flow","Document required flags in wrapper scripts"],"tags":["missing-argument","cli-usage","instagram"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}