Skip to content

feat: add uninstall command#5208

Merged
rekram1-node merged 3 commits into
anomalyco:devfrom
edlsh:feat/uninstall-command
Dec 7, 2025
Merged

feat: add uninstall command#5208
rekram1-node merged 3 commits into
anomalyco:devfrom
edlsh:feat/uninstall-command

Conversation

@edlsh
Copy link
Copy Markdown
Contributor

@edlsh edlsh commented Dec 7, 2025

Summary

Adds opencode uninstall command that cleanly removes all OpenCode-related files.

Closes #3900

Changes

  • New file: packages/opencode/src/cli/cmd/uninstall.ts
  • Modified: packages/opencode/src/index.ts (import + register command)

Features

  • Auto-detects installation method (curl, npm, pnpm, bun, yarn, brew)
  • Removes XDG directories: data, cache, config, state
  • Cleans shell PATH for curl installs (bash, zsh, fish)
  • Safety options:
    • --dry-run: Preview what would be removed
    • --keep-config: Preserve configuration files
    • --keep-data: Preserve session data and snapshots
    • --force: Skip confirmation prompt

Testing

bun dev uninstall --help
bun dev uninstall --dry-run
bun dev uninstall --dry-run --keep-config

Adds `opencode uninstall` command that cleanly removes all OpenCode files.

- Detects installation method (curl/npm/pnpm/bun/brew)
- Removes XDG directories (data, cache, config, state)
- Cleans shell PATH entries for curl installs
- Supports --dry-run, --keep-config, --keep-data, --force flags

Closes #3900
@rekram1-node
Copy link
Copy Markdown
Collaborator

/review

Comment thread packages/opencode/src/cli/cmd/uninstall.ts
Comment thread packages/opencode/src/cli/cmd/uninstall.ts
Comment thread packages/opencode/src/cli/cmd/uninstall.ts Outdated
@rekram1-node
Copy link
Copy Markdown
Collaborator

Anything you address feel free to resolve the comments, also note this is a bot so if it is being stupid just comment that it's feedback makes no sense

@edlsh
Copy link
Copy Markdown
Contributor Author

edlsh commented Dec 7, 2025

All 3 were valid feedback that have been addressed

@rekram1-node
Copy link
Copy Markdown
Collaborator

/review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 7, 2025

lgtm

@rekram1-node rekram1-node merged commit ec27759 into anomalyco:dev Dec 7, 2025
3 of 4 checks passed
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
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.

feature: uninstall command

2 participants