cli.md +1 −111
1# Codex CLI1# Codex CLI
2 2
33Codex 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.<CodexCliLanding />
4It's [open source](https://github.com/openai/codex) and built in Rust for speed and efficiency.
5
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 />
14
15## CLI setup
16
17<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>.
23
24If you're new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).
25
26
27## Work with the Codex CLI
28
29<BentoContainer>
30 <BentoContent href="/codex/cli/features#running-in-interactive-mode">
31
32### Run Codex interactively
33
34Run `codex` to start an interactive terminal UI (TUI) session.
35
36 </BentoContent>
37 <BentoContent href="/codex/cli/features#models-and-reasoning">
38
39### Control model and reasoning
40
41Use `/model` to switch between available models or adjust reasoning levels.
42
43 </BentoContent>
44 <BentoContent href="/codex/cli/features#image-inputs">
45
46### Image inputs
47
48Attach screenshots or design specs so Codex reads them alongside your prompt.
49
50 </BentoContent>
51 <BentoContent href="/codex/cli/features#image-generation">
52
53### Image generation
54
55Generate or edit images directly in the CLI, and attach references when you want Codex to iterate on an existing asset.
56
57 </BentoContent>
58
59 <BentoContent href="/codex/cli/features#running-local-code-review">
60
61### Run local code review
62
63Get your code reviewed by a separate Codex agent before you commit or push your changes.
64
65 </BentoContent>
66
67 <BentoContent href="/codex/subagents">
68
69### Use subagents
70
71Use subagents to parallelize complex tasks.
72
73 </BentoContent>
74
75 <BentoContent href="/codex/cli/features#web-search">
76
77### Web search
78
79Use Codex to search the web and get up-to-date information for your task.
80
81 </BentoContent>
82
83 <BentoContent href="/codex/cli/features#working-with-codex-cloud">
84
85### Codex Cloud tasks
86
87Launch a Codex Cloud task, choose environments, and apply the resulting diffs without leaving your terminal.
88
89 </BentoContent>
90
91 <BentoContent href="/codex/noninteractive">
92
93### Scripting Codex
94
95Automate repeatable workflows by scripting Codex with the `exec` command.
96
97 </BentoContent>
98 <BentoContent href="/codex/mcp">
99
100### Model Context Protocol
101
102Give Codex access to additional third-party tools and context with Model Context Protocol (MCP).
103
104 </BentoContent>
105
106 <BentoContent href="/codex/cli/features#approval-modes">
107
108### Approval modes
109
110Choose the approval mode that matches your comfort level before Codex edits or runs commands.
111
112 </BentoContent>
113</BentoContainer>