[PR #241] [MERGED] feat: add uninstall command for skills #296

Closed
opened 2026-02-15 17:16:43 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/241
Author: @superlowburn
Created: 2/12/2026
Status: Merged
Merged: 2/15/2026
Merged by: @steipete

Base: mainHead: feat/uninstall-command


📝 Commits (6)

  • 0e8b002 feat: add uninstall command for skills
  • 0cac5dd fix: require --yes in non-interactive mode and update lockfile before rm
  • e122cd1 Merge remote-tracking branch 'origin/main' into temp/landpr-241-noforce
  • 0d0cfda fix: harden skill uninstall flow (#241) (thanks @superlowburn)
  • f9d42ca docs: document uninstall CLI command (#241) (thanks @superlowburn)
  • d9178a3 test: fix cmdUninstall mock typing (#241) (thanks @superlowburn)

📊 Changes

7 files changed (+241 additions, -9 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 README.md (+12 -0)
📝 docs/cli.md (+6 -0)
📝 docs/quickstart.md (+1 -0)
📝 packages/clawdhub/src/cli.ts (+18 -1)
📝 packages/clawdhub/src/cli/commands/skills.test.ts (+145 -3)
📝 packages/clawdhub/src/cli/commands/skills.ts (+57 -5)

📄 Description

Summary

  • Implements clawhub uninstall <slug> to properly remove installed skills
  • Validates skill is installed before removal, removes skill directory and lockfile entry
  • Supports --yes flag to skip confirmation prompt
  • Comprehensive test coverage (4 tests)

Closes #221

Test plan

  • Unit tests pass for all cases (not installed, single skill, multiple skills, whitespace trimming)
  • Manual test: clawhub install <skill> then clawhub uninstall <skill> round-trip
  • Manual test: clawhub uninstall missing-skill shows proper error

🤖 Generated with Claude Code

Greptile Overview

Greptile Summary

This PR adds a new clawhub uninstall <slug> CLI command, wires it into the top-level command registry, and adds unit tests.

Implementation reads the local lockfile to ensure the skill is installed, optionally prompts for confirmation, removes the skill directory under opts.dir, deletes the corresponding lockfile entry, and writes the updated lockfile back to disk. Tests cover the not-installed case, single-skill removal, multi-skill removal, and trimming whitespace.

Two correctness issues remain: uninstall can proceed without --yes in non-interactive/no-input environments, and the current order of operations can leave the lockfile and filesystem out of sync if writing the lockfile fails after deletion.

Confidence Score: 3/5

  • This PR is mergeable after addressing a couple of uninstall safety/correctness edge cases.
  • Core functionality and tests look solid, but uninstall currently bypasses confirmation in non-interactive/no-input contexts unless --yes is provided, and deletion-before-lockfile-write can leave an inconsistent installed state on partial IO failure.
  • packages/clawdhub/src/cli/commands/skills.ts

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/241 **Author:** [@superlowburn](https://github.com/superlowburn) **Created:** 2/12/2026 **Status:** ✅ Merged **Merged:** 2/15/2026 **Merged by:** [@steipete](https://github.com/steipete) **Base:** `main` ← **Head:** `feat/uninstall-command` --- ### 📝 Commits (6) - [`0e8b002`](https://github.com/openclaw/clawhub/commit/0e8b002a0a3b303b5408b8937657a5bfefd0b1df) feat: add uninstall command for skills - [`0cac5dd`](https://github.com/openclaw/clawhub/commit/0cac5dd5967d782ebe7b582bbaca742236329839) fix: require --yes in non-interactive mode and update lockfile before rm - [`e122cd1`](https://github.com/openclaw/clawhub/commit/e122cd12ecd639c21c69c43c12f2751ee838c532) Merge remote-tracking branch 'origin/main' into temp/landpr-241-noforce - [`0d0cfda`](https://github.com/openclaw/clawhub/commit/0d0cfdab7a81283529cc2b51fccc81d8e6a7e945) fix: harden skill uninstall flow (#241) (thanks @superlowburn) - [`f9d42ca`](https://github.com/openclaw/clawhub/commit/f9d42ca92e952aec46ddd50dd08567cf966434a8) docs: document uninstall CLI command (#241) (thanks @superlowburn) - [`d9178a3`](https://github.com/openclaw/clawhub/commit/d9178a3a7efc9a4466ce7fe23d89603b3e92f1fe) test: fix cmdUninstall mock typing (#241) (thanks @superlowburn) ### 📊 Changes **7 files changed** (+241 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `README.md` (+12 -0) 📝 `docs/cli.md` (+6 -0) 📝 `docs/quickstart.md` (+1 -0) 📝 `packages/clawdhub/src/cli.ts` (+18 -1) 📝 `packages/clawdhub/src/cli/commands/skills.test.ts` (+145 -3) 📝 `packages/clawdhub/src/cli/commands/skills.ts` (+57 -5) </details> ### 📄 Description ## Summary - Implements `clawhub uninstall <slug>` to properly remove installed skills - Validates skill is installed before removal, removes skill directory and lockfile entry - Supports `--yes` flag to skip confirmation prompt - Comprehensive test coverage (4 tests) Closes #221 ## Test plan - [x] Unit tests pass for all cases (not installed, single skill, multiple skills, whitespace trimming) - [ ] Manual test: `clawhub install <skill>` then `clawhub uninstall <skill>` round-trip - [ ] Manual test: `clawhub uninstall missing-skill` shows proper error 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new `clawhub uninstall <slug>` CLI command, wires it into the top-level command registry, and adds unit tests. Implementation reads the local lockfile to ensure the skill is installed, optionally prompts for confirmation, removes the skill directory under `opts.dir`, deletes the corresponding lockfile entry, and writes the updated lockfile back to disk. Tests cover the not-installed case, single-skill removal, multi-skill removal, and trimming whitespace. Two correctness issues remain: uninstall can proceed without `--yes` in non-interactive/no-input environments, and the current order of operations can leave the lockfile and filesystem out of sync if writing the lockfile fails after deletion. <h3>Confidence Score: 3/5</h3> - This PR is mergeable after addressing a couple of uninstall safety/correctness edge cases. - Core functionality and tests look solid, but uninstall currently bypasses confirmation in non-interactive/no-input contexts unless `--yes` is provided, and deletion-before-lockfile-write can leave an inconsistent installed state on partial IO failure. - packages/clawdhub/src/cli/commands/skills.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:43 -05:00
yindo closed this issue 2026-02-15 17:16:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#296