cli.md +74 −39
1# Codex CLI1# Codex CLI
2 2
3Pair with Codex in your terminal
4
5Codex 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.3Codex 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.
6It's [open source](https://github.com/openai/codex) and built in Rust for speed and efficiency.4It's [open source](https://github.com/openai/codex) and built in Rust for speed and efficiency.
7 5
86Codex is included with ChatGPT Plus, Pro, Business, Edu, and Enterprise plans. Learn more about [what’s included](https://developers.openai.com/codex/pricing).ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex. Learn more about [what's included](https://developers.openai.com/codex/pricing).
7
8<YouTubeEmbed
9 title="Codex CLI overview"
10 videoId="iqNzfK4_meQ"
11 class="max-w-md"
12/>
13<br />
9 14
10## CLI setup15## CLI setup
11 16
1217Choose your package manager<CliSetupSteps client:load />
13 18
1419npmHomebrewThe Codex CLI is available on macOS, Windows, and Linux. On Windows, run Codex
20 natively in PowerShell with the Windows sandbox, or use WSL2 when you need a
21 Linux-native environment. For setup details, see the{" "}
22 <a href="/codex/windows">Windows setup guide</a>.
15 23
16241. 1If you're new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).
17 25
1826 ### Install---
19 27
2028 Install the Codex CLI with npm.## Work with the Codex CLI
21 29
2230 npm install command<BentoContainer>
31 <BentoContent href="/codex/cli/features#running-in-interactive-mode">
23 32
2433 npm i -g @openai/codexCopy### Run Codex interactively
252. 2
26 34
2735 ### RunRun `codex` to start an interactive terminal UI (TUI) session.
28 36
2937 Run Codex in a terminal. It can inspect your repository, edit files, and run commands. </BentoContent>
38 <BentoContent href="/codex/cli/features#models-reasoning">
30 39
3140 Run Codex command### Control model and reasoning
32 41
3342 codexCopyUse `/model` to switch between GPT-5.4, GPT-5.3-Codex, and other available models, or adjust reasoning levels.
34 43
3544 The first time you run Codex, you'll be prompted to sign in. Authenticate with your ChatGPT account or an API key. </BentoContent>
45 <BentoContent href="/codex/cli/features#image-inputs">
36 46
3747 See the [pricing page](https://developers.openai.com/codex/pricing) if you're not sure which plans include Codex access.### Image inputs
383. 3
39 48
4049 ### UpgradeAttach screenshots or design specs so Codex reads them alongside your prompt.
41 50
4251 New versions of the Codex CLI are released regularly. See the [changelog](https://developers.openai.com/codex/changelog) for release notes. To upgrade with npm, run: </BentoContent>
52 <BentoContent href="/codex/cli/features#image-generation">
43 53
4454 npm upgrade command### Image generation
45 55
4656 npm i -g @openai/codex@latestCopyGenerate or edit images directly in the CLI, and attach references when you want Codex to iterate on an existing asset.
47 57
4858The Codex CLI is available on macOS and Linux. Windows support is </BentoContent>
49experimental. For the best Windows experience, use Codex in a WSL workspace
50and follow our [Windows setup guide](https://developers.openai.com/codex/windows).
51 59
60 <BentoContent href="/codex/cli/features#running-local-code-review">
52 61
5362## Work with the Codex CLI### Run local code review
63
64Get your code reviewed by a separate Codex agent before you commit or push your changes.
65
66 </BentoContent>
67
68 <BentoContent href="/codex/subagents">
69
70### Use subagents
71
72Use subagents to parallelize complex tasks.
73
74 </BentoContent>
75
76 <BentoContent href="/codex/cli/features#web-search">
77
78### Web search
79
80Use Codex to search the web and get up-to-date information for your task.
81
82 </BentoContent>
83
84 <BentoContent href="/codex/cli/features#working-with-codex-cloud">
85
86### Codex Cloud tasks
54 87
5588[### Run Codex interactivelyLaunch a Codex Cloud task, choose environments, and apply the resulting diffs without leaving your terminal.
56 89
5790Run `codex` to start an interactive terminal UI (TUI) session.](https://developers.openai.com/codex/cli/features#running-in-interactive-mode)[### Control model and reasoning </BentoContent>
58 91
5992Use `/model` to switch between GPT-5.3-Codex and other available models, or adjust reasoning levels.](https://developers.openai.com/codex/cli/features#models-reasoning)[### Image inputs <BentoContent href="/codex/noninteractive">
60 93
6194Attach screenshots or design specs so Codex reads them alongside your prompt.](https://developers.openai.com/codex/cli/features#image-inputs)[### Run local code review### Scripting Codex
62 95
6396Get your code reviewed by a separate Codex agent before you commit or push your changes.](https://developers.openai.com/codex/cli/features#running-local-code-review)[### Use multi-agentAutomate repeatable workflows by scripting Codex with the `exec` command.
64 97
6598Enable experimental multi-agent collaboration and parallelize complex tasks.](https://developers.openai.com/codex/multi-agent)[### Web search </BentoContent>
99 <BentoContent href="/codex/mcp">
66 100
67101Use Codex to search the web and get up-to-date information for your task.](https://developers.openai.com/codex/cli/features#web-search)[### Codex Cloud tasks### Model Context Protocol
68 102
69103Launch a Codex Cloud task, choose environments, and apply the resulting diffs without leaving your terminal.](https://developers.openai.com/codex/cli/features#working-with-codex-cloud)[### Scripting CodexGive Codex access to additional third-party tools and context with Model Context Protocol (MCP).
70 104
71105Automate repeatable workflows by scripting Codex with the `exec` command.](https://developers.openai.com/codex/sdk#using-codex-cli-programmatically)[### Model Context Protocol </BentoContent>
72 106
73107Give Codex access to additional third-party tools and context with Model Context Protocol (MCP).](https://developers.openai.com/codex/mcp)[### Approval modes <BentoContent href="/codex/cli/features#approval-modes">
74 108
75109Choose the approval mode that matches your comfort level before Codex edits or runs commands.](https://developers.openai.com/codex/cli/features#approval-modes)### Approval modes
76 110
77111[NextChoose the approval mode that matches your comfort level before Codex edits or runs commands.
78 112
79113Features](https://developers.openai.com/codex/cli/features) </BentoContent>
114</BentoContainer>