Failures in a terminal coding assistant can begin before a model receives a task. Codex CLI diagnostics identify installation, configuration, authentication, and runtime problems by reporting a status for each area.

The report describes the Codex environment used by the current terminal. A different configuration home or project can change its findings, and passing local checks does not demonstrate that a model request will succeed.

An existing Codex CLI installation is required, but sign-in is not required to generate a report. Connectivity checks contact provider endpoints, and built-in redaction does not remove the need to inspect paths and configuration details before sharing diagnostic output.

Steps to run diagnostics for Codex CLI:

  1. Run the grouped diagnostic summary for the installed Codex CLI. Example output:
    $ codex doctor --summary
    Codex Doctor v0.167.2 · linux-aarch64
    ##### snipped #####
    Configuration
      ✓ config       loaded
      ✗ auth         no Codex credentials were found — Run codex login or provide an API key through a supported auth env var.
      ✓ mcp          no MCP servers configured
      ✓ sandbox      restricted fs + restricted network · approval OnRequest
      ✓ sandbox      no explicit filesystem paths to probe
    ##### snipped #####
    Connectivity
      ✓ network      no proxy env vars
      ⚠ websocket    Responses WebSocket failed; HTTPS fallback may still work — Check proxy, VPN, firewall, DNS, custom CA, and WebSocket policy support.
      ✓ reachability active provider endpoints are reachable over HTTP
    ##### snipped #####
    18 ok · 1 idle · 2 notes · 1 warn · 1 fail failed
    ##### snipped #####

    The grouped rows show successful checks with ✓, warnings with ⚠, failures with ✗, and idle components with ○. The final counts summarize the report; notes repeat findings that need attention. This unsigned-in environment has an authentication failure and a WebSocket warning even though installation checks pass. HTTP reachability does not establish a working WebSocket connection. Counts and findings depend on the installed version and environment.

    The report above completed with exit status 1 because it contained a failed check. A report being printed does not mean the installation is healthy. An unknown doctor command or option indicates that the installed release does not support that invocation.
    Related: How to check Codex CLI version
    Related: Codex doctor reference

  2. Inspect the JSON report for the check that needs attention. Example output:
    $ codex doctor --json
    {
      "schemaVersion": 1,
    ##### snipped #####
      "overallStatus": "fail",
      "codexVersion": "0.167.2",
      "checks": {
    ##### snipped #####
        "auth.credentials": {
          "id": "auth.credentials",
          "category": "auth",
          "status": "fail",
          "summary": "no Codex credentials were found",
          "details": {
            "auth file": "/home/user/.codex/auth.json",
            "auth storage mode": "File"
          },
          "remediation": "Run codex login or provide an API key through a supported auth env var.",
          "durationMs": 0
        },
    ##### snipped #####
      }
    }

    overallStatus reports overall health, while checks maps check IDs to their individual status, summary, details, and remediation fields. A check can report ok, warning, or fail; remediation may be null. Here, auth.credentials identifies the missing login rather than an installation fault. For a configuration error, config.load can identify the file, line, and column. The JSON report also returned 1 in this failed state. The displayed excerpt is shortened, and the home path is anonymized; the command itself emits complete JSON.

Share this guide