cli.md +73 −37
5 5
6ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex. Learn more about [what's included](https://developers.openai.com/codex/pricing).6ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex. Learn more about [what's included](https://developers.openai.com/codex/pricing).
7 7
8<YouTubeEmbed
9 title="Codex CLI overview"
10 videoId="iqNzfK4_meQ"
11 class="max-w-md"
12/>
13<br />
14
8## CLI setup15## CLI setup
9 16
1017Choose your package manager<CliSetupSteps client:load />
18
19The 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>.
11 23
1224npmHomebrewIf you're new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).
13 25
14261. 1---
15 27
1628 ### Install## Work with the Codex CLI
17 29
1830 Install the Codex CLI with npm.<BentoContainer>
31 <BentoContent href="/codex/cli/features#running-in-interactive-mode">
19 32
2033 npm install command### Run Codex interactively
21 34
2235 npm i -g @openai/codexCopyRun `codex` to start an interactive terminal UI (TUI) session.
232. 2
24 36
2537 ### Run </BentoContent>
38 <BentoContent href="/codex/cli/features#models-reasoning">
26 39
2740 Run Codex in a terminal. It can inspect your repository, edit files, and run commands.### Control model and reasoning
28 41
2942 Run Codex commandUse `/model` to switch between GPT-5.4, GPT-5.3-Codex, and other available models, or adjust reasoning levels.
30 43
3144 codexCopy </BentoContent>
45 <BentoContent href="/codex/cli/features#image-inputs">
32 46
3347 The first time you run Codex, you'll be prompted to sign in. Authenticate with your ChatGPT account or an API key.### Image inputs
34 48
3549 See the [pricing page](https://developers.openai.com/codex/pricing) if you're not sure which plans include Codex access.Attach screenshots or design specs so Codex reads them alongside your prompt.
363. 3
37 50
3851 ### Upgrade </BentoContent>
52 <BentoContent href="/codex/cli/features#image-generation">
39 53
4054 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:### Image generation
41 55
4256 npm upgrade commandGenerate or edit images directly in the CLI, and attach references when you want Codex to iterate on an existing asset.
43 57
4458 npm i -g @openai/codex@latestCopy </BentoContent>
45 59
4660The Codex CLI is available on macOS, Windows, and Linux. On Windows, run Codex <BentoContent href="/codex/cli/features#running-local-code-review">
47 natively in PowerShell with the Windows sandbox, or use WSL2 when you need a
48Linux-native environment. For setup details, see the
49[Windows setup guide](https://developers.openai.com/codex/windows).
50 61
5162If you're new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).### Run local code review
52 63
64Get your code reviewed by a separate Codex agent before you commit or push your changes.
53 65
5466## Work with the Codex CLI </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
87
88Launch a Codex Cloud task, choose environments, and apply the resulting diffs without leaving your terminal.
55 89
5690[### Run Codex interactively </BentoContent>
57 91
5892Run `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 href="/codex/noninteractive">
59 93
6094Use `/model` to switch between GPT-5.4, GPT-5.3-Codex, and other available models, or adjust reasoning levels.](https://developers.openai.com/codex/cli/features#models-reasoning)[### Image inputs### Scripting Codex
61 95
6296Attach screenshots or design specs so Codex reads them alongside your prompt.](https://developers.openai.com/codex/cli/features#image-inputs)[### Image generationAutomate repeatable workflows by scripting Codex with the `exec` command.
63 97
6498Generate or edit images directly in the CLI, and attach references when you want Codex to iterate on an existing asset.](https://developers.openai.com/codex/cli/features#image-generation)[### Run local code review </BentoContent>
99 <BentoContent href="/codex/mcp">
65 100
66101Get 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 subagents### Model Context Protocol
67 102
68103Use subagents to parallelize complex tasks.](https://developers.openai.com/codex/subagents)[### Web searchGive Codex access to additional third-party tools and context with Model Context Protocol (MCP).
69 104
70105Use 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 </BentoContent>
71 106
72107Launch 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 Codex <BentoContent href="/codex/cli/features#approval-modes">
73 108
74109Automate repeatable workflows by scripting Codex with the `exec` command.](https://developers.openai.com/codex/noninteractive)[### Model Context Protocol### Approval modes
75 110
76111Give Codex access to additional third-party tools and context with Model Context Protocol (MCP).](https://developers.openai.com/codex/mcp)[### Approval modesChoose the approval mode that matches your comfort level before Codex edits or runs commands.
77 112
78113Choose the approval mode that matches your comfort level before Codex edits or runs commands.](https://developers.openai.com/codex/cli/features#approval-modes) </BentoContent>
114</BentoContainer>