jackwener/OpenCLI · error · CommandExecutionError
workspaceStorage not found: ${AG_WORKSPACE_STORAGE}
Error message
workspaceStorage not found: ${AG_WORKSPACE_STORAGE} What it means
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.
Source
Thrown at clis/antigravity/storage.js:303
},
});
// ====== FS-side: workspaces-list ======
cli({
site: 'antigravity',
name: 'workspaces-list',
access: 'read',
description: 'List Antigravity workspaceStorage entries (each represents a previously-opened folder).',
domain: 'localhost',
strategy: Strategy.LOCAL,
browser: false,
args: [
{ name: 'limit', type: 'int', required: false, default: 50, help: 'Max rows to return' },
],
columns: STORAGE_COLUMNS,
func: async (args) => {
if (!fs.existsSync(AG_WORKSPACE_STORAGE)) {
throw new CommandExecutionError(`workspaceStorage not found: ${AG_WORKSPACE_STORAGE}`, '');
}
const dirs = fs.readdirSync(AG_WORKSPACE_STORAGE).filter((n) => {
const full = path.join(AG_WORKSPACE_STORAGE, n);
return fs.statSync(full).isDirectory();
});
if (!dirs.length) throw new EmptyResultError('antigravity workspaces-list', 'No workspace storage.');
const rows = dirs.map((id) => {
const dir = path.join(AG_WORKSPACE_STORAGE, id);
const wj = path.join(dir, 'workspace.json');
let folder = '(no workspace.json)';
if (fs.existsSync(wj)) {
try {
const outer = JSON.parse(fs.readFileSync(wj, 'utf-8'));
if (outer.folder) folder = decodeURI(outer.folder.replace(/^file:\/\//, ''));
else if (outer.workspace) folder = '(multi-folder) ' + decodeURI(outer.workspace.replace(/^file:\/\//, ''));
} catch { folder = '(invalid workspace.json)'; }
}
return { id, folder, mtime: fs.statSync(dir).mtimeMs };View on GitHub (pinned to 49907e53dc)
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
Defensive patterns
Strategy: validation
Validate before calling
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as os from 'node:os';
const dir = path.join(os.homedir(), 'Library/Application Support/Antigravity/User/workspaceStorage');
if (!fs.existsSync(dir)) {
throw new Error(`Run Antigravity at least once; missing ${dir}`);
} Try / catch
try {
await cli.run(['antigravity', 'workspaces-list']);
} catch (e) {
if (String(e.message).startsWith('workspaceStorage not found')) {
console.log('Antigravity has never been run on this machine/account.');
} else throw e;
} Prevention
- 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
When it happens
Trigger: Running `opencli antigravity workspaces-list` when fs.existsSync(AG_WORKSPACE_STORAGE) is false — the User/workspaceStorage folder is missing.
Common situations: 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.
Related errors
- state.vscdb not found: ${db}
- sqlite3 failed on ${path.basename(db)}: ${e.message}
- Workspace state.vscdb not found: ${db}
- antigravity workspaces-list: No workspace storage.
- settings.json not found: ${AG_SETTINGS_JSON}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/90f2c0a518e34ae9.
Report an issue: GitHub.