Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds PowerShell completion support to the usage CLI, enabling completion generation and script execution for PowerShell environments.
Changes:
- Add PowerShell as a supported shell for completion generation alongside bash, fish, and zsh
- Implement
usage powershell <script>command usingpwshinterpreter - Add PowerShell integration test requiring
pwshinstallation
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/complete/powershell.rs | PowerShell completion script generator implementation |
| lib/src/complete/mod.rs | Wire PowerShell module into completion system |
| cli/src/cli/mod.rs | Add Powershell command variant |
| cli/src/cli/complete_word.rs | Add powershell to shell option choices |
| cli/src/cli/generate/completion.rs | Add powershell to shell choices for completion generation |
| cli/tests/shell_completions_integration.rs | PowerShell integration test |
| docs/cli/reference/powershell.md | PowerShell command documentation |
| docs/cli/reference/index.md | Update command index with PowerShell entry |
| docs/cli/reference/generate/completion.md | Update completion docs to include PowerShell |
| docs/cli/reference/complete-word.md | Update complete-word docs with PowerShell option |
| docs/cli/reference/commands.json | Update command metadata with PowerShell entries |
| cli/usage.usage.kdl | Update usage spec with PowerShell command |
| cli/assets/usage.1 | Update manpage with PowerShell documentation |
| cli/assets/fig.ts | Update Fig completion spec with PowerShell |
| lib/src/complete/snapshots/* | Snapshot test files for PowerShell completion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #431 +/- ##
==========================================
+ Coverage 46.63% 47.42% +0.78%
==========================================
Files 46 47 +1
Lines 6546 6651 +105
Branches 6546 6651 +105
==========================================
+ Hits 3053 3154 +101
- Misses 1732 1737 +5
+ Partials 1761 1760 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
93e3d6a to
7153284
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
7153284 to
d7b4583
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Add PowerShell as a supported shell for completion generation and script execution, alongside bash, fish, and zsh. Changes: - Add lib/src/complete/powershell.rs with completion script generator - Add `usage powershell <script>` command (uses pwsh interpreter) - Add powershell to `usage generate completion` shell choices - Add powershell to `usage complete-word --shell` options - Add integration test (requires pwsh - no skip for CI) - Update documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d7b4583 to
77c06f3
Compare
# Conflicts: # lib/src/complete/mod.rs
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [usage](https://github.com/jdx/usage) | minor | `2.12.0` → `2.13.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jdx/usage (usage)</summary> ### [`v2.13.1`](https://github.com/jdx/usage/blob/HEAD/CHANGELOG.md#2131---2026-01-19) [Compare Source](jdx/usage@v2.13.0...v2.13.1) ##### 🐛 Bug Fixes - use correct PowerShell casing in enum variant by [@​jdx](https://github.com/jdx) in [#​438](jdx/usage#438) ### [`v2.13.0`](https://github.com/jdx/usage/blob/HEAD/CHANGELOG.md#2130---2026-01-19) [Compare Source](jdx/usage@v2.12.0...v2.13.0) ##### 🚀 Features - **(release)** add LLM-generated prose summary to release notes by [@​jdx](https://github.com/jdx) in [#​421](jdx/usage#421) - add LLM-generated release notes for GitHub releases by [@​jdx](https://github.com/jdx) in [#​423](jdx/usage#423) - add spec lint command by [@​jdx](https://github.com/jdx) in [#​430](jdx/usage#430) - add PowerShell completion support by [@​jdx](https://github.com/jdx) in [#​431](jdx/usage#431) ##### 🐛 Bug Fixes - replace unsafe path unwrap chains with proper error handling by [@​jdx](https://github.com/jdx) in [#​424](jdx/usage#424) - pass positional args through to executed scripts by [@​jdx](https://github.com/jdx) in [#​425](jdx/usage#425) - replace unimplemented!() with proper errors for unsupported shells by [@​jdx](https://github.com/jdx) in [#​432](jdx/usage#432) - update claude CLI model and add bypassPermissions by [@​jdx](https://github.com/jdx) in [#​435](jdx/usage#435) ##### 🚜 Refactor - remove unused double-shebang support by [@​jdx](https://github.com/jdx) in [#​426](jdx/usage#426) - replace once\_cell with std::sync::LazyLock by [@​jdx](https://github.com/jdx) in [#​428](jdx/usage#428) - improve code quality with safety and lint fixes by [@​jdx](https://github.com/jdx) in [#​427](jdx/usage#427) ##### ⚡ Performance - use Arc for flag/arg keys in ParseOutput to reduce cloning by [@​jdx](https://github.com/jdx) in [#​422](jdx/usage#422) ##### 🔍 Other Changes - update insta snapshots to newer format by [@​jdx](https://github.com/jdx) in [#​429](jdx/usage#429) - fix legacy inline snapshot format warnings by [@​jdx](https://github.com/jdx) in [#​433](jdx/usage#433) - replace TODO with doc comment for subcommand\_lookup by [@​jdx](https://github.com/jdx) in [#​434](jdx/usage#434) ##### 📦️ Dependency Updates - update actions/setup-node digest to [`6044e13`](jdx/usage@6044e13) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​419](jdx/usage#419) - replace dependency [@​tsconfig/node22](https://github.com/tsconfig/node22) with [@​tsconfig/node24](https://github.com/tsconfig/node24) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​418](jdx/usage#418) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44NC4yIiwidXBkYXRlZEluVmVyIjoiNDIuODQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
Summary
usage powershell <script>command (usespwshinterpreter)powershelltousage generate completionshell choicespowershelltousage complete-word --shelloptionspwshto be installed (no skip for CI)Fixes #314
Changes
New files:
lib/src/complete/powershell.rs- PowerShell completion script generatordocs/cli/reference/powershell.md- DocumentationModified files:
lib/src/complete/mod.rs- Wire in powershell modulecli/src/cli/mod.rs- Add Powershell command variantcli/src/cli/complete_word.rs- Add powershell shell optioncli/src/cli/generate/completion.rs- Add powershell to shell choicescli/tests/shell_completions_integration.rs- Add PowerShell integration testTest plan
cargo test -p usage-lib test_complete_powershell)cargo test -p usage-cli test_powershell_completion_integration)cargo run -- generate completion powershell mycli --usage-cmd "echo test"🤖 Generated with Claude Code
Note
Adds first-class PowerShell support across completion and execution.
lib/src/complete/powershell.rsgenerator wired intocomplete(); outputs PSRegister-ArgumentCompleterscriptusage generate completionandcomplete-word --shellacceptpowershell; newusage powershellsubcommand (executes viapwsh)usage.1, KDL spec, reference pages) to include PowerShell options and commandWritten by Cursor Bugbot for commit 2587c6d. This will update automatically on new commits. Configure here.