# Maintenance (/docs/cli/maintenance)



Maintenance [#maintenance]

Keep your ox CLI up to date, check version info, and cleanly remove SageOx when needed.

Check your version [#check-your-version]

<Terminal>
  <TerminalCommand>
    ox version
  </TerminalCommand>
</Terminal>

Shows the installed version, build date, and commit hash.

For machine-readable output:

<Terminal>
  <TerminalCommand>
    ox version --json
  </TerminalCommand>
</Terminal>

Upgrade ox [#upgrade-ox]

<Terminal>
  <TerminalCommand>
    ox upgrade
  </TerminalCommand>
</Terminal>

The CLI detects how it was installed and uses the appropriate upgrade method:

| Install method  | Upgrade command                          |
| --------------- | ---------------------------------------- |
| Homebrew        | `brew upgrade ox`                        |
| `go install`    | `go install github.com/sageox/ox@latest` |
| Manual download | Downloads latest binary from GitHub      |

The `--json` flag outputs upgrade status in JSON format for scripting.

View release notes [#view-release-notes]

<Terminal>
  <TerminalCommand>
    ox release-notes
  </TerminalCommand>
</Terminal>

Displays release notes for the currently installed version.

| Flag       | Description                                 |
| ---------- | ------------------------------------------- |
| `--latest` | Show notes for the latest available version |
| `--raw`    | Output raw markdown without formatting      |

Uninstall ox from a repository [#uninstall-ox-from-a-repository]

<Terminal>
  <TerminalCommand>
    ox uninstall
  </TerminalCommand>
</Terminal>

Removes SageOx from the current repository. The command prompts for confirmation before making changes.

What gets removed [#what-gets-removed]

| Artifact                      | Description                                                   |
| ----------------------------- | ------------------------------------------------------------- |
| `.sageox/`                    | Configuration, cache, and daemon files                        |
| Git hooks                     | SageOx-installed `prepare-commit-msg` and `post-commit` hooks |
| `.claude/settings.local.json` | Agent integration settings (SageOx keys only)                 |
| `CLAUDE.md` / `AGENTS.md`     | Removes `ox agent prime` references                           |

<Callout type="info">
  Non-SageOx git hooks and user configurations are preserved. The CLI identifies SageOx-specific content and removes only that.
</Callout>

Flags [#flags]

| Flag                  | Description                                                |
| --------------------- | ---------------------------------------------------------- |
| `--dry-run`           | Show what would be removed without making changes          |
| `--force`             | Skip confirmation prompt                                   |
| `--local-only`        | Remove local artifacts only (skip server deregistration)   |
| `--user-integrations` | Also remove user-level integration hooks                   |
| `--all`               | Remove from all repositories in the current directory tree |

Preview changes first [#preview-changes-first]

<Terminal>
  <TerminalCommand>
    ox uninstall --dry-run
  </TerminalCommand>
</Terminal>

This shows exactly what will be removed without making any changes.

Clean reinstall [#clean-reinstall]

To start fresh with a clean SageOx setup:

<Terminal>
  <TerminalComment>
    Remove existing installation
  </TerminalComment>

  <TerminalCommand>
    ox uninstall --force
  </TerminalCommand>

  <TerminalComment>
    Re-initialize
  </TerminalComment>

  <TerminalCommand>
    ox init
  </TerminalCommand>

  <TerminalComment>
    Verify setup
  </TerminalComment>

  <TerminalCommand>
    ox doctor
  </TerminalCommand>
</Terminal>

Uninstall the CLI binary [#uninstall-the-cli-binary]

`ox uninstall` removes SageOx from repositories. To remove the ox CLI itself:

| Install method | Removal command                  |
| -------------- | -------------------------------- |
| Homebrew       | `brew uninstall ox`              |
| `go install`   | `rm $(go env GOPATH)/bin/ox`     |
| Manual         | Delete the binary from your PATH |

Global credentials are stored in `~/.config/sageox/`. Remove this directory to clear all authentication data.

What's next [#whats-next]

* [ox doctor](/docs/cli/doctor) - Diagnose setup issues after reinstalling
* [ox init](/docs/cli/init) - Re-initialize a repository
* [ox login](/docs/cli/auth) - Re-authenticate if needed
