Skip to content

feat: add ty plugins remove to uninstall a plugin#678

Merged
bborn merged 1 commit into
mainfrom
feat/plugins-remove
Jul 21, 2026
Merged

feat: add ty plugins remove to uninstall a plugin#678
bborn merged 1 commit into
mainfrom
feat/plugins-remove

Conversation

@bborn

@bborn bborn commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What

Adds ty plugins remove <name> (aliases rm, uninstall) — the missing inverse of ty plugins add. Until now ty plugins could install and inspect plugins but the only way to uninstall one was to hand-delete a directory.

Behavior

$ ty plugins remove plan-code-review
Removed plugin "plan-code-review" (/Users/.../task/plugins/plugins/plan-code-review).
Note: it was part of a shared git checkout; its sibling plugins remain, and re-adding that source may restore it.
  • Name matching: matches the manifest name shown by ty plugins list, falling back to the directory base name, so it works even when the two differ.
  • Path safety: verifies the target lives strictly inside the plugins dir before deleting, so a corrupt/hostile manifest can't redirect the delete elsewhere.
  • Collection-repo aware: a plugin nested inside a multi-plugin git checkout (e.g. the taskyou/plugins collection) has only its own subdirectory removed; the shared checkout and sibling plugins stay, and the user is warned that re-running add on the source may restore it.

Tests

cmd/task/plugins_remove_test.go covers:

  • single-plugin repo removal (whole checkout gone, no longer discoverable)
  • collection removal leaves siblings + reports inCheckout
  • matching by directory name when it differs from the manifest name
  • unknown-plugin errors instead of deleting anything

docs/plugins.md gets a Removing section.

🤖 Generated with Claude Code

`ty plugins` could install (`add`) and inspect plugins but not remove one —
uninstalling meant hand-deleting a directory. Add `remove` (aliases `rm`,
`uninstall`) as the inverse of `add`.

- Matches by the manifest name shown in `plugins list`, falling back to the
  directory base name, so it works when the two differ.
- Guards against deleting anything outside the plugins dir (a corrupt manifest
  can't redirect the delete).
- Collection-repo aware: a plugin nested in a multi-plugin git checkout has only
  its own subdir removed, and the caller is told the shared checkout/siblings
  remain and a later `add` may restore it.

Tests cover single-repo removal, collection removal leaving siblings,
dir-name matching, and the unknown-plugin error. Docs updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bborn
bborn merged commit ec0b367 into main Jul 21, 2026
4 checks 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