feat: add uninstall.sh — per-copy uninstaller with confirmation, dry-run, and OneCLI agent cleanup - #2719
Merged
Conversation
…run, and OneCLI agent cleanup Removes only what belongs to this checkout (slug-scoped): background service, containers + image, data/, logs/, groups/, ncl symlink, and this copy's OneCLI vault agents. Shared tools (OneCLI app, credentials, other copies) are left alone. Interactive per-group confirmation with --dry-run and --yes modes; .env is backed up before removal. Documented in README FAQ and the CLAUDE.md key-files table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…isting installs in setup Replaces the standalone bash uninstall.sh with a TypeScript flow inside the setup driver (setup/uninstall/): scan (slug-scoped inventory), plan (pure ordered removal actions), remove (per-action executor that absorbs failures into notes), and flow (clack UI). uninstall.sh is now a 3-line pointer that execs nanoclaw.sh --uninstall. - nanoclaw.sh --uninstall short-circuits before diagnostics/bootstrap; with no node_modules it prints manual cleanup commands and exits 1 - setup:auto routes --uninstall before initProgressionLog so an uninstall never resets logs/setup.log - fresh setup runs detect an existing install (service registration or data/v2.db) and offer keep-and-continue (default) or uninstall-and-exit; suppressed on fail()-retry and sg re-exec resumes - self-deletion safety: static imports only, dist/ + node_modules/ removed dead last, nothing but console.log after the runtime tail - --yes never deletes orphan ag-* vault agents; their manual delete commands (by vault uuid) are printed instead Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- .env backup and removal are now one atomic action: a failed backup throws into executePlan's catch and the deletion never runs (the bash original's set -e gave the same guarantee; the port had lost it) - containers are re-listed by install label at removal time instead of removed from scan-time ids — the live host can spawn containers during the confirm phase - uninstall telemetry no longer creates data/install-id (persistId:false on emit), so --dry-run truly changes nothing and the already-clean exit can fire - runtime-tail failure notes are printed before the Done line instead of being discarded - uninstall.sh translates the old short flags (-n/-y) instead of silently dropping them (-n used to fall through to a real interactive uninstall) - nanoclaw.sh gates the TS uninstaller on node (tsx's interpreter), not pnpm, which the direct-exec path never uses - detectExistingInstall also checks the system-level systemd unit - a delete-onecli-agent spawn failure now notes the manual command instead of claiming the agent was already gone - setupLog.userInput is skipped when logs/ is absent so the uninstall doesn't recreate it Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
amit-shafnir
force-pushed
the
feat/uninstall-script
branch
from
June 10, 2026 12:50
0bd00e5 to
d8748e3
Compare
Collaborator
|
'NEEDS CHANGES One cross-platform bug to fix before this can land:
Notes for maintainers (not blocking):
Architecture, safety, and test coverage are all solid. |
This was referenced Jun 11, 2026
teknium1
added a commit
to NousResearch/hermes-agent
that referenced
this pull request
Jul 7, 2026
Port from nanocoai/nanoclaw#2719: let operators preview the uninstall plan without stopping services or deleting files.
technicalpickles
pushed a commit
to technicalpickles/nanoclaw
that referenced
this pull request
Jul 12, 2026
feat: add uninstall.sh — per-copy uninstaller with confirmation, dry-run, and OneCLI agent cleanup
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
Port from nanocoai/nanoclaw#2719: let operators preview the uninstall plan without stopping services or deleting files.
justemu
pushed a commit
to justemu/hermes-agent
that referenced
this pull request
Jul 18, 2026
Port from nanocoai/nanoclaw#2719: let operators preview the uninstall plan without stopping services or deleting files.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
Port from nanocoai/nanoclaw#2719: let operators preview the uninstall plan without stopping services or deleting files.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
Port from nanocoai/nanoclaw#2719: let operators preview the uninstall plan without stopping services or deleting files.
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
Port from nanocoai/nanoclaw#2719: let operators preview the uninstall plan without stopping services or deleting files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
.claude/skills/<name>/, no source changes)None of the boxes fit exactly: this is a root-level lifecycle script alongside
nanoclaw.shandmigrate-v2.sh— not a skill, fix, or simplification. Happy to rework as a skill if you'd prefer.Description
What:
uninstall.sh— interactive uninstaller that removes one NanoClaw copy from a machine, plus a README FAQ entry and CLAUDE.md key-files row.Why: Install and migration have first-class scripts; removal currently requires manually hunting down the slug-named service, image, containers, and OneCLI vault agents.
How it works: Sources
setup/lib/install-slug.shto derive this copy's service label, image name, and container label. Scans four groups (service/containers, data+logs+secrets, agent files, OneCLI agents), shows what exists, and confirms each group before deleting. OneCLI vault agents are matched againstagent_groupsindata/v2.db(viascripts/q.ts); unmatchedag-*agents are treated as belonging to another copy and never auto-deleted.--dry-runpreviews,--yesskips prompts,.envis backed up before removal. Shared state (OneCLI app/vault,~/.config/nanoclaw/, other copies) is left alone.How it was tested: Ran on a live install: dry-run, interactive, and
--yespaths; verified service unload, container/image removal, OneCLI agent deletion by UUID, and that a second copy's artifacts were untouched.🤖 Generated with Claude Code