Skip to content

Codex CLI: A Complete Guide to OpenAI's Open-Source Terminal Coding Agent

Mar 31, 2026 1 min
TL;DR Codex CLI is OpenAI's open source terminal coding agent (Rust, Apache-2.0, ~106.6k stars) with MCP, subagents, image input, code review, and Skills. The model line is now GPT-5.6 Sol / Terra / Luna, and the desktop app, CLI, and IDE extension share one config.toml.
Table of Contents
  1. Installation
  2. Core Features
  3. Model Evolution
    1. codex-1 (early 2025)
    2. GPT-5-Codex (late 2025)
    3. The three GPT-5.6 tiers (current)
  4. Codex App vs. Codex CLI
  5. Typical Use Cases
  6. Positioning vs. Other Tools
  7. Resources
  8. References
  9. Changelog

🌏 中文版

Codex CLI is OpenAI's open-source coding agent that runs directly in your terminal. It can read, modify, and execute code on your machine. Written in Rust, it starts fast and performs well.

Installation

# npm
npm i -g @openai/codex

# Homebrew
brew install --cask codex

Supports macOS and Linux; use via WSL on Windows. Codex is included with ChatGPT Plus, Pro, Business, Edu, and Enterprise plans.

Core Features

FeatureDescription
MCP SupportConfigure STDIO or streaming HTTP servers in ~/.codex/config.toml; Codex itself can also act as an MCP server
SubagentsSpawns sub-agents only when explicitly requested, enabling parallel execution of large tasks
Image InputPaste screenshots or design mockups — Codex reads and incorporates visual details
Code ReviewA dedicated Codex agent reviews your code before commits or pushes
AutomationUse the exec command to script repetitive workflows
SkillsBundle instructions, resources, and scripts so Codex can reliably connect to tools and run workflows

Model Evolution

codex-1 (early 2025)

The earliest cloud version of Codex, an o3 model optimized for software engineering. It handled tasks in parallel — writing features, answering codebase questions, fixing bugs, opening PRs.

GPT-5-Codex (late 2025)

GPT-5 further optimized for agentic coding, good at both fast interactive conversation and long-running autonomous work. OpenAI rebuilt Codex CLI around agentic coding workflows based on community feedback.

The three GPT-5.6 tiers (current)

The main line is now Sol / Terra / Luna: Sol for depth, Terra as the everyday default, Luna for speed and cost. You pick via the Power setting (Smarter ↔ Faster); the default is gpt-5.6-sol at medium reasoning.

Two dates matter: GPT-5.4 and GPT-5.4 mini retire from ChatGPT-signed-in Codex on 2026/8/31 (replaced by Terra and Luna), and gpt-5.2 and gpt-5.3-codex were deprecated earlier. Update any script or codex exec --model invocation that hardcodes an old model ID. The bring-your-own-API-key path is unaffected.

For model and billing detail, see OpenAI Codex: A Complete Plan Analysis in this series.

Codex App vs. Codex CLI

Codex CLICodex App
InterfaceTerminalDesktop app (macOS / Windows)
HighlightsLightweight, scriptableMulti-agent management, parallel tasks, long-running collaboration
Open Source

The Codex App added Windows support in March 2026, offering a more visual interface for managing multiple agents.

Typical Use Cases

  1. Bug fixing: Describe the problem — Codex reads the relevant files, pinpoints the issue, and proposes a fix
  2. Feature development: Provide a spec and Codex generates code step by step for you to review
  3. Codebase Q&A: Ask "what does this function do?" and Codex reads the source code and answers
  4. Automation scripts: Use codex exec to chain CI/CD pipelines or repetitive daily tasks

Positioning vs. Other Tools

Codex CLI's core advantage lies in its deep integration with OpenAI's own models (codex-1, GPT-5-Codex) and the complete ecosystem spanning from the cloud-based Codex App to the local CLI. If you're already using the OpenAI API, Codex CLI is the most seamless choice.

Resources

References

Changelog

  • 2026-08-18: Added the current GPT-5.6 Sol / Terra / Luna line and the 2026/8/31 GPT-5.4 retirement date (the post previously stopped at codex-1 and GPT-5-Codex); noted that the three surfaces share one config.toml; added to the Choosing an Agent CLI series