codex CLI fails in CI environments (GitHub Actions) due to Ink raw mode error, even with --quiet, CODEX_QUIET_MODE=1, and --no-terminal
What version of Codex is running?
0.1.2505172129
Which model were you using?
default. just trying demos in CI pipeline
What platform is your computer?
github actions
What steps can reproduce the bug?
Running the Codex CLI in GitHub Actions fails with an Ink-related stdin error, even when using recommended non-interactive flags and environment variables.
Environment
Runner: ubuntu-latest (GitHub Actions)
Node: 22.15.0
Codex CLI installed globally: npm install -g @openai/codex
Prompt: any (e.g. "Update CHANGELOG" or "Look for vulnerabilities...")
What I tried;
jobs:
...
env:
CODEX_QUIET_MODE: 1
codex -a auto-edit --quiet "Update CHANGELOG for next release"
codex --no-terminal "Look for vulnerabilities and create a security review report"
And also export CODEX_QUIET_MODE=1 and codex --quiet --no-terminal ... in the step
What is the expected behavior?
A valid response of the codex app
What do you see instead?
ERROR Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported
Additional information
This is the relevant action code
name: Codex review integration
on:
push:
branches: [ "master" ]
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
codex-review:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.CODEX_API_KEY }}
CODEX_QUIET_MODE: 1 #deshabilita el modo consola para git action
permissions:
contents: read
pull-requests: write
steps:
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Codex CLI
run: npm install -g @openai/codex
- name: Check Codex CLI version
run: codex --version
# Ejemplo de paso: actualizar changelog automáticamente
- name: Auto-update CHANGELOG with Codex
run: |
export CODEX_QUIET_MODE=1
codex --no-terminal -a auto-edit "Update CHANGELOG for next release"
# Otro paso: revisión de seguridad (puedes duplicar con diferentes prompts)
- name: Security review with Codex
run: |
codex --quiet "Look for vulnerabilities and create a security review report"
# Otro paso: sugerencia de PRs útiles
- name: Suggest high-impact PRs
run: |
codex --quiet "Carefully review this repo, and propose 3 high impact well-scoped PRs"
7 Comments
A workaround is to specify a container, and allocate a tty.
⚠️ Same underlying issue in #1080, #1156, and #1208 (also reproducible in AWS Lambda)
All three reports crash with the identical Ink error:
Error: Raw mode is not supported on the current process.stdin …The Codex CLI calls stdin.setRawMode(true) via Ink’s useInput.
If the process has no real TTY (CI runners, Jupyter/Colab, Lambda, Docker without -t) Ink throws and Codex exits before any flags are parsed.
➡️ There is no reliable headless work-around yet
• Setting CI=true and passing --yes --allow-outside-git --approval-mode full-auto is not sufficient—Ink still initialises useInput and the CLI crashes.
• Same result in Lambda, GitHub Actions, Azure Functions, and Colab notebooks.
🛠 Proposed fix for the CLI
Until then the only viable option is:
Run Codex CLI inside an environment that has a TTY (e.g. self-hosted runner with docker run -it …).
I had the same problem, so I checked the problem, and it turned out that
OPENAI_API_KEYwas not working properly as an environment variable.If you look at the
get-api-key.tsxfile, it looks like this:If don't read the value from the environment variable, it will be rendered and an error will occur in the GitHub Actions environment. Please check if it is properly caught by doing the following in CI.
You can test it like this.
An error occurs because OPENAI_API_KEY is empty. However, if you enter a correct value in OPENAI_API_KEY and run the same command again, it will be printed correctly.
Is there any workaround for this raw mode error?
script -qfc "your-shell-command" /dev/nullHey @charlie87041, I noticed there's now a section in the README.md about Non-interactive / CI mode. It suggests using
codex exec --full-auto "prompt goes here". Can you retry using this?I also noticed your GitHub Actions yml is missing the checkout step. (N.B. You _can_ use Codex CLI without having a checked-out repo if you want, but you'd also need the
--skip-git-repo-checkflag).The yml I used for testing was,
You can see the GitHub Actions run here: https://github.com/jdoxey/codex-bug-test/actions/runs/17008004859/job/48220199682
The original issue reported here is no longer relevant because the CLI has since been rewritten in Rust and no longer uses ink.