Skip to content

feat: add wt config plugins claude install/uninstall - #1830

Merged
max-sixty merged 4 commits into
mainfrom
feat/config-plugins-cli
Mar 31, 2026
Merged

max-sixty merged 4 commits into
mainfrom
feat/config-plugins-cli

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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

max-sixty and others added 2 commits March 30, 2026 20:13
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]>
worktrunk-bot
worktrunk-bot previously approved these changes Mar 31, 2026
@worktrunk-bot
worktrunk-bot dismissed their stale review March 31, 2026 03:29

CI codecov/patch failed — 69.87% patch coverage vs 95.58% target

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

codecov/patch failed — 69.87% patch coverage vs 95.58% target.

The uncovered lines in src/commands/config/plugins.rs fall into two categories:

  1. 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.

  2. Error paths when claude commands fail (lines 39-42, 50-53, 91-94) — the if !output.status.success() branches after each Cmd::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]>
@max-sixty
max-sixty merged commit 0afc50d into main Mar 31, 2026
22 of 23 checks passed
@max-sixty
max-sixty deleted the feat/config-plugins-cli branch March 31, 2026 04:15

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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:

  1. Accept the gap — the prompt code is thin (just calls prompt_yes_no_preview and acts on the result), and the actual logic is fully tested via --yes.
  2. Extract to reduce the gap — move the prompt into the caller in main.rs so handle_claude_install/handle_claude_uninstall only contain the already-tested logic. The prompt setup is specific enough that this might not simplify things much though.

max-sixty added a commit that referenced this pull request Apr 1, 2026
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]>
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.

2 participants