jackwener/OpenCLI · warning · ArgumentError
Refusing to spend MiniMax quota without --execute
Error message
Refusing to spend MiniMax quota without --execute
What it means
Music generation consumes paid MiniMax quota, so the CLI is dry-run by default: it performs all validation and then refuses to call the API unless --execute (parsed via boolean()) is true. Without it, the CLI throws this ArgumentError as a cost guard.
Source
Thrown at clis/minimax/music.js:118
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,
}), timeoutSeconds);
const completed = parseCompletedMusic(payload, region);
let audioUrl = null;
let file = null;
if (outputFormat === 'url') {
audioUrl = requireAudioUrl(completed.audio);
} else {
file = commitAudioFile(reservation, decodeAudioHex(completed.audio, completed.expectedBytes, audioFormat));
committed = true;View on GitHub (pinned to 49907e53dc)
Solutions
- Add --execute true (or --execute 1) once you've verified the dry-run output and accept the quota cost
- If you intended a dry run, this error is expected behavior — treat it as confirmation nothing was charged
- Ensure wrapper scripts forward the EXECUTE variable instead of dropping it
- Keep a two-step workflow: run without --execute to preview, then rerun with --execute true
Example fix
// before minimax music --lyrics "..." --prompt "..." // after minimax music --lyrics "..." --prompt "..." --execute true
Defensive patterns
Strategy: validation
Validate before calling
if (!parseBoolFlag(opts.execute)) {
console.warn('Dry run: nothing will be generated. Add --execute true to spend MiniMax quota.');
} Try / catch
try {
runMinimaxMusic(args);
} catch (e) {
if (e.message.includes('Refusing to spend MiniMax quota')) {
console.error('Dry run completed with no errors. Re-run with --execute true to generate.');
process.exitCode = 0; // treat as expected for dry runs
} else throw e;
} Prevention
- Treat a run without --execute as an intentional dry run, not a failure
- Forward the execute flag explicitly in CI and wrapper scripts
- Preview with a dry run first, then add --execute true once validated
- Standardize a two-step run/confirm workflow in your team's tooling
When it happens
Trigger: Running the command fully valid but without --execute; --execute false or --execute 0; an unset/empty EXECUTE variable in a wrapper resolving to false.
Common situations: Testing invocations to check validation and being surprised the API wasn't called; CI jobs where the execute flag was omitted for safety; users migrating from other CLIs that execute by default.
Related errors
- minimax music ${flag} must be one of: ${allowed.join(', ')}
- minimax music ${flag} must be true or false
- minimax music ${flag} must be an integer from ${min} to ${ma
- minimax music ${flag} must be at most ${max} characters
- minimax music --instrumental requires prompt and cannot be c
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/0c559295ce460252.
Report an issue: GitHub.