feat(cli): hide commands that cannot work inside a cloud workspace

Merged
SA
2mo ago
+70-43

What

superset --help inside a cloud workspace no longer lists commands that cannot work there. Commands and groups can carry sandbox: false; the command tree hides them when the CLI runs under SUPERSET_SANDBOX_WORKSPACE_ID (the signal resolve-auth.ts already keys on).

Tagged: auth login, auth logout, start, stop, update, hosts wake, hosts set-wake, plugins install/uninstall/enable/disable/connect, plugins marketplace add/remove. whoami, plugins list/sync, hosts list stay — a box needs to be able to say who it acts as.

Why

A box holds no login, its lifecycle belongs to the control plane, and account-state writes from a box are a person's call. Until now an agent learned all of that by collecting 403s. Visibility only; the API keeps enforcing.

This is a second axis beside audience (#7776), not a third audience value: audience is release stage, sandbox is surface. Same filterByAudience, one extra predicate, prefix hiding as before.

Verified

  • cli-framework tests 35/35 (one block added to the existing router.test.ts), Biome clean, tsc clean on both packages.
  • Dev runner, outside vs inside a box (SUPERSET_SANDBOX_WORKSPACE_ID set):
outsideinside
auth --helplogin, logout, whoamiwhoami
plugins --help (internal)full setlist, marketplace (list only), sync
hosts --helplist, wake, set-wakelist

Context: https://app.superset.sh/page/plugins-in-sandboxes-review-ax4huu

https://claude.ai/code/session_01BVBuTCFBb1JkoX76VpLAQ8


Summary by cubic

Hides commands that can't work inside a cloud workspace from superset --help, instead of letting agents discover them via 403s. Drop a flaky watcher-manager recovery test that raced the chokidar backend on shared runners; its backends' own create/update/delete and ignore tests remain.

  • Commands and groups now support sandbox: false, which hides them when SUPERSET_SANDBOX_WORKSPACE_ID is set — the same signal resolve-auth.ts uses.
  • Tagged: auth login/logout, start, stop, update, hosts wake/set-wake, plugin install/uninstall/enable/disable/connect, and marketplace add/remove. whoami, plugins list/sync, and hosts list stay.
  • This is a second axis beside audience (release stage vs surface), so it reuses filterByAudience with one additional predicate. API enforcement is unchanged.

Summary by CodeRabbit

  • New Features
    • Cloud workspace environments now hide commands that require local system access, keeping unavailable actions out of the command list.
    • Authentication, host management, plugin management, start/stop, and update commands are marked as requiring local access and are hidden in cloud workspaces. They remain available in other environments.