jackwener/OpenCLI · error · ArgumentError

minimax music --lyrics-optimizer requires prompt and cannot

Error message

minimax music --lyrics-optimizer requires prompt and cannot be combined with --lyrics

What it means

--lyrics-optimizer asks MiniMax to refine a prompt for vocal generation; it therefore requires a non-empty prompt and cannot be combined with --lyrics (you either provide lyrics directly or let the optimizer build a vocal plan from the prompt, not both). Violating either rule throws this ArgumentError.

Source

Thrown at clis/minimax/music.js:106

        const model = choice(kwargs.model, 'music-3.0', MODELS, '--model');
        const regionKey = choice(kwargs.region, 'global', Object.keys(MUSIC_REGIONS), '--region');
        const outputFormat = choice(kwargs['output-format'], 'url', OUTPUT_FORMATS, '--output-format');
        const audioFormat = choice(kwargs['audio-format'], 'mp3', AUDIO_FORMATS, '--audio-format');
        const sampleRate = optionalInteger(kwargs['sample-rate'], SAMPLE_RATES, '--sample-rate');
        const bitrate = optionalInteger(kwargs.bitrate, BITRATES, '--bitrate');
        const timeoutSeconds = boundedInteger(kwargs.timeout, 600, 1, 1800, '--timeout');
        const instrumental = boolean(kwargs.instrumental, '--instrumental');
        const lyricsOptimizer = boolean(kwargs['lyrics-optimizer'], '--lyrics-optimizer');
        const aigcWatermark = boolean(kwargs['aigc-watermark'], '--aigc-watermark');
        const execute = boolean(kwargs.execute, '--execute');
        const prompt = text(kwargs.prompt, 2000, 'prompt');
        const lyrics = text(kwargs.lyrics, 3500, '--lyrics');

        if (instrumental && (!prompt || lyrics || lyricsOptimizer)) {
            throw new ArgumentError('minimax music --instrumental requires prompt and cannot be combined with --lyrics or --lyrics-optimizer');
        }
        if (lyricsOptimizer && (!prompt || lyrics)) {
            throw new ArgumentError('minimax music --lyrics-optimizer requires prompt and cannot be combined with --lyrics');
        }
        if (!instrumental && !lyrics && !lyricsOptimizer) {
            throw new ArgumentError('minimax music vocal generation requires --lyrics, or prompt with --lyrics-optimizer');
        }
        if (aigcWatermark && regionKey !== 'cn') {
            throw new ArgumentError('minimax music --aigc-watermark is only supported with --region cn');
        }
        if (kwargs.op != null && outputFormat !== 'hex') {
            throw new ArgumentError('minimax music --op requires --output-format hex');
        }
        const outputDir = outputFormat === 'hex' ? resolveOutputDir(kwargs.op) : null;
        if (!execute) throw new ArgumentError('Refusing to spend MiniMax quota without --execute');

        const region = MUSIC_REGIONS[regionKey];
        const apiKey = requireApiKey();
        const reservation = outputFormat === 'hex' ? reserveAudioFile(outputDir, model, audioFormat) : null;
        let committed = false;
        try {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Provide --prompt and remove --lyrics when using --lyrics-optimizer
  2. Or drop --lyrics-optimizer and pass --lyrics directly for vocal generation
  3. Ensure the prompt is non-empty after trimming
  4. Update wrapper scripts to choose one vocal path: lyrics OR prompt+optimizer

Example fix

// before
minimax music --lyrics-optimizer true --lyrics "..." --prompt "pop song"
// after
minimax music --lyrics-optimizer true --prompt "upbeat pop song about summer"
Defensive patterns

Strategy: validation

Validate before calling

function assertOptimizerMode(o) {
  if (o.lyricsOptimizer) {
    if (!o.prompt?.trim()) throw new Error('--lyrics-optimizer requires --prompt');
    if (o.lyrics) throw new Error('--lyrics-optimizer cannot be combined with --lyrics');
  }
}
assertOptimizerMode(cliOpts); // before invoking

Try / catch

try {
  runMinimaxMusic(args);
} catch (e) {
  if (e.message.includes('--lyrics-optimizer requires')) {
    console.error('Pick one vocal path: --lyrics directly, or --prompt + --lyrics-optimizer');
    process.exitCode = 2;
  } else throw e;
}

Prevention

When it happens

Trigger: --lyrics-optimizer true without --prompt; --lyrics-optimizer true together with --lyrics "..."; whitespace-only prompt that fails the !prompt check.

Common situations: Scripts that always append --lyrics plus --lyrics-optimizer 'for better results'; users assuming the optimizer takes lyrics as input; empty prompt coming from an unset variable in a wrapper script.

Related errors


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