Skip to content

feat: Config, Command behaviour, and binary discovery #1

@joshrotenberg

Description

@joshrotenberg

Summary

Foundation layer for codex_wrapper. Mirror the claude_wrapper architecture:

  • CodexWrapper.Config struct: binary path, working_dir, env, timeout, verbose
  • Binary discovery: explicit path > CODEX_CLI env var > system PATH
  • CodexWrapper.Command behaviour with args/0 and parse_output/2 callbacks
  • Generic Command.run/3 that handles System.cmd execution, timeout via Task.async/yield

Acceptance criteria

  • Config.new/1 accepts keyword opts, finds codex binary
  • Config.cmd_opts/1 returns opts for System.cmd (cd, env, stderr_to_stdout)
  • Command behaviour defined with run/3 generic executor
  • CodexWrapper.raw/2 escape hatch for arbitrary CLI args
  • Tests for config creation, binary discovery fallback chain

Reference

  • claude_wrapper: lib/claude_wrapper/config.ex, lib/claude_wrapper/command.ex
  • codex-wrapper (Rust): src/lib.rs (Codex builder)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions