# Merge pull request \#1703 from entireio/experimental-command-gating

`279520a`→[main](/content/gh/entireio/cli/commits/main/index.html)·

gtrrz-victor·3d ago·11 files·+405 added/-53 removed

feat: gate experimental commands behind build-time visibility flag

## Changes

11

- M.goreleaser.yaml+5

- MCLAUDE.md+25/-7

- cmd/entire/cli

- Mcheckpoint_group.go+2/-1

- experimental

- Aexperimental.go+50

- Aexperimental_test.go+100

- Aexperimental_wiring_test.go+117

- Mexperts_test.go+7/-3

- Minvestigate_bridge_test.go+10/-4

- Mlabs_test.go+53/-11

- Mroot.go+24/-21

- Mroot_test.go+12/-6

```
25 unmodified lines

26
27
28
29
30
31
32
33
34
35
36

25 unmodified lines

- -X github.com/entireio/cli/cmd/entire/cli/versioninfo.Commit={{.ShortCommit}}
      - -X github.com/entireio/cli/cmd/entire/cli/telemetry.PostHogAPIKey={{.Env.POSTHOG_API_KEY}}
      - -X github.com/entireio/cli/cmd/entire/cli/telemetry.PostHogEndpoint={{.Env.POSTHOG_ENDPOINT}}
      # Experimental-command visibility: hide in stable releases, keep visible
      # in nightly (prerelease) builds. .Prerelease is empty for a stable tag
      # (vX.Y.Z) and non-empty for a nightly tag (vX.Y.Z-nightly.*). Local
      # builds carry no stamp and use the package default ("true" = visible).
      - -X github.com/entireio/cli/cmd/entire/cli/experimental.Visible={{ if .Prerelease }}true{{ else }}false{{ end }}

# git-remote-entire is the git remote helper for entire:// URLs (see
  # cmd/git-remote-entire). A small, dedicated binary shipped alongside
```

## Experimental Commands

Experimental commands are gated by a build-time visibility flag (the
`cmd/entire/cli/experimental` package): they are shown — grouped under an
"Experimental commands:" help section — in developer and nightly builds, and
hidden in stable release builds. Visibility is toggled by `experimental.Visible`
(default `"true"`), which GoReleaser stamps `"false"` only on stable tags
(`.Prerelease` empty); nightly (`vX.Y.Z-nightly.*`) and local builds leave it at
the default.

Register a command as experimental with `experimental.Register(parent,
child)` instead of `parent.AddCommand(child)`. Gating only controls visibility —
the commands are always runnable in every build.

- `session` (alias: `sessions`): `list`, `info`, `tokens`, `stop`, `attach`, `adopt`, `resume`, `current`.
  `resume` with a branch arg switches to it and resumes its session; with no arg

- `grant`: manage access grants and org membership — `org`, `project`, and `repo`
each support `add` / `list` / `remove`

### Experimental command families advertised through `entire labs`:

- `tokens`: `profile` (hidden from root help while token diagnostics mature)

Experimental commands (gated by the build-time visibility flag above — visible
and grouped under "Experimental commands:" in developer/nightly builds, hidden
in stable releases, always runnable): `tokens`, `import`, `review`, `investigate`,
`blame`, `why`, the top-level `search` shortcut, `experts`, `runner`, and
`checkpoint policy`. `tokens` is also advertised through `entire labs`. The
canonical `checkpoint search` is not gated and stays visible.

### Top-level lifecycle and standalone commands

- `enable`, `disable`, `status`, `login`, `logout`, `clean`, `version`, `dispatch`,
  `activity`, `help`.

### Experimental command visibility

Gated as experimental: visible and grouped in developer builds (the default test build),
hidden in shipped releases.
