Skip to content

Conversation

@edlsh
Copy link
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 anomalyco#3900
@rekram1-node
Copy link
Collaborator

/review

@rekram1-node
Copy link
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
Contributor Author

edlsh commented Dec 7, 2025

All 3 were valid feedback that have been addressed

@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
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
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