Repository navigation
feat: add wt config plugins claude install/uninstall - #1830
Conversation
Add a `wt config plugins` subcommand group for managing AI tool plugins, starting with Claude Code. `install` runs `claude plugin marketplace add` + `claude plugin install`; `uninstall` runs the reverse. Handles already-installed and CLI-not-found cases gracefully. Also updates `wt config show` to suggest `wt config plugins claude install` instead of showing raw claude CLI commands. Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
CI codecov/patch failed — 69.87% patch coverage vs 95.58% target
worktrunk-bot
left a comment
There was a problem hiding this comment.
codecov/patch failed — 69.87% patch coverage vs 95.58% target.
The uncovered lines in src/commands/config/plugins.rs fall into two categories:
-
Interactive prompt branches (lines 20-31, 69-83) — the
if !yes { ... }paths that show confirmation prompts. All tests pass--yes, so these are never exercised. -
Error paths when
claudecommands fail (lines 39-42, 50-53, 91-94) — theif !output.status.success()branches after eachCmd::new("claude")call.
The prompt paths are difficult to cover without shell integration tests, but the error paths can be covered by adding mock claude binaries that return non-zero exit codes. For example, a setup_mock_claude_failing() helper that makes plugin marketplace add fail, paired with a test asserting the error message.
Add tests for when `claude plugin marketplace add` and `claude plugin uninstall` exit non-zero. Also trim stderr in error messages to avoid multiline error panics. Co-Authored-By: Claude <[email protected]>
Add test where marketplace add succeeds but plugin install fails, covering lines 44-52 in plugins.rs. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
left a comment
There was a problem hiding this comment.
codecov/patch failed — 77.10% patch coverage vs 95.58% target.
The uncovered lines in src/commands/config/plugins.rs are all interactive prompt branches (lines 20-31, 69-83) — the if !yes { ... } paths that show confirmation prompts. All tests pass --yes, so these are never exercised. The error paths and success paths are fully covered by the new tests.
These prompt branches can't be covered without PTY-based shell integration tests. Two options:
- Accept the gap — the prompt code is thin (just calls
prompt_yes_no_previewand acts on the result), and the actual logic is fully tested via--yes. - Extract to reduce the gap — move the prompt into the caller in
main.rssohandle_claude_install/handle_claude_uninstallonly contain the already-tested logic. The prompt setup is specific enough that this might not simplify things much though.
Adds a `wt config plugins` subcommand group for managing AI tool plugins, starting with Claude Code: - `wt config plugins claude install [--yes]` — runs `claude plugin marketplace add` + `claude plugin install` - `wt config plugins claude uninstall [--yes]` — runs `claude plugin uninstall` - Handles already-installed, not-installed, and CLI-not-found cases gracefully - Updates `wt config show` hint to suggest `wt config plugins claude install` instead of raw claude CLI commands - The `plugins` namespace is extensible for future tool integrations > _This was written by Claude Code on behalf of @max-sixty_ --------- Co-authored-by: Claude <[email protected]>
Adds a
wt config pluginssubcommand group for managing AI tool plugins, starting with Claude Code:wt config plugins claude install [--yes]— runsclaude plugin marketplace add+claude plugin installwt config plugins claude uninstall [--yes]— runsclaude plugin uninstallwt config showhint to suggestwt config plugins claude installinstead of raw claude CLI commandspluginsnamespace is extensible for future tool integrations