---
title: "oz0 doctor"
description: "Check the setup the CLI context points at (--context, $OZ0_CONTEXT, or the default context), from this machine."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0/doctor"
---
# oz0 doctor

> Check the setup the CLI context points at (--context, $OZ0_CONTEXT, or the default context), from this machine.

For: Operators and developers looking up a command.

Check the setup the CLI context points at (--context, $OZ0_CONTEXT, or the default context), from this machine. It checks:

- The edge's Temporal port (7233) and API port (7443): connections and TLS with a certificate of the cluster's CA that is not about to end.
- This machine's clock against the edge's, and the operator certificate.
- Management: the database and its migrations, the servers, the cluster CA, the nodes and their certificates.
- The edge: the tenant's Temporal namespace and each model key the tenant has, checked with the provider's list of models, which spends no tokens.
- The tenant's tool policy: each warning of oz0 policy lint, for whoever may read the tool policy.
- The free disk space of --data-dir or the context's folder.

On a node, run `oz0-node doctor`. Each check that is not ok says how to fix it. Exits 0 when every check is ok, 2 when the worst is a warning, 1 when one failed; --json prints the checks for scripts.

## Usage

```bash
oz0 doctor [flags]
```

## Flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --data-dir
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        the context's folder
      </code>
    </td>
    
    <td>
      a server's data directory, whose disk space to check
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --edge-api
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      check this edge API address (host:port) instead of the context's
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --edge-temporal
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      check this edge Temporal address (host:port) instead of the context's
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --json
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      print the checks as JSON
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --skip-model-keys
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      leave out the model keys' checks, which call the providers
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      tenant whose Temporal namespace, model keys and tool policy to check
    </td>
  </tr>
</tbody>
</table>

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --context
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CONTEXT or &lt;config dir>/orchestrator-zero/context.json
      </code>
    </td>
    
    <td>
      CLI context file written by server init
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
</tbody>
</table>

See [all `oz0` commands](https://docs.oz0.ai/reference/cli/oz0) and the [global flags](https://docs.oz0.ai/reference/cli/oz0#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
