jackwener/OpenCLI · error · ArgumentError

minimax music vocal generation requires --lyrics, or prompt

Error message

minimax music vocal generation requires --lyrics, or prompt with --lyrics-optimizer

What it means

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.

Source

Thrown at clis/minimax/music.js:109

        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 {
            const payload = await generateMusic(region, apiKey, buildRequest({
                model, prompt, lyrics, outputFormat, audioFormat, sampleRate, bitrate,
                instrumental, lyricsOptimizer, aigcWatermark,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Add --lyrics "..." for vocal generation, or
  2. Add --instrumental true with --prompt, or
  3. Add --lyrics-optimizer true alongside an existing --prompt
  4. Print your resolved flags (or run without --execute first) to see which mode variables are empty

Example fix

// before
minimax music --prompt "sad piano" --execute
// after
minimax music --prompt "sad piano" --instrumental true --execute
Defensive patterns

Strategy: validation

Validate before calling

function assertHasMode(o) {
  const has = o.instrumental || (o.lyrics?.trim()) || (o.lyricsOptimizer && o.prompt?.trim());
  if (!has) throw new Error('Provide --lyrics, or --instrumental with --prompt, or --prompt with --lyrics-optimizer');
}
assertHasMode(cliOpts); // before invoking

Try / catch

try {
  runMinimaxMusic(args);
} catch (e) {
  if (e.message.includes('vocal generation requires')) {
    console.error('No generation mode set: add --lyrics OR --instrumental OR --prompt + --lyrics-optimizer');
    process.exitCode = 2;
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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