Global configuration for Codex interactions.
Options are built from caller-supplied values merged with environment defaults.
Summary
Types
@type t() :: %Codex.Options{ agent_max_threads: pos_integer() | nil, api_key: String.t() | nil, base_url: String.t(), codex_path_override: String.t() | nil, hide_agent_reasoning: boolean(), history_max_bytes: non_neg_integer() | nil, history_persistence: String.t() | nil, model: String.t() | nil, model_auto_compact_token_limit: pos_integer() | nil, model_context_window: pos_integer() | nil, model_personality: Codex.Protocol.ConfigTypes.personality() | nil, model_reasoning_summary: String.t() | nil, model_supports_reasoning_summaries: boolean() | nil, model_verbosity: String.t() | nil, reasoning_effort: Codex.Models.reasoning_effort() | nil, review_model: String.t() | nil, telemetry_prefix: [atom()], tool_output_token_limit: pos_integer() | nil }
Functions
Determines the executable path to codex-rs.
Order of precedence:
- Explicit override on the struct.
CODEX_PATHenvironment variable.System.find_executable("codex").
Builds a validated options struct.
API keys are optional. When omitted, the Codex CLI relies on your existing
codex login (ChatGPT tokens stored in auth.json).