Skip to content

feat(experimental): gate experimental commands behind OBSERVE_CLI_EXPERIMENTAL#13

Draft
obs-gh-abhinavpappu wants to merge 1 commit into
mainfrom
abhinav.pappu/cli-experimental-flag
Draft

feat(experimental): gate experimental commands behind OBSERVE_CLI_EXPERIMENTAL#13
obs-gh-abhinavpappu wants to merge 1 commit into
mainfrom
abhinav.pappu/cli-experimental-flag

Conversation

@obs-gh-abhinavpappu

@obs-gh-abhinavpappu obs-gh-abhinavpappu commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds experimental command gating to the CLI (OB-61541). A command marked experimental is:

  • hidden from help unless OBSERVE_CLI_EXPERIMENTAL=1,
  • non-runnable without the flag (friendly message + exit 1, even if the command name is known),
  • badged [experimental] in help when visible.

SemVer covers only the default (non-experimental) surface; opting in carries no stability guarantees.

What's here

New src/lib/experimental.ts with the toolkit:

  • isExperimentalEnabled(env?) — reads OBSERVE_CLI_EXPERIMENTAL (1/true)
  • withExperimentalBadge(brief) — prefixes the [experimental] badge
  • hideExperimentalRoutes([names], env?) — builds a docs.hideRoute map that hides routes until the flag is set
  • gateExperimental(handler, env?) — wraps a command loader to block execution
  • experimentalDisabledMessage() — the friendly message shown when a gated command is run without the flag

Demonstrated on real commands

To make the change obvious, two existing commands are marked experimental:

  • data-connection generate-stack-url — the single-command case: gate the loader, badge the brief, add the name to the parent map's hideRoute.
  • The content group — the whole-group case: badge the group brief, hide content in app.ts, and (because hiding does not block execution) wrap each of the 6 leaf loaders with gateExperimental.

Marking a command experimental (and un-marking at GA)

Three touches, all from src/lib/experimental.ts: gateExperimental on the loader, withExperimentalBadge on the brief, and the route name in the parent's hideRoute. Promoting to GA = deleting those three markers. Full guide in AGENTS.md.

Notes for reviewers

  • Group gating cost: hiding + badging a group are one line each, but stricli has no group-level execution hook, so blocking execution requires wrapping every leaf loader (6 files for content). That per-leaf friction motivates a possible follow-up (a single declarative experimental: true).
  • Existing unit tests for the gated commands are unaffected — they call the handler functions directly, not the gated loader.
  • generate-stack-url and content are removed from the README command table while experimental (experimental commands are intentionally undocumented for users).

Verification

  • bun run typecheck, bun run lint, bun run format — clean
  • bun test — 263 pass
  • Manual: with the flag off, gated commands are hidden and refuse to run; with OBSERVE_CLI_EXPERIMENTAL=1 they appear with the [experimental] badge and execute.

🤖 Generated with Claude Code

@obs-gh-abhinavpappu obs-gh-abhinavpappu changed the title feat(experimental): gate pre-GA commands behind OBSERVE_CLI_EXPERIMENTAL feat(experimental): gate experimental commands behind OBSERVE_CLI_EXPERIMENTAL Jun 25, 2026
@obs-gh-abhinavpappu obs-gh-abhinavpappu force-pushed the abhinav.pappu/cli-experimental-flag branch from 395ffd7 to 26f12f1 Compare June 25, 2026 18:52
…ERIMENTAL

Add experimental command gating. A command marked experimental is hidden from
help and refuses to run unless OBSERVE_CLI_EXPERIMENTAL=1, and carries an
[experimental] badge when visible. SemVer covers only the default surface.

- add src/lib/experimental.ts: isExperimentalEnabled, withExperimentalBadge,
  hideExperimentalRoutes, gateExperimental, experimentalDisabledMessage
- mark the content, data-connection, ingest-token, and datasource groups
  experimental: badge the group and every subcommand, gate each leaf loader,
  and hide the group in app.ts
- document the workflow in AGENTS.md; omit experimental commands from the
  README command table and features

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@obs-gh-abhinavpappu obs-gh-abhinavpappu force-pushed the abhinav.pappu/cli-experimental-flag branch from 26f12f1 to 1db908c Compare June 25, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant