{"record":{"id":"26b7ca028f3c04e1","repo":"jackwener/OpenCLI","slug":"unsupported-model-model","errorCode":null,"errorMessage":"Unsupported --model \"${model}\"","messagePattern":"Unsupported --model \"(.+?)\"","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/suno/generate.js","lineNumber":83,"sourceCode":"        { name: 'model', help: `Model id: ${SUNO_MODELS.join(', ')}. Default: ${DEFAULT_SUNO_MODEL}` },\n        { name: 'weirdness', help: 'Creative weirdness slider (0..1). Default: 0.5' },\n        { name: 'style-weight', help: 'Style adherence slider (0..1). Default: 0.5' },\n        { name: 'formats', help: 'Comma-separated download formats: mp3, m4a, wav, video, cover, metadata. Default: mp3,metadata' },\n        { name: 'op', help: 'Output directory (default: ~/Music/suno)' },\n        { name: 'timeout', type: 'int', default: 300, help: 'Max seconds to wait for clips to finish (default: 300)' },\n        { name: 'sd', type: 'boolean', default: false, help: 'Skip download; only print clip ids and Suno URLs' },\n        { name: 'confirm-paid', type: 'boolean', default: false, help: 'Required to allow paid downloads (wav). Without it, paid formats are skipped with a warning.' },\n    ],\n    columns: ['status', 'clip', 'title', 'files', 'link'],\n    func: async (page, kwargs) => {\n        const lyrics = kwargs.lyrics ? String(kwargs.lyrics) : '';\n        const tags = kwargs.tags ? String(kwargs.tags) : '';\n        const negativeTags = kwargs['negative-tags'] ? String(kwargs['negative-tags']) : '';\n        const description = kwargs.prompt ? String(kwargs.prompt) : '';\n        const titleArg = kwargs.title ? String(kwargs.title) : '';\n        const model = kwargs.model ? String(kwargs.model).trim() : DEFAULT_SUNO_MODEL;\n        if (!SUNO_MODELS.includes(model)) {\n            throw new ArgumentError(`Unsupported --model \"${model}\"`, `Choices: ${SUNO_MODELS.join(', ')}`);\n        }\n\n        const isCustom = lyrics.trim() !== '';\n        if (!isCustom && !description.trim()) {\n            throw new ArgumentError(\n                'Either provide a Simple-mode prompt as the positional argument, or pass --lyrics for Custom mode.',\n                'Examples:\\n  opencli suno generate \"lo-fi study beat, 80 bpm\"\\n  opencli suno generate --lyrics \"[Verse]\\\\n...\" --tags \"synthwave, 120 bpm\"',\n            );\n        }\n        if (!isCustom && (tags || negativeTags)) {\n            throw new ArgumentError('--tags and --negative-tags only apply in Custom mode (alongside --lyrics).');\n        }\n\n        const requestedFormats = parseFormats(kwargs.formats);\n        const confirmPaid = normalizeBooleanFlag(kwargs['confirm-paid']);\n        const skipDownload = normalizeBooleanFlag(kwargs.sd);\n        const PAID_FORMATS = new Set(['wav']);\n        const skippedPaid = [];","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/suno/generate.js#L65-L101","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use one of the choices printed in the error's hint (`Choices: ...`) — e.g. pass --model with the exact supported id.","Omit --model entirely to use DEFAULT_SUNO_MODEL (V5.5 chirp-fenix).","Trim stray whitespace/case from the value; comparison is exact against SUNO_MODELS.","If a newer Suno model exists that the list lacks, upgrade @jackwener/opencli so SUNO_MODELS includes it."],"exampleFix":"// before\nopencli suno generate \"lo-fi beat\" --model chirp-v4\n// after\nopencli suno generate \"lo-fi beat\"  # default model, or --model <exact id from Choices list>","handlingStrategy":"validation","validationCode":"// check the model against the CLI's allowlist before invoking\nconst SUPPORTED_MODELS = ['v5.5', 'v4', 'v3.5']; // see the Choices hint / --help output\nconst model = process.env.MODEL?.trim() ?? '';\nif (model && !SUPPORTED_MODELS.includes(model)) throw new Error(`unsupported --model ${model}`);","typeGuard":"const isSupportedModel = (m) => typeof m === 'string' && SUPPORTED_MODELS.includes(m.trim());","tryCatchPattern":"try {\n  await run(`opencli suno generate \"${prompt}\" --model ${model}`);\n} catch (err) {\n  if (String(err.message).includes('Unsupported --model')) {\n    // rerun with the exact id from the Choices hint, or omit --model\n  } else throw err;\n}","preventionTips":["Omit --model to always use the CLI default (V5.5 chirp-fenix).","Copy model ids from `opencli suno generate --help` or the Choices hint, not Suno's UI display names.","Keep the CLI updated when new Suno models ship."],"tags":["suno","cli","argument-validation","invalid-model"],"backgroundTag":"invalid-argument-value","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}