A Go wrapper that translates StrawPot protocol arguments into OpenAI Codex CLI flags. It acts as a pure translation layer — process management, sessions, and infrastructure are handled by StrawPot core.
- Codex CLI (
brew install codexornpm install -g @openai/codex) - An OpenAI API key (or a ChatGPT Plus/Pro plan)
curl -fsSL https://raw.githubusercontent.com/strawpot/strawpot_codex_cli/main/strawpot_codex/install.sh | shThis downloads a pre-built binary for your platform (macOS/Linux, amd64/arm64) to /usr/local/bin. Override the install directory with INSTALL_DIR:
INSTALL_DIR=~/.local/bin curl -fsSL ... | shThe wrapper exposes two subcommands:
Runs codex login to authenticate with OpenAI.
strawpot_codex setupTranslates StrawPot protocol flags into a Codex CLI command and outputs it as JSON.
strawpot_codex build \
--agent-workspace-dir /path/to/workspace \
--working-dir /path/to/project \
--task "fix the bug" \
--config '{"model":"o3"}'Output:
{
"cmd": ["codex", "exec", "fix the bug", "-c", "model_instructions_file=\"/path/to/workspace/prompt.md\"", "-m", "o3", "--dangerously-bypass-approvals-and-sandbox", "-C", "/path/to/project", "--add-dir", "/path/to/workspace"],
"cwd": "/path/to/project"
}| Flag | Required | Description |
|---|---|---|
--agent-workspace-dir |
Yes | Workspace directory (used as --add-dir) |
--working-dir |
No | Working directory for the command (cwd in output, passed as -C) |
--task |
No | Task prompt (positional arg to codex exec) |
--config |
No | JSON config object (default: {}) |
--role-prompt |
No | Role prompt text (written to prompt.md) |
--memory-prompt |
No | Memory/context prompt (appended to prompt.md) |
--skills-dir |
No | Directory with skill subdirectories (symlinked to skills/) |
--roles-dir |
No | Directory with role subdirectories (repeatable, symlinked to roles/) |
--agent-id |
No | Agent identifier |
Pass via --config:
| Key | Type | Default | Description |
|---|---|---|---|
model |
string | o3 |
Model to use |
dangerously_skip_permissions |
boolean | true |
Bypass all approvals and sandbox (--dangerously-bypass-approvals-and-sandbox). Set to false to require approval. |
| Variable | Description |
|---|---|
OPENAI_API_KEY |
OpenAI API key (optional if logged in via codex login) |
SANDBOX_MODE |
Sandbox policy passed to --sandbox (e.g. workspace-write, read-only, danger-full-access) |
cd codex/wrapper
go test -v ./...Releases are built with GoReleaser and published automatically via GitHub Actions.
See LICENSE for details.