1# CLI – Codex1# Codex CLI
2 2
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.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.
4It’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.
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
8<YouTubeEmbed
9 title="Codex CLI overview"
10 videoId="iqNzfK4_meQ"
11 class="max-w-md"
12/>
13<br />
7 14
8## CLI setup15## CLI setup
9 16
10Choose your install option17<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
12macOS/LinuxWindowsnpmHomebrew24If you're new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).
13 25
141. 126---
15 27
16 ### Install28## Work with the Codex CLI
17 29
18 Install the Codex CLI with the standalone installer for macOS and Linux.30<BentoContainer>
31 <BentoContent href="/codex/cli/features#running-in-interactive-mode">
19 32
20 macOS/Linux install command33### Run Codex interactively
21 34
22 curl -fsSL https://chatgpt.com/codex/install.sh | shCopy35Run `codex` to start an interactive terminal UI (TUI) session.
23 36
24 For unattended installs, set `CODEX_NON_INTERACTIVE=1` on the shell that runs the downloaded installer. See [Environment variables](https://developers.openai.com/codex/environment-variables#installer-variables) for details.37 </BentoContent>
38 <BentoContent href="/codex/cli/features#models-and-reasoning">
25 39
26 macOS/Linux unattended install command40### Control model and reasoning
27 41
28 curl -fsSL https://chatgpt.com/codex/install.sh | CODEX\_NON\_INTERACTIVE=1 shCopy42Use `/model` to switch between GPT-5.4, GPT-5.3-Codex, and other available models, or adjust reasoning levels.
292. 2
30 43
31 ### Run44 </BentoContent>
45 <BentoContent href="/codex/cli/features#image-inputs">
32 46
33 Run Codex in a terminal. It can inspect your repository, edit files, and run commands.47### Image inputs
34 48
35 Run Codex command49Attach screenshots or design specs so Codex reads them alongside your prompt.
36 50
37 codexCopy51 </BentoContent>
52 <BentoContent href="/codex/cli/features#image-generation">
38 53
39 The first time you run Codex, you'll be prompted to sign in. Authenticate with your ChatGPT account or an API key.54### Image generation
40 55
41 See the [pricing page](https://developers.openai.com/codex/pricing) if you're not sure which plans include Codex access.56Generate or edit images directly in the CLI, and attach references when you want Codex to iterate on an existing asset.
423. 3
43 57
44 ### Upgrade58 </BentoContent>
45 59
46 New versions of the Codex CLI are released regularly. See the [changelog](https://developers.openai.com/codex/changelog) for release notes. To upgrade a standalone install, rerun the installer:60 <BentoContent href="/codex/cli/features#running-local-code-review">
47 61
48 macOS/Linux upgrade command62### Run local code review
49 63
50 curl -fsSL https://chatgpt.com/codex/install.sh | shCopy64Get your code reviewed by a separate Codex agent before you commit or push your changes.
51 65
52The Codex CLI is available on macOS, Windows, and Linux. On Windows, run Codex66 </BentoContent>
53natively in PowerShell with the Windows sandbox, or use WSL2 when you need a
54Linux-native environment. For setup details, see the
55[Windows setup guide](https://developers.openai.com/codex/windows).
56 67
57If you’re new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).68 <BentoContent href="/codex/subagents">
58 69
70### Use subagents
59 71
60## Work with the Codex CLI72Use 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
61 87
62[### Run Codex interactively88Launch a Codex Cloud task, choose environments, and apply the resulting diffs without leaving your terminal.
63 89
64Run `codex` to start an interactive terminal UI (TUI) session.](https://developers.openai.com/codex/cli/features#running-in-interactive-mode)[### Control model and reasoning90 </BentoContent>
65 91
66Use `/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 inputs92 <BentoContent href="/codex/noninteractive">
67 93
68Attach screenshots or design specs so Codex reads them alongside your prompt.](https://developers.openai.com/codex/cli/features#image-inputs)[### Image generation94### Scripting Codex
69 95
70Generate 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 review96Automate repeatable workflows by scripting Codex with the `exec` command.
71 97
72Get 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 subagents98 </BentoContent>
99 <BentoContent href="/codex/mcp">
73 100
74Use subagents to parallelize complex tasks.](https://developers.openai.com/codex/subagents)[### Web search101### Model Context Protocol
75 102
76Use 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 tasks103Give Codex access to additional third-party tools and context with Model Context Protocol (MCP).
77 104
78Launch 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 Codex105 </BentoContent>
79 106
80Automate repeatable workflows by scripting Codex with the `exec` command.](https://developers.openai.com/codex/noninteractive)[### Model Context Protocol107 <BentoContent href="/codex/cli/features#approval-modes">
81 108
82Give Codex access to additional third-party tools and context with Model Context Protocol (MCP).](https://developers.openai.com/codex/mcp)[### Approval modes109### Approval modes
83 110
84Choose the approval mode that matches your comfort level before Codex edits or runs commands.](https://developers.openai.com/codex/cli/features#approval-modes)111Choose the approval mode that matches your comfort level before Codex edits or runs commands.
85 112
113 </BentoContent>
114</BentoContainer>