Setup guides
Set up Codex
Install the OpenAI Codex CLI on a machine, log in with ChatGPT or an API key, and run Picnic jobs with Codex as the engine.
Codex is Picnic's second engine. A job can run with Claude Code (the default) or with the OpenAI Codex CLI. Codex is optional: you only need it on machines where you want Codex jobs to run.
Note: Like Claude Code, Codex runs under the machine's own login. Picnic runs the official
codexbinary and never reads, copies, relays or stores its credentials.
Install
Install the Codex CLI on the machine with npm or Homebrew:
npm i -g @openai/codex
or
brew install --cask codex
Warning: Install
@openai/codex, with the@openai/part. A package called plaincodexon npm is unrelated.
Check it worked:
codex --version
Log in
In Terminal on the machine, run:
codex login
You can sign in with your ChatGPT account, so Codex jobs use your ChatGPT plan, or use an OpenAI API key, so they are billed to that API account. Either way the login lives on the machine, under its own user, and Picnic only ever runs codex there.
To see whether the machine is logged in:
codex login status
Check it
Open the Factory tab and choose the machine. Codex has its own setup checks:
| Check | Green means | Fix |
|---|---|---|
| Codex CLI | codex was found and answered with its version |
npm install -g @openai/codex (the Fix button runs it) |
| Codex logged in | codex login status succeeded |
Open Terminal on the machine and run codex login |
These checks are optional. A machine without Codex is perfectly healthy and shows no red for it: the rows say "Only needed for Codex jobs". They only matter when a Codex job is asked for on that machine. Picnic reads nothing but the result of codex login status; it never opens Codex's own credential files.
Choose Codex for a job
There are two ways to pick the engine:
- Per job. In New job, set Engine to Codex.
- Per loop. A loop names an engine, so every job it starts uses it. See Loops.
Through the API, send "engine": "codex" when you create a job. Leave it out and the job uses Claude Code.
How a Codex job runs
A Codex job goes through the same steps as any other job. Only the agent in the middle is different.
- Picnic makes the job's git worktree and branch,
<first name>/<slug>-<id8>, as usual. - It runs
codex exec --jsonin that worktree with the job's prompt, your global instructions and a short note for the job's mode. - It reads Codex's events and turns them into the job's chat: the agent's messages and each command it runs.
- Codex finishes by writing the same short report every job writes, and Picnic runs the same checks: pull request, CI, demo and plan.
- A follow-up in the chat runs
codex exec resumeon the same session, so Codex keeps its context.
Merging, CI, conflicts and branch rules work the same as for Claude Code. See Review and merge.
What differs from Claude Code
- A sandbox instead of permission asks. Codex runs in its
workspace-writesandbox: it can write only in the job's worktree, the job's artifacts folder and the repository's git folder, with network access on so it can push and open pull requests. It never stops to ask for approval, because nobody is at the terminal. Picnic's per-call asks forsudo, CI config and writes outside the worktree are a Claude Code feature. - Questions come at the end. Codex can't ask a question mid-job. When it needs you, it stops and reports itself blocked with the question, the job moves to Needs you, and your reply in the chat resumes the same session.
- Open in Terminal resumes Claude Code sessions. For a Codex job, open the worktree and use
codexthere yourself. - Titles for new jobs are still written with Claude Code when it is installed; otherwise the job keeps the first line of its prompt.
Troubleshooting
- A Codex job goes straight to Needs you as failed: the machine doesn't have Codex installed or logged in. Run the install and
codex loginabove on that machine, then start a new job. - Codex works in Terminal but not in Picnic: make sure
codexis installed for the same macOS user that runs Picnic, and that it is on a standard path such as/opt/homebrew/binor/usr/local/bin.
See also Set up Claude Code.
