OpenAI Codex CLI
OpenAI Codex CLI is a terminal-based AI coding agent that reads your code, makes edits, runs commands, and iterates with you on software tasks. It operates locally on your machine, executing changes with your approval while maintaining a conversation about your codebase.
itArtificial intelligence and machine learning | OpenSkills.info
Intro
OpenAI Codex CLI
OpenAI Codex CLI is a cross-platform local coding agent that runs in your terminal. It combines a large language model with direct access to your filesystem, shell commands, and development tools to produce software changes while you observe and guide the process.
The mental model
Codex CLI functions as an interactive pair programmer that can read, write, and execute. Unlike a chat interface that only discusses code, Codex operates on your actual project files and can run tests, linters, and build tools.
your prompt
-> Codex reads relevant files
-> proposes changes and commands
-> you approve or reject
-> Codex applies changes
-> iterate until done
The agent maintains context across a session. It remembers earlier decisions, file contents it has examined, and the current state of your request. This allows multi-step work where each turn builds on previous actions.
Installation and setup
Install Codex CLI using the official installer script, package manager, or Homebrew:
# macOS and Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# npm
npm install -g @openai/codex
# Homebrew
brew install --cask codex
After installation, run codex with no arguments to start an interactive session. The first launch prompts you to authenticate with your OpenAI account.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://github.com/openai/codex
Supports
- Installation methods (curl script, npm, Homebrew)
- CLI flags and options
- Sandbox modes and approval policies
- AGENTS.md discovery rules
- MCP client functionality
- Slash commands and terminal UI
- Configuration file structure
- https://openai.com/index/introducing-the-codex-app/
Supports
- Codex as a cross-platform local software agent
- Capabilities and use cases
- Integration with development workflows
- https://openai.com/index/unrolling-the-codex-agent-loop/
Supports
- Agent loop mechanics
- Context management
- Iterative task processing
- Safety and reliability design
- https://openai.com/index/introducing-upgrades-to-codex/
Supports
- GPT-5-Codex model availability
- Performance improvements
- API access and pricing
- https://learn.chatgpt.com/docs/codex/cli
Supports
- Getting started guide
- Basic usage patterns
- Terminal UI overview
- https://cookbook.openai.com/examples/gpt-5/codex_prompting_guide
Supports
- Prompting best practices
- Effective request formulation
- Common patterns and techniques
- https://modelcontextprotocol.io/
Supports
- MCP architecture and concepts
- Server configuration
- Protocol integration
