Codex CLI

OpenAI's coding agent that runs locally in your terminal, with IDE and desktop versions

CLIEditors’ pickHigh risk

openai/codex

Install

curl -fsSL https://chatgpt.com/codex/install.sh | sh

macOS and Linux

This is third-party code. Review the repository files before installing.

What it does

Codex CLI is a coding agent that runs on your computer via the codex command. It works with a ChatGPT plan or an API key. Beyond the terminal there are extensions for VS Code, Cursor and Windsurf and a desktop app via codex app. The repository also ships skills used in the project's own development, such as babysit-pr for watching CI and PR reviews.

Who it is for. Developers with a ChatGPT plan or OpenAI API key who want a terminal agent.

Good fit when

  • You already have a ChatGPT Plus, Pro, Business or Enterprise plan
  • You need a local agent for repository tasks
  • You want the same agent in the terminal, IDE and desktop app
  • You want example skills for PR and CI work

Not a fit when

  • Your network cannot reach OpenAI services
  • You need a cloud agent: the README points to Codex Web for that

Example request

Add input validation to the signup endpoint and write tests

Limitations

Requires ChatGPT sign-in or an OpenAI API key, which needs extra setup. Installers download binaries from releases.openai.com with GitHub Releases as a fallback.

How to disable. Remove the codex binary, or the package with npm uninstall -g @openai/codex or via brew.

Security check

  • The agent runs commands and edits files
  • The installer downloads a binary
  • Code is sent to OpenAI models

README in short

Codex CLI is OpenAI's local coding agent. The README gives install commands for macOS, Linux and Windows, plus npm and Homebrew, and links to prebuilt binaries. Signing in with a ChatGPT plan is recommended, and API keys are also supported. The project is licensed under Apache-2.0.

SKILL.md

---
name: babysit-pr
description: Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.
---

# PR Babysitter

## Objective
Babysit a PR persistently until one of these terminal outcomes occurs:

- The PR is merged or closed.
- A situation requires user help (for example CI infrastructure issues, repeated flaky failures after retry budget is exhausted, permission problems, or ambiguity that cannot be resolved safely).
- Optional handoff milestone: the PR is currently green + mergeable + review-clean. Treat this as a progress state, not a watcher stop, so late-arriving review comments are still surfaced promptly while the PR remains open.

Do not stop merely because a single snapshot returns `idle` while checks are still pending.

## Inputs
Accept any of the following:

- No PR argument: infer the PR from the current branch (`--pr auto`)
- PR number
- PR URL

## Core Workflow

1. When the user asks to "monitor"/"watch"/"babysit" a PR, start with the watcher's continuous mode (`--watch`) unless you are intentionally doing a one-shot diagnostic snapshot.
2. Run the watcher script to snapshot PR/review/CI state (or consume each streamed snapshot from `--watch`).
3. Inspect the `actions` list in the JSON response.
4. If `diagnose_ci_failure` is present, inspect failed run logs and classify the failure.
5. If the failure is likely caused by the current branch, patch code locally, commit, and push. Do not patch random flaky tests, CI infrastructure, dependency outages, runner issues, or other failures that are unrelated to the branch.

FAQ

How do I make the installer use GitHub Releases?

Set CODEX_INSTALLER_USE_RELEASES_OPENAI_COM to false.

How is Codex CLI different from Codex Web?

Codex CLI runs locally on your computer, while Codex Web is the cloud agent at chatgpt.com/codex.

Editors’ pick

A self-improving agent from Nous Research with a TUI, messaging gateway, cron jobs and skills it writes itself

CLIHigh risk245.5K
Editors’ pick

Anthropic's coding agent for the terminal, IDE and GitHub: understands your codebase, runs tasks and handles git

CLIHigh risk145K
Editors’ pick

Google's open-source terminal agent on Gemini models: code work, shell, web search and MCP

CLIHigh risk107K
Editors’ pick

Open-source coding agent for VS Code, JetBrains, the terminal and desktop, with any model and MCP support

CLIHigh risk68K