unbound doctor runs a deep diagnostic of your local Unbound install. It inspects every supported AI coding tool — Cursor, Claude Code, Codex, and GitHub Copilot — and validates that your stored API key is still accepted by the backend.
What it checks
For each AI coding tool, doctor verifies three things:| Check | What it confirms |
|---|---|
| Config | The tool’s own config file contains the Unbound integration |
| Hook script | The installed hook / key-helper file exists on disk |
| Env wiring | The API key — and the gateway URL for gateway mode — is exported in your shell |
Per-tool status
Each tool resolves to one of four statuses:| Status | Meaning |
|---|---|
| Healthy | Config, hook script, and env wiring all present (shown in green) |
| Tampered | Installed but broken — a missing hook, a config without the integration, or a managed config that points at a hook that isn’t on disk. Reinstall to fix |
| Not set up | No Unbound integration found for this tool |
| Managed by MDM | Configured org-wide by an admin (config and hook verified) |
- Nothing set up yet → run
unbound setup. - A user-level tool is tampered → run
unbound doctor --fix(no sudo needed). - An MDM-managed install is broken → it’s org-wide, so run
sudo unbound doctor --fixto reinstall the managed hooks. - API key invalid → run
unbound login.
Exit codes
| Code | Meaning |
|---|---|
0 | All tools healthy (or not installed / MDM-managed) and the API key is valid |
| non-zero | Any tool is Tampered or the API key is invalid |
Flags
| Flag | Behavior |
|---|---|
--fix | Reinstall the tampered tools the current scope can repair. Without sudo it fixes your user-level tools; with sudo (sudo unbound doctor --fix) it reinstalls the MDM-managed (org-wide) hooks. Whichever scope you run, doctor points you at the other for anything it couldn’t touch |
--json | Machine-readable output (per-tool status, checks, conflict, plus api_key) |
status, the individual checks, and a boolean conflict — true when two modes of the same tool are installed at once (for example Claude Code in both subscription and gateway mode), which doctor reports as Tampered so --fix can clean it up. api_key carries the key-validation result (valid / invalid / not-logged-in / unverified).

