{"record":{"id":"5684e0a60131a1d0","repo":"jackwener/OpenCLI","slug":"chatgpt-project-list","errorCode":null,"errorMessage":"chatgpt project-list","messagePattern":"chatgpt project-list","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/chatgpt/project-list.js","lineNumber":33,"sourceCode":"    domain: CHATGPT_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [\n        { name: 'limit', type: 'int', default: 20, help: 'Max projects to show' },\n    ],\n    columns: ['Index', 'Id', 'Title', 'Url'],\n    func: async (page, kwargs) => {\n        const limit = requirePositiveInt(\n            Number(kwargs.limit ?? 20),\n            'chatgpt project-list --limit',\n            'Example: opencli chatgpt project-list --limit 20',\n        );\n        await ensureChatGPTLogin(page, 'ChatGPT project-list requires a logged-in ChatGPT session.');\n        const projects = await getProjectList(page);\n        if (!projects.length) {\n            throw new EmptyResultError('chatgpt project-list', 'No ChatGPT project links were visible in the sidebar.');\n        }\n        return projects.slice(0, limit);\n    },\n});\n","sourceCodeStart":15,"sourceCodeEnd":38,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/chatgpt/project-list.js#L15-L38","documentation":"EmptyResultError thrown by `chatgpt project-list` after login succeeds but `getProjectList(page)` finds zero project links in the sidebar. It signals the command succeeded mechanically but there was nothing to return.","triggerScenarios":"Running `chatgpt project-list` (optionally with --limit) on a logged-in session where the sidebar contains no ChatGPT project entries.","commonSituations":"Account genuinely has no projects; sidebar collapsed or hidden projects section not expanded; ChatGPT UI redesign moved/renamed project links so selectors miss them; slow load so the sidebar hadn't rendered.","solutions":["Create a ChatGPT project in the web UI first, then re-run.","Expand/collapse the sidebar (or wait for it to load) and retry.","Verify the expected projects exist at chatgpt.com in the browser.","Update the CLI selectors if the ChatGPT sidebar markup changed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Nothing to pre-validate client-side; optionally pre-check via UI:\nconst hasSidebar = await page.$('[data-testid=\"sidebar\"]') !== null;\nif (!hasSidebar) throw new Error('Sidebar not loaded; retry later');","typeGuard":"function isNonEmptyProjects(p) { return Array.isArray(p) && p.length > 0; }","tryCatchPattern":"try {\n  const projects = await run(['chatgpt', 'project-list', '--limit', '20']);\n} catch (err) {\n  if (String(err.message).includes('chatgpt project-list')) {\n    console.log('No projects found — create one at chatgpt.com or expand the sidebar.');\n  }\n}","preventionTips":["Create at least one ChatGPT project before listing.","Wait for the sidebar to render before scraping.","Expect an empty list on fresh accounts and handle it gracefully."],"tags":["empty-result","chatgpt","browser-automation","scraping"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}