feat(cli): add hidden flag support for legacy commands#5278
Merged
Conversation
Introduces a withHidden() helper that registers a flag's name and filters it out of help-doc rendering, mirroring Cobra's MarkHidden which Effect's CLI does not yet expose. Help output for both text and JSON formatters now strips hidden flags. Adds the remaining Go-hidden flags to the legacy shell so the TS shim matches the Go CLI surface exactly: - start --preview - projects create --interactive (-i), --plan - functions deploy --use-docker, --legacy-bundle - functions download --use-docker, --legacy-bundle - functions serve --all Each flag is forwarded to the Go binary via the proxy handler when set. https://claude.ai/code/session_01KEg7JPF7EM7gicUD8KVpaa
The Go CLI defines --linked and --local as persistent flags on the seed group, so seed buckets accepts them (as a no-op, since buckets hardcodes linked=true). Effect CLI does not expose group-level persistent flags, so the TS shim previously rejected them. Adds them as explicit flags on the buckets subcommand and forwards to the Go binary to preserve invocation parity. https://claude.ai/code/session_01KEg7JPF7EM7gicUD8KVpaa
jgoux
approved these changes
May 18, 2026
avallete
pushed a commit
that referenced
this pull request
May 19, 2026
## TL;DR hide legacy subcommands from help output when the go cli marks them hidden, while keeping them callable ## prob the legacy ts cli still showed a few subcommands in `--help` that the go cli explicitly marks as hidden: - `branches disable` - `db branch` - `db remote` - `db test` this happened because the existing hidden help mechanism only covered flags, not subcommands change extends the same pattern to hidden subcommands and annotates the affected parent commands accordingly execution is unchanged, so the subcommands remain callable directly ## ref: - extends #5278
avallete
added a commit
that referenced
this pull request
May 20, 2026
…the right baseline (#5321) Fixes `bun apps/cli/scripts/backfill-release-notes.ts --tag v2.100.0-beta.2`, which currently errors with `semantic-release did not compute a next release for v2.100.0-beta.2`. ## Why it fails today semantic-release's `lastRelease` picker accepts both prerelease tags on the branch's channel **and** stable tags via the prerelease filter's stable-fallback clause, then sorts the survivors by semver. When a stable and a beta share a commit (e.g. `v2.100.0` and `v2.100.0-beta.2` are both at `9a22aff6`), the stable wins the sort — and since it points at HEAD itself, semantic-release reports "Found 0 commits since last release" and emits no `nextRelease`. The script's version-mismatch guard then exits with the "did not compute a next release" error. ## Fix After resolving the target tag's commit, delete *every* local tag that points at that commit, not just the target. Co-located tags are by definition the same release, and dropping them lets semantic-release fall back to the genuine prior release on the channel (`v2.100.0-beta.1` in the example). ## Sample output (`v2.100.0-beta.2`) ```sh $ bun apps/cli/scripts/backfill-release-notes.ts --tag v2.100.0-beta.2 ``` ```markdown # [2.100.0-beta.2](v2.100.0-beta.1...v2.100.0-beta.2) (2026-05-20) ### Features * **cli:** add hidden flag support for legacy commands ([#5278](#5278)) ([9a22aff](9a22aff)), closes [#5277](#5277) ``` Regression-checked locally that `v2.99.0-beta.2` (where stable and beta are on different commits) and `v2.100.1` (stable backfill) still produce the same output as before. --- _Generated by [Claude Code](https://claude.ai/code/session_016p4TNXziTipWocxmgLDc8b)_ Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the remaining Go-hidden flags to the legacy shell so the TS shim parses them transparently (no help-output divergence), and accepts
seed buckets --linked/--localfor runtime parity. Closes the last open items from the CLI-1483 audit.Hidden-flag mechanism
Effect's CLI DSL does not expose a hidden-flag modifier, so this PR introduces one:
apps/cli/src/shared/cli/hidden-flag.tswithHidden(flag)registers the flag's underlying single name in a module-scoped set and returns the same flag instance unchanged.stripHiddenFlagsFromHelpDoc(doc)filters those names out of bothflagsandglobalFlags.shared/output/text-formatter.tsandjson-formatter.tsnow run every HelpDoc through that filter before rendering, so hidden flags are parsed normally but never appear in--help.Go-parity hidden flags added to the legacy shell
Each flag is forwarded to the Go binary by the proxy handler when set:
start --preview(bool)projects create --interactive/-i(bool, tri-state viaOption) and--plan(string)functions deploy --use-docker,--legacy-bundle(bool)functions download --use-docker,--legacy-bundle(bool)functions serve --all(bool, tri-state viaOption)Persistent group flags
Go declares
--linked/--localas persistent flags on theseedgroup. Effect's CLI doesn't expose group-level persistent flags, so this PR adds them as explicit (visible) flags on theseed bucketssubcommand and forwards them to the Go binary. The Go implementation hardcodeslinked=truefor buckets, so the behavior is a no-op — but the invocation now matches.Other places where Go has
--linked/--local(e.g.gen types,db diff/push/pull/reset,migration *,test db,inspect db *,storage *) already declare them per-subcommand in the TS shim, so no other commands changed.Tests
hidden-flag.unit.test.tscoverswithHidden()(identity preservation, registration through wrapped combinators) andstripHiddenFlagsFromHelpDoc()(flags, globalFlags, and untouched docs).pnpm check:allandpnpm test:corepass locally.Closes: #5277
Closes: CLI-1483
https://claude.ai/code/session_01KEg7JPF7EM7gicUD8KVpaa