feat(mcp): add PowerShell shell completion#1448
Conversation
Extend `gittensory-mcp completion` to support PowerShell alongside bash,
zsh, and fish. `completion powershell` prints a `Register-ArgumentCompleter`
script that completes top-level commands and the subcommands of `profile`,
`cache`, `agent`, and `maintain`, driven by the same `CLI_COMMAND_SPEC`
single source of truth. `--json` returns `{ shell, script }` as for the
other shells.
PowerShell is a primary shell on Windows and was previously rejected as an
unsupported shell; this closes that gap.
Tests cover the generated PowerShell script (Register-ArgumentCompleter,
CompletionResult, command/subcommand lists) and update the unsupported-shell
case to a still-unsupported shell.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1448 +/- ##
=======================================
Coverage ? 95.52%
=======================================
Files ? 204
Lines ? 22279
Branches ? 8048
=======================================
Hits ? 21283
Misses ? 415
Partials ? 581 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review — held for maintainer review
⏸️ Held for maintainer review — This is a first-time contribution to this repo, so the gate stays advisory rather than blocking. The findings remain visible, and the gate will apply normally once this author has merge history here. Review summary Blockers
Concerns raised — review before merging
Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. The change adds PowerShell to the existing completion shell list, generates a native `Register-ArgumentCompleter` script, updates help text, and documents the install snippet. The generator is mostly wired through the same `CLI_COMMAND_SPEC` source as the other shells, but the PowerShell AST branch chooses top-level completions when the user has already typed a command followed by a space. That makes the advertised subcommand completion fail on the common empty-prefix path. Blockers
Nits (4)
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…s were stuck OPEN) (JSONbored#1076) With requireApprovals=0, a green+approved PR should auto-merge — but the planner read the STORED mergeableState, which lags GitHub's async recompute after gittensory[bot]'s own APPROVE flips blocked→clean. Result: PRs stuck OPEN at mergeState=CLEAN, never merged (e.g. awesome-claude#4206, metagraphed#1438/JSONbored#1448). Fix: maybeRunAgentMaintenance fetches the LIVE mergeable_state (fetchLivePullRequestMergeState, GET /pulls/{n}) and the planner uses it (falls back to stored on a fetch error); 'unknown' is treated as not-yet-clean so a later trigger/sweep retries.
Summary
Extends
gittensory-mcp completionto support PowerShell alongside bash, zsh, and fish. PowerShell is a primary shell on Windows and was previously rejected as an unsupported shell — this closes that gap.completion powershellprints aRegister-ArgumentCompleter -Nativescript that completes the top-level commands and the subcommands ofprofile,cache,agent, andmaintain, driven by the sameCLI_COMMAND_SPECsingle source of truth as the other shells.--jsonreturns{ "shell": "powershell", "script": "..." }.Changes
packages/gittensory-mcp/bin/gittensory-mcp.js— add"powershell"toCOMPLETION_SHELLS, abuildPowershellCompletion()generator, dispatch inbuildCompletionScript(), and the help-text usage line.test/unit/mcp-cli-basics.test.ts— add a PowerShell completion test (assertsRegister-ArgumentCompleter,CompletionResult, command + subcommand lists); update the unsupported-shell case to a still-unsupported shell (tcsh) and the usage regex.packages/gittensory-mcp/README.md— document PowerShell with an install snippet.Validation
Run locally on Node v22.22.0 (the project's engine):
npm run build:mcp→ passtest/unit/mcp-cli-basics.test.ts→ all 19 tests pass, including the newprints a PowerShell argument-completer scriptcase.[System.Management.Automation.Language.Parser]::ParseInput(0 syntax errors) and confirmedRegister-ArgumentCompleterexecutes without error in a real PowerShell session.completion tcshstill errors as unsupported.Honest caveat (unrelated to this change): a full
tsc --noEmitcan't complete on my local box becausenode_modulesis missing some newly-added deps (pg,ioredis,pngjs, etc.) used by unrelatedsrc/selfhost/*/src/visual-agent/*files. There are zero type errors in the files this PR touches. CI runs a clean install and gives the authoritative result.Contract notes
No MCP tool or HTTP/OpenAPI changes. Local CLI behavior only; the
--jsonpayload shape is unchanged (additive newshellvalue).Security / privacy
No auth, cookie, CORS, GitHub App output, identity, or contributor-evidence changes. The generated script contains only static command/subcommand names already shown in
--help.Closes #1452