{"record":{"id":"90f2c0a518e34ae9","repo":"jackwener/OpenCLI","slug":"workspacestorage-not-found-ag-workspace-storage","errorCode":null,"errorMessage":"workspaceStorage not found: ${AG_WORKSPACE_STORAGE}","messagePattern":"workspaceStorage not found: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/antigravity/storage.js","lineNumber":303,"sourceCode":"    },\n});\n\n// ====== FS-side: workspaces-list ======\ncli({\n    site: 'antigravity',\n    name: 'workspaces-list',\n    access: 'read',\n    description: 'List Antigravity workspaceStorage entries (each represents a previously-opened folder).',\n    domain: 'localhost',\n    strategy: Strategy.LOCAL,\n    browser: false,\n    args: [\n        { name: 'limit', type: 'int', required: false, default: 50, help: 'Max rows to return' },\n    ],\n    columns: STORAGE_COLUMNS,\n    func: async (args) => {\n        if (!fs.existsSync(AG_WORKSPACE_STORAGE)) {\n            throw new CommandExecutionError(`workspaceStorage not found: ${AG_WORKSPACE_STORAGE}`, '');\n        }\n        const dirs = fs.readdirSync(AG_WORKSPACE_STORAGE).filter((n) => {\n            const full = path.join(AG_WORKSPACE_STORAGE, n);\n            return fs.statSync(full).isDirectory();\n        });\n        if (!dirs.length) throw new EmptyResultError('antigravity workspaces-list', 'No workspace storage.');\n        const rows = dirs.map((id) => {\n            const dir = path.join(AG_WORKSPACE_STORAGE, id);\n            const wj = path.join(dir, 'workspace.json');\n            let folder = '(no workspace.json)';\n            if (fs.existsSync(wj)) {\n                try {\n                    const outer = JSON.parse(fs.readFileSync(wj, 'utf-8'));\n                    if (outer.folder) folder = decodeURI(outer.folder.replace(/^file:\\/\\//, ''));\n                    else if (outer.workspace) folder = '(multi-folder) ' + decodeURI(outer.workspace.replace(/^file:\\/\\//, ''));\n                } catch { folder = '(invalid workspace.json)'; }\n            }\n            return { id, folder, mtime: fs.statSync(dir).mtimeMs };","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/antigravity/storage.js#L285-L321","documentation":"Thrown by `antigravity workspaces-list` as a CommandExecutionError when the workspaceStorage directory (~/Library/Application Support/Antigravity/User/workspaceStorage) does not exist on disk. The command enumerates per-workspace subdirectories there, so without the directory it cannot proceed. It indicates Antigravity has never persisted workspace storage on this machine.","triggerScenarios":"Running `opencli antigravity workspaces-list` when fs.existsSync(AG_WORKSPACE_STORAGE) is false — the User/workspaceStorage folder is missing.","commonSituations":"Antigravity never launched; profile directory deleted or relocated; running under a different OS user/homedir than the one Antigravity uses; cleanup scripts that removed Application Support data.","solutions":["Launch Antigravity and open a workspace so it creates workspaceStorage, then rerun","Check the directory exists: ls ~/Library/Application\\ Support/Antigravity/User/workspaceStorage","If you deleted it, restore from backup or let Antigravity recreate it by opening a folder"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as os from 'node:os';\nconst dir = path.join(os.homedir(), 'Library/Application Support/Antigravity/User/workspaceStorage');\nif (!fs.existsSync(dir)) {\n  throw new Error(`Run Antigravity at least once; missing ${dir}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await cli.run(['antigravity', 'workspaces-list']);\n} catch (e) {\n  if (String(e.message).startsWith('workspaceStorage not found')) {\n    console.log('Antigravity has never been run on this machine/account.');\n  } else throw e;\n}","preventionTips":["Launch Antigravity once on the target machine before running storage commands","Run the CLI as the same OS user that owns the Antigravity profile","Exclude cleanup jobs from deleting ~/Library/Application Support/Antigravity"],"tags":["filesystem","missing-path","antigravity"],"backgroundTag":"missing-directory","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}