Skip to main content

discover_codex_binary

Function discover_codex_binary 

Source
pub fn discover_codex_binary(configured: Option<&str>) -> Result<PathBuf>
Expand description

Locate a working codex binary.

Order: configuredKRANZ_CODEX_BIN env var → codex on PATH → well-known install locations. Each candidate is validated by running it with --version; the first one that succeeds wins. Errors list every attempt so the user can see what was tried.

KRANZ_CODEX_BIN, when set and non-empty, is an exclusive override: only that path is probed, and a failure is returned immediately rather than falling through to PATH or the well-known fallback locations. Naming the binary explicitly and having it not work is an error, not a reason to search elsewhere.