Skip to content

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

Merged
obs-gh-abhinavpappu merged 1 commit into
mainfrom
abhinav.pappu/cli-experimental-flag-v2
Jun 26, 2026
Merged

feat(experimental): gate experimental commands behind OBSERVE_CLI_EXPERIMENTAL#14
obs-gh-abhinavpappu merged 1 commit into
mainfrom
abhinav.pappu/cli-experimental-flag-v2

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. 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.

Marking a command experimental

Commands and route maps are defined with defineCommand / defineRoutes (thin wrappers over stricli's builders). A command is marked with a single field, and a route group becomes experimental automatically once all of its children are:

defineCommand({ experimental: true, /* ...loader, parameters, docs */ });

Promoting to GA = deleting the field. Full guide in AGENTS.md. Applied here to the content, data-connection, ingest-token, and datasource groups.

Notes for reviewers

  • The experimental feature lives in src/lib/experimental.ts; defineCommand/defineRoutes are thin wrappers in src/lib/stricli-wrappers.ts. Most of the diff is the mechanical swap of every command/route map onto those wrappers.
  • Experimental-ness bubbles up: each route map only inspects its direct children, marking itself when all of them are experimental.
  • Experimental commands are intentionally omitted from the README command table and features.

Verification

  • bun run typecheck, bun run lint, bun run format clean; bun test 256 pass.
  • Manual: flag off → commands hidden and refuse to run; OBSERVE_CLI_EXPERIMENTAL=1 → visible with the [experimental] badge and runnable.

🤖 Generated with Claude Code

@obs-gh-abhinavpappu obs-gh-abhinavpappu changed the title feat(experimental): gate experimental commands via defineCommand/defineRoutes (v2) feat(experimental): gate experimental commands behind OBSERVE_CLI_EXPERIMENTAL Jun 26, 2026
…ERIMENTAL

Add experimental command gating. A command is marked experimental with a single
declarative field — `defineCommand({ experimental: true, ... })` — and a route
group becomes experimental automatically once all of its children are. An
experimental command 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/stricli-wrappers.ts: thin defineCommand/defineRoutes over
  stricli's builders that own the custom-field set and dispatch to feature
  modules around the build
- add src/lib/experimental.ts: the experimental feature (gate, badge,
  execution-blocking, registry, arg/docs transforms); experimental-ness bubbles
  up from leaves to groups
- add src/lib/experimental.test.ts: e2e command-tree tests
- define every command and route map via defineCommand/defineRoutes
- mark the content, data-connection, ingest-token, and datasource groups
  experimental

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@obs-gh-abhinavpappu obs-gh-abhinavpappu marked this pull request as ready for review June 26, 2026 00:49
@obs-gh-abhinavpappu obs-gh-abhinavpappu force-pushed the abhinav.pappu/cli-experimental-flag-v2 branch from e4fe963 to b89c7f5 Compare June 26, 2026 00:49
@obs-gh-abhinavpappu obs-gh-abhinavpappu merged commit e9473e0 into main Jun 26, 2026
4 checks passed
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.

2 participants