{"record":{"id":"3ed30544f766dfd1","repo":"jackwener/OpenCLI","slug":"no-suno-clips-found-in-your-library","errorCode":null,"errorMessage":"No Suno clips found in your library.","messagePattern":"No Suno clips found in your library\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/suno/list.js","lineNumber":62,"sourceCode":"                    'Authorization': 'Bearer ' + (await window.Clerk.session.getToken()),\n                    'browser-token': browserToken,\n                    'device-id': ${JSON.stringify(deviceId)},\n                },\n            });\n            if (!res.ok) return { ok: false, status: res.status };\n            const data = await res.json().catch(() => null);\n            if (!data || !Array.isArray(data.clips)) return { ok: false, error: 'malformed clips payload' };\n            return { ok: true, clips: data.clips };\n        })()`));\n\n        if (!result?.ok) {\n            throw new CommandExecutionError(result?.error || `Suno feed lookup failed (HTTP ${result?.status || '?'}).`);\n        }\n        if (!Array.isArray(result.clips)) {\n            throw new CommandExecutionError('Suno feed lookup returned malformed clips payload');\n        }\n        if (result.clips.length === 0) {\n            throw new EmptyResultError('suno list', 'No Suno clips found in your library.');\n        }\n\n        return result.clips.slice(0, limit).map((c, i) => {\n            if (!c || typeof c.id !== 'string' || !c.id) {\n                throw new CommandExecutionError('Suno feed lookup returned malformed clip identity');\n            }\n            return {\n                rank: i + 1 + pageOffset * limit,\n                clip: c.id.slice(0, 8),\n                title: c.title || '(untitled)',\n                status: c.status || '?',\n                created: (c.created_at || '').replace('T', ' ').replace(/\\..*$/, '').replace(/Z$/, ''),\n                link: `${SUNO_URL}/song/${c.id}`,\n            };\n        });\n    },\n});\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/suno/list.js#L44-L80","documentation":"`opencli suno list` throws EmptyResultError (not CommandExecutionError) when the library feed returns zero clips. This is a deliberate 'successful call, no data' signal so agents can distinguish an empty library from a failure.","triggerScenarios":"Feed v2 returns `{clips: []}` — the authenticated account has no songs on the requested page (`--page` offset beyond existing content) or has never generated music.","commonSituations":"Brand-new Suno account, wrong account logged in (expecting another profile's library), or paginating past the end (`--page 5` with only 3 pages of clips).","solutions":["Confirm the browser profile is logged into the Suno account you expect.","Generate a song first (opencli suno generate) and retry.","Retry with --page 0 to make sure you're not paginating past the end.","If scripting, treat EmptyResultError as an empty-list case, not a failure."],"exampleFix":"// before: crashes the script on empty library\nconst clips = await opencli('suno', 'list');\n// after: handle empty as valid\ntry {\n  const clips = await opencli('suno', 'list');\n} catch (e) {\n  if (e.name === 'EmptyResultError') return [];\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check account state before scripting against the library:\nconst session = await ensureSunoSession(page);\n// confirm session belongs to the expected account (email/plan) before listing","typeGuard":"function isEmptyResultError(e) { return e?.name === 'EmptyResultError' || /No Suno clips found/i.test(e?.message || ''); }","tryCatchPattern":"let clips = [];\ntry {\n  clips = await opencli('suno', 'list', '--page', '0');\n} catch (e) {\n  if (isEmptyResultError(e)) return []; // empty library is valid\n  throw e;\n}","preventionTips":["Start from --page 0 and stop paginating when EmptyResultError appears.","Verify the active Suno account matches the library you expect.","Treat EmptyResultError as data-empty, not command-failure, in automation.","Generate at least one song before building pipelines that consume listings."],"tags":["empty-result","pagination","account-state"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}