{"record":{"id":"8c4710b4f4d59588","repo":"jackwener/OpenCLI","slug":"tags-and-negative-tags-only-apply-in-custom-mo","errorCode":null,"errorMessage":"--tags and --negative-tags only apply in Custom mode (alongside --lyrics).","messagePattern":"--tags and --negative-tags only apply in Custom mode \\(alongside --lyrics\\)\\.","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/suno/generate.js","lineNumber":94,"sourceCode":"        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 = [];\n        const formats = requestedFormats.filter(f => {\n            if (PAID_FORMATS.has(f) && !confirmPaid) {\n                skippedPaid.push(f);\n                return false;\n            }\n            return true;\n        });\n        if (!skipDownload && !formats.length) {\n            throw new ArgumentError('All requested formats require --confirm-paid true', 'Add --confirm-paid true or include a free format such as mp3 or metadata.');\n        }\n        const outputDir = resolveSunoOutputDir(kwargs.op);","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/suno/generate.js#L76-L112","documentation":"An ArgumentError rejecting `--tags` / `--negative-tags` when `--lyrics` is absent. These flags map to the Custom-mode API fields (`tags`, `negative_tags`) which only make sense alongside lyrics; in Simple mode Suno derives style itself, so passing them indicates a mode mix-up.","triggerScenarios":"Running `opencli suno generate \"<prompt>\" --tags \"...\"` (or --negative-tags) without --lyrics. The CLI computes isCustom = lyrics.trim() !== '' and throws when style flags appear in Simple mode.","commonSituations":"Users who want to steer style in Simple mode (unsupported — use Custom mode instead), leftover flags in scripts from a previous Custom-mode invocation, or misunderstanding that --tags requires --lyrics.","solutions":["Add --lyrics to switch to Custom mode: style tags then apply (e.g. `--lyrics \"[Verse]...\" --tags \"synthwave\"`).","Or remove --tags/--negative-tags and put style hints directly in the Simple-mode prompt text.","If you only want to exclude elements in Simple mode, phrase it in the description (e.g. \"no vocals\").","Clean up script argument lists so style flags only accompany --lyrics."],"exampleFix":"// before\nopencli suno generate \"synthwave song\" --tags \"synthwave, 120 bpm\"\n// after\nopencli suno generate --lyrics \"[Verse]\\n...\" --tags \"synthwave, 120 bpm\"","handlingStrategy":"validation","validationCode":"// style flags only make sense in Custom mode\nconst useCustom = Boolean(lyrics?.trim());\nif (!useCustom && (tags || negativeTags)) {\n  throw new Error('--tags/--negative-tags require --lyrics (Custom mode)');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await run('opencli suno generate ...');\n} catch (err) {\n  if (String(err.message).includes('only apply in Custom mode')) {\n    // either add --lyrics or move style hints into the prompt text and retry\n  } else throw err;\n}","preventionTips":["Pair --tags/--negative-tags with --lyrics every time.","In Simple mode, put style/exclusion wording directly in the prompt description.","Audit scripted argument builders so style flags are gated on the presence of lyrics."],"tags":["suno","cli","argument-validation","incompatible-flags"],"backgroundTag":"incompatible-flags","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}