jackwener/OpenCLI · error · ArgumentError

minimax music --instrumental requires prompt and cannot be c

Error message

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

What it means

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.

Source

Thrown at clis/minimax/music.js:103

    ],
    columns: ['status', 'model', 'region', 'output_format', 'audio_format', 'audio_url', 'file', 'expires_in_hours'],
    func: async (kwargs) => {
        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();

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Remove --lyrics and --lyrics-optimizer when using --instrumental and supply a real --prompt
  2. Or drop --instrumental and use --lyrics (or --prompt with --lyrics-optimizer) for vocal tracks
  3. Verify the prompt is non-empty after trimming — an empty string counts as absent
  4. Restructure the calling script to pick exactly one mode: instrumental(prompt) vs vocals(lyrics | prompt+optimizer)

Example fix

// before
minimax music --instrumental true --lyrics "la la la"
// after
minimax music --instrumental true --prompt "upbeat jazz piano trio"
Defensive patterns

Strategy: validation

Validate before calling

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

Try / catch

try {
  runMinimaxMusic(args);
} catch (e) {
  if (e.message.includes('--instrumental requires')) {
    console.error('Mode conflict: use either --instrumental + --prompt OR --lyrics OR --prompt + --lyrics-optimizer');
    process.exitCode = 2;
  } else throw e;
}

Prevention

When it happens

Trigger: --instrumental true together with --lyrics "..."; --instrumental true together with --lyrics-optimizer; --instrumental true with an empty/whitespace-only prompt (prompt='' fails the !prompt check).

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

Related errors


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