pub struct Codex { /* private fields */ }Expand description
Shared Codex CLI client configuration.
Holds the binary path, working directory, environment variables, global
arguments, timeout, and retry policy. Cheap to Clone; intended to be
created once and reused across many command invocations.
§Example
let codex = codex_wrapper::Codex::builder()
.env("OPENAI_API_KEY", "sk-...")
.timeout_secs(120)
.build()?;Implementations§
Source§impl Codex
impl Codex
Sourcepub fn builder() -> CodexBuilder
pub fn builder() -> CodexBuilder
Create a new CodexBuilder.
Sourcepub fn working_dir(&self) -> Option<&Path>
pub fn working_dir(&self) -> Option<&Path>
Working directory for command execution, if set.
Sourcepub fn with_working_dir(&self, dir: impl Into<PathBuf>) -> Self
pub fn with_working_dir(&self, dir: impl Into<PathBuf>) -> Self
Return a clone of this client with a different working directory.
Sourcepub async fn cli_version(&self) -> Result<CliVersion>
pub async fn cli_version(&self) -> Result<CliVersion>
Query the installed Codex CLI version.
Sourcepub async fn check_version(&self, minimum: &CliVersion) -> Result<CliVersion>
pub async fn check_version(&self, minimum: &CliVersion) -> Result<CliVersion>
Verify the installed CLI meets a minimum version requirement.
Returns Error::VersionMismatch if the installed version is too old.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Codex
impl RefUnwindSafe for Codex
impl Send for Codex
impl Sync for Codex
impl Unpin for Codex
impl UnsafeUnpin for Codex
impl UnwindSafe for Codex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more