> ## 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.

# doctor

# `agdi doctor`

Gateway 网关和渠道的健康检查 + 快速修复。

相关内容：

* 故障排除：[故障排除](https://agdiai-597e782f.mintlify.site/gateway/troubleshooting.md)
* 安全审计：[安全](https://agdiai-597e782f.mintlify.site/gateway/security.md)

## 示例

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

注意事项：

* 交互式提示（如钥匙串/OAuth 修复）仅在 stdin 是 TTY 且**未**设置 `--non-interactive` 时运行。无头运行（cron、Telegram、无终端）将跳过提示。
* `--fix`（`--repair` 的别名）会将备份写入 `~/.agdi/agdi.json.bak`，并删除未知的配置键，同时列出每个删除项。

## macOS：`launchctl` 环境变量覆盖

如果你之前运行过 `launchctl setenv OPENCLAW_GATEWAY_TOKEN ...`（或 `...PASSWORD`），该值会覆盖你的配置文件，并可能导致持续的"未授权"错误。

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
launchctl getenv OPENCLAW_GATEWAY_TOKEN
launchctl getenv OPENCLAW_GATEWAY_PASSWORD

launchctl unsetenv OPENCLAW_GATEWAY_TOKEN
launchctl unsetenv OPENCLAW_GATEWAY_PASSWORD
```


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