{"record":{"id":"56814999e8cd59a5","repo":"jackwener/OpenCLI","slug":"minimax-music-vocal-generation-requires-lyrics","errorCode":null,"errorMessage":"minimax music vocal generation requires --lyrics, or prompt with --lyrics-optimizer","messagePattern":"minimax music vocal generation requires --lyrics, or prompt with --lyrics-optimizer","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/minimax/music.js","lineNumber":109,"sourceCode":"        const audioFormat = choice(kwargs['audio-format'], 'mp3', AUDIO_FORMATS, '--audio-format');\n        const sampleRate = optionalInteger(kwargs['sample-rate'], SAMPLE_RATES, '--sample-rate');\n        const bitrate = optionalInteger(kwargs.bitrate, BITRATES, '--bitrate');\n        const timeoutSeconds = boundedInteger(kwargs.timeout, 600, 1, 1800, '--timeout');\n        const instrumental = boolean(kwargs.instrumental, '--instrumental');\n        const lyricsOptimizer = boolean(kwargs['lyrics-optimizer'], '--lyrics-optimizer');\n        const aigcWatermark = boolean(kwargs['aigc-watermark'], '--aigc-watermark');\n        const execute = boolean(kwargs.execute, '--execute');\n        const prompt = text(kwargs.prompt, 2000, 'prompt');\n        const lyrics = text(kwargs.lyrics, 3500, '--lyrics');\n\n        if (instrumental && (!prompt || lyrics || lyricsOptimizer)) {\n            throw new ArgumentError('minimax music --instrumental requires prompt and cannot be combined with --lyrics or --lyrics-optimizer');\n        }\n        if (lyricsOptimizer && (!prompt || lyrics)) {\n            throw new ArgumentError('minimax music --lyrics-optimizer requires prompt and cannot be combined with --lyrics');\n        }\n        if (!instrumental && !lyrics && !lyricsOptimizer) {\n            throw new ArgumentError('minimax music vocal generation requires --lyrics, or prompt with --lyrics-optimizer');\n        }\n        if (aigcWatermark && regionKey !== 'cn') {\n            throw new ArgumentError('minimax music --aigc-watermark is only supported with --region cn');\n        }\n        if (kwargs.op != null && outputFormat !== 'hex') {\n            throw new ArgumentError('minimax music --op requires --output-format hex');\n        }\n        const outputDir = outputFormat === 'hex' ? resolveOutputDir(kwargs.op) : null;\n        if (!execute) throw new ArgumentError('Refusing to spend MiniMax quota without --execute');\n\n        const region = MUSIC_REGIONS[regionKey];\n        const apiKey = requireApiKey();\n        const reservation = outputFormat === 'hex' ? reserveAudioFile(outputDir, model, audioFormat) : null;\n        let committed = false;\n        try {\n            const payload = await generateMusic(region, apiKey, buildRequest({\n                model, prompt, lyrics, outputFormat, audioFormat, sampleRate, bitrate,\n                instrumental, lyricsOptimizer, aigcWatermark,","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/minimax/music.js#L91-L127","documentation":"Every MiniMax music request must specify a generation mode. If none of --instrumental, --lyrics, or --prompt with --lyrics-optimizer is present, the CLI throws this ArgumentError instead of sending an underspecified (and quota-charging) request.","triggerScenarios":"Running the command with no mode flags at all (e.g. only --region/--execute/--aigc-watermark); passing --prompt alone without --lyrics-optimizer; all mode flags empty after trimming.","commonSituations":"Trying a minimal smoke-test invocation expecting a default mode; wrapper scripts where the mode variables are unset because config keys were renamed; forgetting that a bare --prompt needs --lyrics-optimizer to be a valid vocal request.","solutions":["Add --lyrics \"...\" for vocal generation, or","Add --instrumental true with --prompt, or","Add --lyrics-optimizer true alongside an existing --prompt","Print your resolved flags (or run without --execute first) to see which mode variables are empty"],"exampleFix":"// before\nminimax music --prompt \"sad piano\" --execute\n// after\nminimax music --prompt \"sad piano\" --instrumental true --execute","handlingStrategy":"validation","validationCode":"function assertHasMode(o) {\n  const has = o.instrumental || (o.lyrics?.trim()) || (o.lyricsOptimizer && o.prompt?.trim());\n  if (!has) throw new Error('Provide --lyrics, or --instrumental with --prompt, or --prompt with --lyrics-optimizer');\n}\nassertHasMode(cliOpts); // before invoking","typeGuard":null,"tryCatchPattern":"try {\n  runMinimaxMusic(args);\n} catch (e) {\n  if (e.message.includes('vocal generation requires')) {\n    console.error('No generation mode set: add --lyrics OR --instrumental OR --prompt + --lyrics-optimizer');\n    process.exitCode = 2;\n  } else throw e;\n}","preventionTips":["Always set exactly one mode flag in every invocation template","Remember a bare --prompt alone is not a valid request","Check for renamed/unset config variables when wrappers suddenly fail","Use the dry-run (no --execute) pass to catch missing modes before spending quota"],"tags":["cli","minimax","missing-required-flag"],"backgroundTag":"missing-required-flag","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}