Codex CLI is OpenAI's coding agent that you can run locally from your terminal. It can read, change, and run code on your machine in the selected directory. Built in Rust for speed and efficiency.
Run codex to start an interactive terminal UI (TUI) session. Edit, run, and iterate on your code in real time with natural language instructions.
Use /model to switch between GPT-5.4, GPT-5.3-Codex, and other models. Adjust reasoning levels to match task complexity.
Attach screenshots or design specs so Codex reads them alongside your prompt. Perfect for translating mockups into working code.
Get your code reviewed by a separate Codex agent before you commit or push changes. Catch issues early with automated review.
Use subagents to parallelize complex tasks. Offload subtasks to specialized agents and collect results asynchronously.
Use Codex to search the web and get up-to-date information for your task. Codex retrieves live results and integrates them into your workflow.
Launch a Codex Cloud task, choose environments, and apply the resulting diffs without leaving your terminal.
Automate repeatable workflows by scripting Codex with the exec command. Integrate Codex into your CI/CD pipelines.
Give Codex access to third-party tools and context with Model Context Protocol (MCP). Extend Codex with custom integrations.
Choose the approval mode that matches your comfort level before Codex edits or runs commands. Full control over every action.
Available on macOS, Windows, and Linux. Choose your package manager below.
Install the Codex CLI with npm.
npm i -g @openai/codex
Run codex in your terminal. It can inspect your repository, edit files, and run commands.
codex
The first time you run Codex, you'll be prompted to sign in. Authenticate with your ChatGPT account or an API key.
New versions of the Codex CLI are released regularly. To upgrade:
npm i -g @openai/codex@latest
Codex CLI is available for ChatGPT Plus, Pro, Business, Edu, and Enterprise plans.
Get Started