Definition

Codex CLI

Codex CLI is OpenAI's open-source command-line coding agent that runs GPT models against your local repo with tool use, sandboxing, and approvals.

Codex CLI is OpenAI's open-source terminal agent for software development. It runs locally, reads your files, proposes and applies edits, executes shell commands, and iterates toward a goal using GPT models. The project lives at github.com/openai/codex and is written in Rust.

Why it matters

Codex CLI is OpenAI's answer to the agentic coding category pioneered by tools like Claude Code and Aider. Because the source is open, you can audit how it prompts models, how it applies diffs, and how it sandboxes commands — which matters for teams with strict code-execution policies.

It's one of the CLIs SpaceSpider ships first-class support for. You can pick codex when creating a space and it gets a full pane in your grid layout. See cli-codex.

How it works

Codex CLI loads your project, builds a system prompt describing its available tools, and starts an interactive session. Each turn it may call tools to read files, run shell commands, apply patches, or search the codebase. Output is streamed back into the context window and the model continues reasoning.

Key features:

  • Approval modes (suggest, auto-edit, full-auto) that gate how autonomously it can act
  • Sandbox execution — on macOS via Seatbelt, on Linux via Landlock/seccomp
  • Model selection across OpenAI's chat and reasoning models
  • Config via ~/.codex/config.toml and project-level overrides
  • MCP server support for plugging in external tools

How it's used

Typical invocations:

  • codex — interactive agent in the current directory
  • codex -q "write a failing test for the login regression" — non-interactive
  • Pair with git worktrees to run multiple agents on different branches

Developers often compare it head-to-head with Claude Code; see /compare/claude-code-vs-codex and /alternatives/codex-cli.

FAQ

Is Codex CLI the same as the old GitHub Copilot Codex model?

No. The 2021 "Codex" was an OpenAI model behind the original Copilot. This Codex CLI (launched 2025) is an open-source agent that uses current GPT models — the name was reused.

Can I use Codex CLI with non-OpenAI models?

It's designed against OpenAI's API, but the open-source codebase makes it possible to point at API-compatible endpoints. See the project README for the current state of provider support.

Related terms