jackwener/OpenCLI · error · ArgumentError

Unsupported --model "${model}"

Error message

Unsupported --model "${model}"

What it means

An ArgumentError from argument validation in `opencli suno generate`: the `--model` value is not in the SUNO_MODELS allowlist (default is V5.5 chirp-fenix). The CLI validates the model id before contacting Suno and fails fast with the list of accepted choices.

Source

Thrown at clis/suno/generate.js:83

        { name: 'model', help: `Model id: ${SUNO_MODELS.join(', ')}. Default: ${DEFAULT_SUNO_MODEL}` },
        { name: 'weirdness', help: 'Creative weirdness slider (0..1). Default: 0.5' },
        { name: 'style-weight', help: 'Style adherence slider (0..1). Default: 0.5' },
        { name: 'formats', help: 'Comma-separated download formats: mp3, m4a, wav, video, cover, metadata. Default: mp3,metadata' },
        { name: 'op', help: 'Output directory (default: ~/Music/suno)' },
        { name: 'timeout', type: 'int', default: 300, help: 'Max seconds to wait for clips to finish (default: 300)' },
        { name: 'sd', type: 'boolean', default: false, help: 'Skip download; only print clip ids and Suno URLs' },
        { name: 'confirm-paid', type: 'boolean', default: false, help: 'Required to allow paid downloads (wav). Without it, paid formats are skipped with a warning.' },
    ],
    columns: ['status', 'clip', 'title', 'files', 'link'],
    func: async (page, kwargs) => {
        const lyrics = kwargs.lyrics ? String(kwargs.lyrics) : '';
        const tags = kwargs.tags ? String(kwargs.tags) : '';
        const negativeTags = kwargs['negative-tags'] ? String(kwargs['negative-tags']) : '';
        const description = kwargs.prompt ? String(kwargs.prompt) : '';
        const titleArg = kwargs.title ? String(kwargs.title) : '';
        const model = kwargs.model ? String(kwargs.model).trim() : DEFAULT_SUNO_MODEL;
        if (!SUNO_MODELS.includes(model)) {
            throw new ArgumentError(`Unsupported --model "${model}"`, `Choices: ${SUNO_MODELS.join(', ')}`);
        }

        const isCustom = lyrics.trim() !== '';
        if (!isCustom && !description.trim()) {
            throw new ArgumentError(
                'Either provide a Simple-mode prompt as the positional argument, or pass --lyrics for Custom mode.',
                'Examples:\n  opencli suno generate "lo-fi study beat, 80 bpm"\n  opencli suno generate --lyrics "[Verse]\\n..." --tags "synthwave, 120 bpm"',
            );
        }
        if (!isCustom && (tags || negativeTags)) {
            throw new ArgumentError('--tags and --negative-tags only apply in Custom mode (alongside --lyrics).');
        }

        const requestedFormats = parseFormats(kwargs.formats);
        const confirmPaid = normalizeBooleanFlag(kwargs['confirm-paid']);
        const skipDownload = normalizeBooleanFlag(kwargs.sd);
        const PAID_FORMATS = new Set(['wav']);
        const skippedPaid = [];

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Use one of the choices printed in the error's hint (`Choices: ...`) — e.g. pass --model with the exact supported id.
  2. Omit --model entirely to use DEFAULT_SUNO_MODEL (V5.5 chirp-fenix).
  3. Trim stray whitespace/case from the value; comparison is exact against SUNO_MODELS.
  4. If a newer Suno model exists that the list lacks, upgrade @jackwener/opencli so SUNO_MODELS includes it.

Example fix

// before
opencli suno generate "lo-fi beat" --model chirp-v4
// after
opencli suno generate "lo-fi beat"  # default model, or --model <exact id from Choices list>
Defensive patterns

Strategy: validation

Validate before calling

// check the model against the CLI's allowlist before invoking
const SUPPORTED_MODELS = ['v5.5', 'v4', 'v3.5']; // see the Choices hint / --help output
const model = process.env.MODEL?.trim() ?? '';
if (model && !SUPPORTED_MODELS.includes(model)) throw new Error(`unsupported --model ${model}`);

Type guard

const isSupportedModel = (m) => typeof m === 'string' && SUPPORTED_MODELS.includes(m.trim());

Try / catch

try {
  await run(`opencli suno generate "${prompt}" --model ${model}`);
} catch (err) {
  if (String(err.message).includes('Unsupported --model')) {
    // rerun with the exact id from the Choices hint, or omit --model
  } else throw err;
}

Prevention

When it happens

Trigger: Running `opencli suno generate ... --model <value>` where the value isn't exactly one of the supported model ids — e.g. `v4`, `chirp-v3`, a display name like `V5.5`, extra whitespace/casing variants not in the list, or a model newer than the CLI supports.

Common situations: Copy-pasting model names from Suno's UI (display names differ from API ids), guessing model ids, or Suno shipping a new model version before the CLI's SUNO_MODELS was updated.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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