> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ubiquex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ubx update

> Check for a newer version and update the ubx binary in place.

`ubx update` checks the latest release on GitHub and updates the `ubx` binary in place. The update is atomic — it writes to a temp file in the same directory, then renames.

## Usage

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/xcl.json"]}}
ubx update [flags]
```

## Flags

| Flag      | Description                                                              |
| --------- | ------------------------------------------------------------------------ |
| `--check` | Exit 1 if an update is available; exit 0 if already up to date (CI mode) |
| `--force` | Update even if already on the latest version                             |

## Examples

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/xcl.json"]}}
ubx update                 # check and install if newer version available
ubx update --check         # CI mode: exit 1 if newer available
ubx update --force         # reinstall even if already up to date
```

## Supported platforms

| Platform | Architecture     |
| -------- | ---------------- |
| macOS    | `amd64`, `arm64` |
| Linux    | `amd64`, `arm64` |
| Windows  | `amd64` (`.exe`) |

For unsupported platforms, ubx prints the GitHub releases URL for manual download.

## How the update works

1. Fetches the latest release tag from `https://api.github.com/repos/ubiquex/ubx/releases/latest`
2. Compares semantic versions (ignoring pre-release suffixes)
3. Downloads the platform-specific binary asset
4. Writes it to a temp file adjacent to the current binary
5. Sets execute permission (`0755`)
6. Atomically renames (replaces) the current binary

## After updating

```
  ✓  updated to v0.x.y — restart ubx to use the new version
```

The shell must restart (or re-exec) to pick up the new binary if the path was cached.

## CI mode

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/xcl.json"]}}
ubx update --check && echo "up to date" || echo "update available"
```

Exit codes:

| Code | Meaning                                       |
| ---- | --------------------------------------------- |
| `0`  | Already on the latest version                 |
| `1`  | A newer version is available (with `--check`) |

## See also

* [`ubx upgrade`](/v1/cli/upgrade) — also upgrades provider schemas
* [`ubx version`](/v1/cli/version) — show current version
