> ## Documentation Index
> Fetch the complete documentation index at: https://agdiai-597e782f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Updating

# Updating

Keep Agdi up to date.

## Recommended: `agdi update`

The fastest way to update. It detects your install type (npm or git), fetches the latest version, runs `agdi doctor`, and restarts the gateway.

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi update
```

To switch channels or target a specific version:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi update --channel beta
agdi update --tag main
agdi update --dry-run   # preview without applying
```

See [Development channels](https://agdiai-597e782f.mintlify.site/install/development-channels.md) for channel semantics.

## Alternative: re-run the installer

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
curl -fsSL https://agdi.ai/install.sh | bash
```

Add `--no-onboard` to skip onboarding. For source installs, pass `--install-method git --no-onboard`.

## Alternative: manual npm or pnpm

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
npm i -g agdi@latest
```

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pnpm add -g agdi@latest
```

## Auto-updater

The auto-updater is off by default. Enable it in `~/.agdi/agdi.json`:

```json5 theme={"theme":{"light":"min-light","dark":"min-dark"}}
{
  update: {
    channel: "stable",
    auto: {
      enabled: true,
      stableDelayHours: 6,
      stableJitterHours: 12,
      betaCheckIntervalHours: 1,
    },
  },
}
```

| Channel | Behavior |
| - | - |
| `stable` | Waits `stableDelayHours`, then applies with deterministic jitter across `stableJitterHours` (spread rollout). |
| `beta` | Checks every `betaCheckIntervalHours` (default: hourly) and applies immediately. |
| `dev` | No automatic apply. Use `agdi update` manually. |

The gateway also logs an update hint on startup (disable with `update.checkOnStart: false`).

## After updating

### Run doctor

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi doctor
```

Migrates config, audits DM policies, and checks gateway health. Details: [Doctor](https://agdiai-597e782f.mintlify.site/gateway/doctor.md)

### Restart the gateway

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi gateway restart
```

### Verify

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi health
```

## Rollback

### Pin a version (npm)

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
npm i -g agdi@<version>
agdi doctor
agdi gateway restart
```

Tip: `npm view agdi version` shows the current published version.

### Pin a commit (source)

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
git fetch origin
git checkout "$(git rev-list -n 1 --before=\"2026-01-01\" origin/main)"
pnpm install && pnpm build
agdi gateway restart
```

To return to latest: `git checkout main && git pull`.

## If you are stuck

* Run `agdi doctor` again and read the output carefully.
* Check: [Troubleshooting](https://agdiai-597e782f.mintlify.site/gateway/troubleshooting.md)
* Ask in Discord: [https://discord.gg/clawd](https://discord.gg/clawd)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.