Shared client configuration for the Codex CLI.
Holds binary path, working directory, environment variables, and default options that apply across all commands.
Usage
config = CodexWrapper.Config.new()
config = CodexWrapper.Config.new(working_dir: "/path/to/project")
Summary
Functions
Build the base command args from config (global flags).
Build the cmd options (working dir, env) for System.cmd.
Find the codex binary path.
Create a new config from keyword options.
Build the runner options for a streaming run.
Types
@type t() :: %CodexWrapper.Config{ binary: String.t(), env: [{String.t(), String.t()}], idle_timeout_ms: pos_integer() | nil, timeout: pos_integer() | nil, verbose: boolean(), working_dir: String.t() | nil }
Functions
Build the base command args from config (global flags).
Currently always empty. Raises ArgumentError if verbose: true was set
on a directly constructed or updated struct.
Build the cmd options (working dir, env) for System.cmd.
@spec find_binary() :: String.t()
Find the codex binary path.
Checks in order:
CODEX_CLIenvironment variable- System PATH
Create a new config from keyword options.
Options
:binary- Path to the codex binary (default: auto-discover):working_dir- Working directory for the subprocess:env- List of{key, value}environment variable tuples:timeout- Whole-command timeout in milliseconds for streaming runs:idle_timeout_ms- Maximum gap between output frames while streaming (default: 300,000 ms):verbose- Compatibility option. Onlyfalseis supported;trueraisesArgumentErrorbefore the CLI is launched, because the Codex CLI does not define a--verboseflag
Build the runner options for a streaming run.
Same shape as cmd_opts/1 but with stderr_to_stdout: false: the
streaming paths parse NDJSON off stdout, and merging stderr into it
would put unparseable lines in the stream. Stderr is left to flow to
the parent's stderr.