jackwener/OpenCLI · info · EmptyResultError

antigravity workspaces-list: No workspace storage.

Error message

antigravity workspaces-list: No workspace storage.

What it means

Thrown by `antigravity workspaces-list` as an EmptyResultError when the workspaceStorage directory exists but contains no subdirectories. The library filters AG_WORKSPACE_STORAGE entries to directories only; an empty list means no workspace metadata has ever been stored. It is thrown instead of printing an empty table.

Source

Thrown at clis/antigravity/storage.js:309

    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 };
        }).sort((a, b) => b.mtime - a.mtime);
        const limit = Number.isInteger(args?.limit) && args.limit > 0 ? args.limit : 50;
        return rows.slice(0, limit).map((r, i) => ({
            Index: i + 1,
            'Workspace Id': r.id,
            Folder: r.folder.slice(0, 120),

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open a folder in Antigravity to create a workspace entry, then rerun
  2. List contents to confirm only files/emptiness: ls -la ~/Library/Application\ Support/Antigravity/User/workspaceStorage
  3. Remove leftover non-directory files if a cleanup left debris, though the error itself is informational
Defensive patterns

Strategy: validation

Validate before calling

import * as fs from 'node:fs';
const dir = path.join(process.env.HOME, 'Library/Application Support/Antigravity/User/workspaceStorage');
const hasWorkspaces = fs.existsSync(dir) &&
  fs.readdirSync(dir, { withFileTypes: true }).some((d) => d.isDirectory());
if (!hasWorkspaces) console.log('No workspaces stored yet; open a folder in Antigravity.');

Try / catch

try {
  await cli.run(['antigravity', 'workspaces-list']);
} catch (e) {
  if (e.name === 'EmptyResultError') return []; // no workspaces yet
  throw e;
}

Prevention

When it happens

Trigger: Running `opencli antigravity workspaces-list` after readdirSync succeeds but the dirs filter (isDirectory) yields zero entries.

Common situations: Antigravity launched once but no folder/workspace was ever opened; all workspace subdirectories were manually deleted; only stray files (not directories) exist in workspaceStorage.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/c3b3a6934529b734. Report an issue: GitHub.