Overview
Theocx self commands manage the OCX installation itself, including updating to new versions and uninstalling.
Self Update
Update OCX to the latest version.Usage
Flags
Examples
How It Works
OCX automatically detects how it was installed and uses the appropriate update method:- curl-installed binaries: Downloads from GitHub releases with SHA256 verification.
- npm/pnpm/bun installs: Uses the respective package manager’s global install command.
Self Uninstall
Remove OCX global configuration files and binary.Usage
Flags
What Gets Removed
~/.config/opencode/profiles/— All profiles~/.config/opencode/ocx.jsonc— Global OCX config~/.config/opencode/— Root directory (only if empty after cleanup)- Binary executable (for curl installs only; package-managed installs print the removal command)
Exit Codes
Examples
Notes
- Package-managed installs: If installed via npm/pnpm/bun/yarn, the command removes config files but prints the package manager removal command instead of deleting the binary directly.
- Safety: Only removes known OCX files (allowlist approach). Unexpected files in the config directory are left untouched.
- Symlinks: Symlinks are unlinked without following. Symlink targets are preserved.
- Idempotent: Safe to run multiple times. Returns success if already uninstalled.
See Also
- Installation — How to install OCX.
- CLI Reference — All commands.