feat(cli): add an audience flag to hide unreleased commands
Merged
SA
2mo ago+114+114+012345678901234567890123456789-5-5-0123456789
Summary
- CLI commands and groups can be marked
audience: "internal"; they only exist whenSUPERSET_CLI_AUDIENCE=internalis set. - Marks
plugins,mcp,skillsandenvironmentsinternal. Those features are flag-gated to staff or an allowlist in the app, but the CLI showed them to everyone.
Why / Context
The CLI had no way to ship a command without advertising it. Options could be .hidden(), but commands couldn't. This follows the Docker CLI's experimental gate: a label on the command, one check at the root, and an env var to opt in.
This controls what we show and support, not access. Anyone can set the env var, so anything sensitive stays gated on the server.
How It Works
audience?: "internal" | "public"onCommandConfigand groupmeta.ts, defaulting to public. If any node in a path — group or command — is internal, everything from that node down is internal; apublictag below it cannot re-expose anything. A group left with no visible commands is dropped.defineConfig({ audiences })returns the enabled set. The framework doesn't know the env var;packages/cli/cli.config.tsmapsSUPERSET_CLI_AUDIENCE=internalto["internal", "public"].filterByAudienceprunes the command list beforebuildTree, so help, interactive help, routing and "Did you mean" all read one filtered tree. Hidden commands fail withUnknown commandand are never suggested.
Manual QA Checklist
-
cli-framework dev --helpwithout the env var:plugins/mcp/skills/environmentsabsent -
cli-framework dev plugins listwithout the env var:Error: Unknown command: plugins -
SUPERSET_CLI_AUDIENCE=internal cli-framework dev plugins --helpworks - Group-level tag hides the whole subtree (checked with a temporary tag on
feedback, reverted) - A command tagged
publicinside the internalpluginsgroup stays hidden:plugins list→Unknown command: plugins(temporary tag, reverted)
Testing
bun test packages/cli-framework packages/cli: 310 pass, including the newrouter.test.tstsc --noEmitfor cli-framework and cli; biome on the desktop changebiome checkon changed files
Known Limitations
- The desktop's Plugins page (flag-gated to @superset.sh) shells out to
superset plugins install|uninstall|enable|disable, so it runs those withSUPERSET_CLI_AUDIENCE=internal(apps/desktop/src/main/lib/plugin-installs.ts). Without that, staff who haven't set the variable would get installs that report success but never provision skills. It's a stopgap: SUPER-2435 moves the logic in-process and deletes the shell-out along with this override. - Options can't be tagged;
.hidden()remains for those.ws create --cloudstays visible, and the server still gates it. apps/docs/content/docs/cli/cli-reference.mdxstill documentsplugins,mcpandenvironments. We'll update docs as part of each launch.
Rollback
Revert the PR. Nothing is persisted.
Summary by cubic
Adds an audience flag so CLI commands and groups can be hidden unless SUPERSET_CLI_AUDIENCE=internal is set, and marks plugins, mcp, skills, and environments as internal.
- Any internal group or command in a path hides everything below it; groups left with no visible commands are dropped.
- Controls visibility only, not access: anyone can set the env var, so sensitive behavior stays gated server-side.
- Hidden commands are pruned before help, routing, and "Did you mean" suggestions, making them appear not to exist.
- The desktop's Plugins page shells out to
superset plugins …, so it runs those calls withSUPERSET_CLI_AUDIENCE=internal; otherwise staff without the variable would get installs that report success but never provision skills. Stopgap until SUPER-2435 moves the logic in-process and removes the shell-out.
Summary by CodeRabbit
- New Features
- CLI commands can be shown or hidden by audience. Public runs display public commands by default, while internal runs can include internal commands.
- Internal-only commands are now marked as such, including environment, MCP, plugin, and skill commands.
- Commands nested under internal groups or commands remain hidden in public runs, even if individually marked public.