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

# doctor

> Run diagnostic checks on your Zmeel instance and automatically repair common issues.

`zmeel doctor` checks every part of your Zmeel setup and reports pass, warning, or failure for each item. With `--repair`, it attempts to fix issues that can be resolved automatically.

`zmeel run` calls doctor automatically before starting the server, so you only need to run it manually when troubleshooting or after changing configuration.

## Usage

```bash theme={null}
zmeel doctor
zmeel doctor --repair
zmeel doctor --repair --yes
```

## Options

<ParamField query="--repair" type="boolean">
  Attempt to repair fixable issues automatically. For each repairable failure, doctor prompts you to confirm before making changes (unless `--yes` is also set).
</ParamField>

<ParamField query="-y, --yes" type="boolean">
  Skip confirmation prompts during repair. Combine with `--repair` to repair all fixable issues without interaction.
</ParamField>

<ParamField query="-c, --config" type="string">
  Path to the config file. Defaults to `~/.zmeel/instances/default/config.json`.
</ParamField>

<ParamField query="-d, --data-dir" type="string">
  Data directory root. Isolates all state from `~/.zmeel`.
</ParamField>

## Checks

Doctor runs the following checks in order. A config file must be present and readable before the remaining checks can run.

| Check                    | What it verifies                                                 |
| ------------------------ | ---------------------------------------------------------------- |
| **Config file**          | Config file exists and can be parsed                             |
| **Deployment/auth mode** | Deployment mode and auth settings are consistent                 |
| **Agent JWT secret**     | `ZMEEL_AGENT_JWT_SECRET` is set or can be generated              |
| **Secrets adapter**      | Secrets provider is accessible and the key file exists           |
| **Storage**              | Storage directory exists or S3 bucket is reachable               |
| **Database**             | Database is reachable and migrations are up to date              |
| **LLM provider**         | API key is present (warning only if missing, not a hard failure) |
| **Log directory**        | Log directory exists and is writable                             |
| **Port**                 | The configured port is available                                 |

## Examples

```bash theme={null}
# Check your setup and report any issues
zmeel doctor

# Check and repair fixable issues (prompts for each repair)
zmeel doctor --repair

# Check and repair all fixable issues without prompting
zmeel doctor --repair --yes
```

## Reading the output

Each check prints a status indicator:

* `✓` — passed
* `!` — warning (non-blocking)
* `✗` — failed (blocking if starting the server)

A summary at the end shows the total counts. If any checks fail, `zmeel doctor` exits with a non-zero status and `zmeel run` will not start the server.

<Tip>
  Run `zmeel doctor` after changing your configuration with `zmeel configure`. It catches misconfigurations — like a wrong database URL or missing LLM key — before you start the server.
</Tip>

## Alias

`--fix` is an alias for `--repair`:

```bash theme={null}
zmeel doctor --fix
```
