Skip to content

feat(cli): gate commands and options by release - #651

Open
coillteoir wants to merge 1 commit into
jj-stack/feat-cli-add-featuregate-and-the-cloudsmith-feature-version-override-snxqxvzmfrom
jj-stack/feat-cli-gate-commands-and-options-by-release-snzmpswq
Open

coillteoir wants to merge 1 commit into
jj-stack/feat-cli-add-featuregate-and-the-cloudsmith-feature-version-override-snxqxvzmfrom
jj-stack/feat-cli-gate-commands-and-options-by-release-snzmpswq

Conversation

@coillteoir

Copy link
Copy Markdown
Contributor

Add @gate for commands and groups and @gate_option for options. A closed gate makes the command or option behave as if it does not exist: it is missing from help, shell completion and suggestions, and using it fails with click's own "No such command" or "No such option".

  • GatedMixin drops closed options in get_params, and gives the callback the default of each dropped option so its signature does not change.
  • GatedGroupMixin hides closed commands and filters click 8.5's suggestions.
  • AliasGroup and TrackedGroup use them, so aliases, unique prefixes and lazy commands are gated too.
  • Gates read only the major and minor, without loading semver.
  • Document gates in CONTRIBUTING.md and AGENTS.md.

Add @gate for commands and groups and @gate_option for options. A closed
gate makes the command or option behave as if it does not exist: it is
missing from help, shell completion and suggestions, and using it fails with
click's own "No such command" or "No such option".

- GatedMixin drops closed options in get_params, and gives the callback the
  default of each dropped option so its signature does not change.
- GatedGroupMixin hides closed commands and filters click 8.5's suggestions.
- AliasGroup and TrackedGroup use them, so aliases, unique prefixes and lazy
  commands are gated too.
- Gates read only the major and minor, without loading semver.
- Document gates in CONTRIBUTING.md and AGENTS.md.
@coillteoir
coillteoir requested a review from a team as a code owner December 1, 2026 18:35
@coillteoir
coillteoir added this pull request to stack #652 December 1, 2026 18:35

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant