{"record":{"id":"67278b4ab9d10c0b","repo":"jackwener/OpenCLI","slug":"minimax-music-instrumental-requires-prompt-and-c","errorCode":null,"errorMessage":"minimax music --instrumental requires prompt and cannot be combined with --lyrics or --lyrics-optimizer","messagePattern":"minimax music --instrumental requires prompt and cannot be combined with --lyrics or --lyrics-optimizer","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/minimax/music.js","lineNumber":103,"sourceCode":"    ],\n    columns: ['status', 'model', 'region', 'output_format', 'audio_format', 'audio_url', 'file', 'expires_in_hours'],\n    func: async (kwargs) => {\n        const model = choice(kwargs.model, 'music-3.0', MODELS, '--model');\n        const regionKey = choice(kwargs.region, 'global', Object.keys(MUSIC_REGIONS), '--region');\n        const outputFormat = choice(kwargs['output-format'], 'url', OUTPUT_FORMATS, '--output-format');\n        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();","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/minimax/music.js#L85-L121","documentation":"The CLI enforces mutually exclusive generation modes: --instrumental means a purely instrumental track, so it requires a non-empty prompt and forbids --lyrics and --lyrics-optimizer. Violating any of these throws this ArgumentError before any API call is made.","triggerScenarios":"--instrumental true together with --lyrics \"...\"; --instrumental true together with --lyrics-optimizer; --instrumental true with an empty/whitespace-only prompt (prompt='' fails the !prompt check).","commonSituations":"Users thinking --instrumental is an add-on to lyric generation rather than a mode; scripts appending --lyrics from a template while also setting --instrumental; forgetting that an empty prompt counts as missing.","solutions":["Remove --lyrics and --lyrics-optimizer when using --instrumental and supply a real --prompt","Or drop --instrumental and use --lyrics (or --prompt with --lyrics-optimizer) for vocal tracks","Verify the prompt is non-empty after trimming — an empty string counts as absent","Restructure the calling script to pick exactly one mode: instrumental(prompt) vs vocals(lyrics | prompt+optimizer)"],"exampleFix":"// before\nminimax music --instrumental true --lyrics \"la la la\"\n// after\nminimax music --instrumental true --prompt \"upbeat jazz piano trio\"","handlingStrategy":"validation","validationCode":"function assertInstrumentalMode(o) {\n  if (o.instrumental) {\n    if (!o.prompt?.trim()) throw new Error('--instrumental requires --prompt');\n    if (o.lyrics) throw new Error('--instrumental cannot be combined with --lyrics');\n    if (o.lyricsOptimizer) throw new Error('--instrumental cannot be combined with --lyrics-optimizer');\n  }\n}\nassertInstrumentalMode(cliOpts); // before invoking","typeGuard":null,"tryCatchPattern":"try {\n  runMinimaxMusic(args);\n} catch (e) {\n  if (e.message.includes('--instrumental requires')) {\n    console.error('Mode conflict: use either --instrumental + --prompt OR --lyrics OR --prompt + --lyrics-optimizer');\n    process.exitCode = 2;\n  } else throw e;\n}","preventionTips":["Model the three modes explicitly in wrapper scripts and build flags from the chosen mode only","Never append --lyrics unconditionally from templates","Treat --instrumental as a mode, not an add-on","Run without --execute first to surface flag conflicts cheaply"],"tags":["cli","minimax","flag-conflict","mutual-exclusion"],"backgroundTag":"conflicting-cli-flags","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}