Esta página se muestra en inglés. Una traducción al español está en curso.
CLI ToolsApr 6, 2026·2 min de lectura

OpenAI Codex CLI — Terminal Coding Agent by OpenAI

Official OpenAI terminal coding agent. Reads your codebase, writes code, runs commands, and manages files from the command line. Multi-model support with sandbox execution. 20,000+ stars.

Introducción

OpenAI Codex CLI is the official terminal-based coding agent from OpenAI with 20,000+ GitHub stars. It reads your codebase, writes code, executes commands, and manages files directly from the command line — similar to Claude Code but powered by OpenAI models. Features include sandbox execution, multi-model support (o4-mini, o3, GPT-4o), and configurable approval modes from fully manual to fully autonomous. Best for developers who want an OpenAI-powered alternative to Claude Code. Works with: OpenAI models (o4-mini, o3, GPT-4o). Setup time: under 2 minutes.


Core Features

Three Approval Modes

Mode Behavior
suggest Shows suggestions, you approve each one
auto-edit Auto-applies file edits, asks for commands
auto Full autonomy — edits and runs commands
codex --mode auto "Refactor the database layer to use connection pooling"

Sandbox Execution

Commands run in a sandboxed environment by default:

  • Network access disabled
  • File system restricted to project directory
  • Configurable permissions

Multi-Model Support

# Use different models
codex --model o4-mini "Quick fix for the typo in README"
codex --model o3 "Design and implement a caching layer"
codex --model gpt-4o "Explain the authentication flow"

Context-Aware

Codex reads your project structure, git history, and relevant files to understand context before making changes.

Typical Workflow

# Navigate to your project
cd my-app

# Ask Codex to help
codex "The login endpoint returns 500 when the email has uppercase letters"

# Codex:
# 1. Reads relevant files (auth/login.ts, models/user.ts)
# 2. Identifies the case-sensitivity bug
# 3. Proposes a fix
# 4. Shows diff for approval
# 5. Applies the change
# 6. Runs tests to verify

Configuration

# ~/.codex/config.yaml
model: o4-mini
mode: auto-edit
approval:
  file_edits: auto
  commands: manual
context:
  max_files: 50
  include_git_diff: true

Key Stats

  • 20,000+ GitHub stars
  • Official OpenAI product
  • 3 approval modes
  • Sandboxed execution
  • Multi-model support (o4-mini, o3, GPT-4o)

FAQ

Q: What is OpenAI Codex CLI? A: The official OpenAI terminal coding agent that reads your codebase, writes code, runs commands, and manages files from the command line.

Q: Is Codex CLI free? A: The CLI is open-source. You need an OpenAI API key with usage-based billing.

Q: How does Codex CLI compare to Claude Code? A: Both are terminal coding agents. Codex uses OpenAI models (o4-mini, o3), Claude Code uses Claude models. Core functionality is similar — code editing, command execution, and project context awareness.


🙏

Fuente y agradecimientos

Created by OpenAI. Licensed under Apache 2.0.

codex — ⭐ 20,000+

Thanks to OpenAI for making terminal-based AI coding mainstream.

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados