# run_doctor_command

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/doctor/run_doctor_command)

Run `dcode doctor`, printing diagnostics as text or JSON.

## Signature

```python
run_doctor_command(
    args: argparse.Namespace,
) -> int
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `args` | `argparse.Namespace` | Yes | Parsed CLI namespace. Only `output_format` is read. |

## Returns

`int`

Process exit code: `0` when all sections are healthy, `1` otherwise.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e14e0adcbe78565ed3650e7f24b2a775d5437d25/libs/code/deepagents_code/doctor.py#L536)