copillm codex
Launch Codex CLI, fully wired against the local copillm daemon.
copillm [--debug] codex [args...]
Any arguments after codex are forwarded verbatim to the underlying Codex CLI — except for copillm-owned flags, which copillm consumes regardless of position.
copillm codex --model gpt-5
copillm codex --help
Copillm-owned flags
Copillm reserves a small set of flags. Each has a long canonical form (--copillm-*) and a short alias. Copillm consumes both forms before the agent sees them, even if Codex would otherwise define the same short flag (e.g. Codex’s own --profile).
| Short | Long (canonical) | Description |
|---|---|---|
--profile <name> | --copillm-profile <name> | Override the active profile from ~/.copillm/agent.toml for this launch. |
--account <name> | --copillm-account <name> | Route this launch at a specific copillm account (see Account selection). |
--use <spec> | --copillm-use <spec> | Pin the Codex CLI version (e.g. 1.4.7 or @openai/codex@1.4.7). |
--debug | --copillm-debug | Enable debug endpoints when auto-starting the daemon. |
--no-config | --copillm-no-config | Skip agent.toml fan-out for this launch. |
--yolo | — | Skip approvals/sandbox (injects --dangerously-bypass-approvals-and-sandbox). Reads COPILLM_YOLO. |
Examples:
copillm codex --profile work # uses copillm profile "work"
copillm codex --yolo --debug # yolo + copillm daemon diagnostics
copillm --debug codex # equivalent (global debug flag still works)
What it does
- Starts the copillm daemon in the background if it is not already running.
- Resolves the Codex CLI binary in this order:
--copillm-use <pkg>@<ver>flag or theCOPILLM_CODEX_VERSIONenvironment variable- A cached install at
~/.copillm/bin/codex/<version>/ - A fresh install of the latest
@openai/codexvianpm installinto~/.copillm/bin/codex/<version>/
Opt-in PATH fallback. Set
COPILLM_USE_SYSTEM_AGENT=1(ortrue/yes) to additionally consider a systemcodexonPATH(checked before the cache when no version is pinned). Off by default so the version copillm runs is always the one it manages. - Prints the resolved binary path and version, for example:
→ codex (cached, ~/.copillm/bin/codex/1.4.9, v1.4.9) - Generates
~/.copillm/codex/config.tomland points Codex at it (viaCODEX_HOME), so Codex sends requests tohttp://127.0.0.1:4141/codex/v1. - Forwards stdin/stdout/stderr to the agent and exits with the agent’s exit code.
For details on Codex-specific configuration, see Using with Codex CLI.
Account selection
When you hold more than one account, this launch targets one of them. Precedence, highest first:
--account <name>/--copillm-account <name>on this command- the
COPILLM_ACCOUNTenvironment variable - the active profile’s
accountpin inagent.toml - the default account (what
copillm auth switchsets)
copillm prints a one-line notice naming the account whenever one is chosen by flag, env, or profile:
copillm: using account "work" (from --account)
The launch is validated up front: an unknown, malformed, or not-logged-in account fails fast with a clear error. Model discovery for the generated Codex config runs as the selected account, so each account’s catalogue is accurate. Under the hood Codex is pointed at http://127.0.0.1:4141/<account>/codex/v1; see Selecting an account for the routing details.
Related environment variables
| Variable | Purpose |
|---|---|
COPILLM_CODEX_VERSION | Pin a specific Codex CLI version. |
COPILLM_ACCOUNT | Account to launch against when --account is not passed. See Account selection. |
CODEX_HOME | Set by copillm when launching Codex, pointing it at the generated config under ~/.copillm/codex/. |
COPILLM_PORT | Override the daemon port (default 4141). |
COPILLM_LOG_FILE | Override the debug log path used when copillm auto-starts the daemon with --debug. |