Skip to content

refactor(completion): use @gunshi/plugin-completion; upgrade gunshi 0.34→0.36#9

Merged
theoephraim merged 3 commits into
mainfrom
feat/gunshi-completion-plugin
Jul 15, 2026
Merged

refactor(completion): use @gunshi/plugin-completion; upgrade gunshi 0.34→0.36#9
theoephraim merged 3 commits into
mainfrom
feat/gunshi-completion-plugin

Conversation

@theoephraim

Copy link
Copy Markdown
Member

What & why

We were two minors behind on gunshi (0.34.0, latest 0.36.0) and hand-rolling shell completion by calling @bomb.sh/tab directly, with a manual maybeHandleCompletion argv intercept ahead of gunshi. gunshi ships an official @gunshi/plugin-completion — built on the same @bomb.sh/tab — that derives subcommands and flags straight from each command's args schema.

Changes

  • Upgrade gunshi 0.34.0 → 0.36.0.
  • Drop the direct @bomb.sh/tab dependency; add @gunshi/plugin-completion (pulls @bomb.sh/tab + @gunshi/plugin transitively).
  • Register the plugin via plugins: [completionPlugin()] and remove the manual maybeHandleCompletion intercept in cli.ts.
  • Delete the duplicated FLAGS / JSR_FLAGS tables — flags now come from the real args definitions, so they can't drift. completion.ts shrinks to just the dynamic-value handlers (package names, --provider, --permissions).
  • Declare the packages positional in npmArgs / jsrArgs so the plugin can complete it; commands still read selectors via selectorsOf(ctx). Bonus: it's now documented in --help under ARGUMENTS.

Net: −105 / +60 lines, completion stays in lockstep with command definitions.

Notes

  • @gunshi/plugin-i18n@0.36.0 comes in as a transitive peer of the completion plugin. It's declared optional: true at runtime and we don't reference it — descriptions just aren't localized (same as before).
  • The complete subcommand is now visible in fledgling --help (it's a real gunshi command the plugin registers, not an argv intercept). Harmless / more discoverable.

Verification

  • bun run typecheck + bun run build: clean.
  • Completions checked via fledgling complete -- …: workspace package names, --provider (github/gitlab/circleci), --permissions (publish/stage/both), and jsr packages all resolve. Shell-script generation works for zsh/bash/fish/powershell.
  • Runtime selector parsing unchanged: add <pkg> --dry-run targets correctly; unknown selectors are rejected with the right error.

….34→0.36

Replace the hand-rolled @bomb.sh/tab shell completion with gunshi's official
completion plugin. Subcommands and every flag are now derived automatically from
each command's `args` schema, so the duplicated FLAGS / JSR_FLAGS tables (which
could silently drift from the real command definitions) are gone.

- Bump gunshi 0.34.0 → 0.36.0, drop the direct @bomb.sh/tab dependency, add
  @gunshi/plugin-completion (pulls @bomb.sh/tab + @gunshi/plugin transitively).
- Register the plugin via `plugins: [completionPlugin()]` and remove the manual
  `maybeHandleCompletion` argv intercept in cli.ts.
- completion.ts now only supplies the dynamic-value handlers (workspace package
  names, --provider, --permissions).
- Declare the `packages` positional in npmArgs / jsrArgs so the plugin can
  complete it; commands still read selectors via `selectorsOf(ctx)`. Bonus: it's
  now documented in --help under ARGUMENTS.

Verified: typecheck + build clean; package/--provider/--permissions/jsr
completions and shell-script generation work; runtime selector parsing
unchanged.
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

bumpy-frog

The changes in this PR will be included in the next version bump.

patch Patch releases

  • fledgling 1.1.1 → 1.1.2

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@theoephraim theoephraim force-pushed the feat/gunshi-completion-plugin branch from 7f9e72e to a3c6e5a Compare July 15, 2026 00:35
Mirrors the bumpy repo's pre-push setup, scoped to fledgling's tooling
(no oxlint/oxfmt here). `postinstall: lefthook install` registers the hook
on `bun install`.
@theoephraim theoephraim merged commit 96c4525 into main Jul 15, 2026
1 check 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.

1 participant