Add Codex CLI as a third first-class backend - #8
Open
dfrysinger wants to merge 1 commit into
Open
Conversation
Extends the multi-call wrapper so `co <name>` / `codex-agent <name>` launches Codex CLI alongside the existing `ca` (Copilot) and `cc` (Claude Code) commands. Same shape as the other two: its own workspace root (CODEX_WORKSPACE_BASE, default ~/Library/CloudStorage/Dropbox/codex-workspace), agent-<name>/ subdirs, and a `codex-<name>` tmux session prefix so `ca alpha`, `cc alpha`, and `co alpha` coexist on one tmux server. Resume strategy mirrors the Claude backend since Codex CLI has no session-id flag: if any rollout under ~/.codex/sessions has a session_meta line whose cwd matches $DIR, launch with `codex resume --last`; otherwise fresh `codex`. `resume --last` already filters by cwd, so we only need a boolean "has this agent run before" check. Scan uses ripgrep when available (~350ms across ~1000 sessions here) and falls back to `grep -rl` when it isn't. `ALLOW_ALL=true` appends `--dangerously-bypass-approvals-and-sandbox`, Codex's analogue of Copilot's `--allow-all` and Claude's `--dangerously-skip-permissions`. install.sh gains `--codex-workspace-base`, prompts for the codex root via the same _resolve_workspace_base helper, symlinks `codex-agent` and `co` alongside the existing four names, writes CODEX_WORKSPACE_BASE into the config, and reports `codex --version` in the backend-CLI detection block. uninstall.sh removes the new symlinks with the same exact-match collision guard. README rewrites the intro, "What you get", installer summary, first-launch, workspace-locations, config, and roadmap sections to name Codex as a third backend rather than a future one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Codex CLI as a third first-class backend alongside Copilot and Claude Code.
coandcodex-agent, dispatched by$0's basename (same multi-call pattern asca/copilot-agentandcc/claude-agent).CODEX_WORKSPACE_BASE(default~/Library/CloudStorage/Dropbox/codex-workspace); agents atagent-<name>/inside it. tmux session namecodex-<name>soca alpha,cc alpha, andco alphacoexist.--session-idflag): scan~/.codex/sessions/**/*.jsonlfor asession_metaline whosecwdmatches$DIR. If found, launchcodex resume --last; else freshcodex.resume --lastalready filters by cwd, so we only need a boolean check.rgwhen available (~350ms across ~1000 sessions),grep -rlfallback otherwise.ALLOW_ALL=trueappends--dangerously-bypass-approvals-and-sandbox— Codex's analogue of Copilot's--allow-alland Claude's--dangerously-skip-permissions.install.sh: new--codex-workspace-baseflag, uses the same_resolve_workspace_basehelper as the other two, symlinkscodex-agent+cowith the same collision guard, writesCODEX_WORKSPACE_BASEinto the config, reportscodex --versionin backend detection.uninstall.sh: removesco/codex-agentsymlinks with the existing exact-match guard.README.md: updates the intro, "What you get", installer summary, first-launch, workspace-locations, config, and roadmap sections to reflect Codex as a shipped backend rather than a future one.Test plan
Verified against Codex CLI 0.145.0 + Copilot CLI 1.0.72 + Claude Code on macOS Tahoe (Apple silicon), by shim-mocking
tmuxso the wrapper prints the launch string it would exec:co newname(no prior sessions) →codex --dangerously-bypass-approvals-and-sandboxin tmuxcodex-newname, cwd$CODEX_WORKSPACE_BASE/agent-newname.co charliepointed at a workspace root where~/.codex/sessionshas a matchingcwd→codex resume --last --dangerously-bypass-approvals-and-sandbox(resume path fires when it should).co --helpshows codex-specific example; env-var help listsCODEX_WORKSPACE_BASEandCODEX_BIN.ca alphaandcc alphaunchanged after the refactor (regression check).bash -nonbin/agent,install.sh,uninstall.sh.install.shrun (not exercised in this branch; local machine already had a config file, so_read_config_var CODEX_WORKSPACE_BASEpath is the one that needs eyes on real install).🤖 Generated with Claude Code
https://claude.ai/code/session_01Vcoo7Cep2YqRhgDWAg6pNd