Doctor command -- diagnose the local Codex install, config, auth, and runtime health.
Wraps codex doctor [OPTIONS]. Useful as a preflight before a run:
it reports whether the CLI is installed, whether auth is configured,
and whether the configured provider endpoints are reachable.
Usage
config = CodexWrapper.Config.new()
{:ok, report} = CodexWrapper.Commands.Doctor.execute(Doctor.new(), config)For a machine-readable report, use execute_json/2:
{:ok, report} = CodexWrapper.Commands.Doctor.execute_json(Doctor.new(), config)
report["overallStatus"]
#=> "ok"Exit status
codex doctor exits 0 even when checks report warnings or failures, so
a successful call is not by itself a clean bill of health. Read
"overallStatus" from the JSON report ("ok", "warning", ...) rather
than relying on the exit code.
Summary
Functions
Expand long lists in detailed human output (--all).
Use ASCII status labels and separators in human output (--ascii).
Build the argument list for this command.
Run the diagnostics synchronously, returning the report as a string.
Run the diagnostics with --json and return the decoded report.
Emit a redacted machine-readable report (--json).
Create a doctor command with every option unset.
Disable ANSI color in human output (--no-color).
Show only grouped check rows and the final count summary (--summary).
Types
Functions
Expand long lists in detailed human output (--all).
Use ASCII status labels and separators in human output (--ascii).
Build the argument list for this command.
@spec execute(t(), CodexWrapper.Config.t()) :: {:ok, String.t()} | {:error, term()}
Run the diagnostics synchronously, returning the report as a string.
The human-readable report is a display format, not a stable contract.
Use execute_json/2 when the caller needs to inspect the result.
@spec execute_json(t(), CodexWrapper.Config.t()) :: {:ok, map()} | {:error, term()}
Run the diagnostics with --json and return the decoded report.
Forces --json on the command. The report is a map keyed by
"schemaVersion", "overallStatus", "codexVersion", and "checks".
Emit a redacted machine-readable report (--json).
@spec new() :: t()
Create a doctor command with every option unset.
Disable ANSI color in human output (--no-color).
Show only grouped check rows and the final count summary (--summary).