1# Command line options1# Command line options
2 2
3## How to read this reference3export const globalFlagOptions = [
4 4 {
5This page catalogs every documented Codex CLI command and flag. Use the interactive tables to search by key or description. Each section indicates whether the option is stable or experimental and calls out risky combinations.5 key: "PROMPT",
6 6 type: "string",
7The CLI inherits most defaults from <code>~/.codex/config.toml</code>. Any7 description:
8 <code>-c key=value</code> overrides you pass at the command line take8 "Optional text instruction to start the session. Omit to launch the TUI without a pre-filled message.",
9 precedence for that invocation. See [Config9 },
10 basics](https://developers.openai.com/codex/config-basic#configuration-precedence) for more information.10 {
11 11 key: "--image, -i",
12## Global flags12 type: "path[,path...]",
13 13 description:
14| Key | Type / Values | Details |14 "Attach one or more image files to the initial prompt. Separate multiple paths with commas or repeat the flag.",
15| --- | --- | --- |15 },
16| `--add-dir` | `path` | Grant additional directories write access alongside the main workspace. Repeat for multiple paths. |16 {
17| `--ask-for-approval, -a` | `untrusted | on-request | never` | Control when Codex pauses for human approval before running a command. `on-failure` is deprecated; prefer `on-request` for interactive runs or `never` for non-interactive runs. |17 key: "--model, -m",
18| `--cd, -C` | `path` | Set the working directory for the agent before it starts processing your request. |18 type: "string",
19| `--config, -c` | `key=value` | Override configuration values. Values parse as JSON if possible; otherwise the literal string is used. |19 description:
20| `--dangerously-bypass-approvals-and-sandbox, --yolo` | `boolean` | Run every command without approvals or sandboxing. Only use inside an externally hardened environment. |20 "Override the model set in configuration (for example `gpt-5.4`).",
21| `--disable` | `feature` | Force-disable a feature flag (translates to `-c features.<name>=false`). Repeatable. |21 },
22| `--enable` | `feature` | Force-enable a feature flag (translates to `-c features.<name>=true`). Repeatable. |22 {
23| `--image, -i` | `path[,path...]` | Attach one or more image files to the initial prompt. Separate multiple paths with commas or repeat the flag. |23 key: "--oss",
24| `--model, -m` | `string` | Override the model set in configuration (for example `gpt-5.4`). |24 type: "boolean",
25| `--no-alt-screen` | `boolean` | Disable alternate screen mode for the TUI (overrides `tui.alternate_screen` for this run). |25 defaultValue: "false",
26| `--oss` | `boolean` | Use the local open source model provider (equivalent to `-c model_provider="oss"`). Validates that Ollama is running. |26 description:
27| `--profile, -p` | `string` | Configuration profile name to load from `~/.codex/config.toml`. |27 'Use the local open source model provider (equivalent to `-c model_provider="oss"`). Validates that Ollama is running.',
28| `--remote` | `ws://host:port | wss://host:port` | Connect the interactive TUI to a remote app-server WebSocket endpoint. Supported for `codex`, `codex resume`, and `codex fork`; other subcommands reject remote mode. |28 },
29| `--remote-auth-token-env` | `ENV_VAR` | Read a bearer token from this environment variable and send it when connecting with `--remote`. Requires `--remote`; tokens are only sent over `wss://` URLs or `ws://` URLs whose host is `localhost`, `127.0.0.1`, or `::1`. |29 {
30| `--sandbox, -s` | `read-only | workspace-write | danger-full-access` | Select the sandbox policy for model-generated shell commands. |30 key: "--profile, -p",
31| `--search` | `boolean` | Enable live web search (sets `web_search = "live"` instead of the default `"cached"`). |31 type: "string",
32| `PROMPT` | `string` | Optional text instruction to start the session. Omit to launch the TUI without a pre-filled message. |32 description:
33 33 "Configuration profile name to load from `~/.codex/config.toml`.",
34Key34 },
35 35 {
36`--add-dir`36 key: "--sandbox, -s",
37 37 type: "read-only | workspace-write | danger-full-access",
38Type / Values38 description:
39 39 "Select the sandbox policy for model-generated shell commands.",
40`path`40 },
41 41 {
42Details42 key: "--ask-for-approval, -a",
43 43 type: "untrusted | on-request | never",
44Grant additional directories write access alongside the main workspace. Repeat for multiple paths.44 description:
45 45 "Control when Codex pauses for human approval before running a command. `on-failure` is deprecated; prefer `on-request` for interactive runs or `never` for non-interactive runs.",
46Key46 },
47 47 {
48`--ask-for-approval, -a`48 key: "--dangerously-bypass-approvals-and-sandbox, --yolo",
49 49 type: "boolean",
50Type / Values50 defaultValue: "false",
51 51 description:
52`untrusted | on-request | never`52 "Run every command without approvals or sandboxing. Only use inside an externally hardened environment.",
53 53 },
54Details54 {
55 55 key: "--cd, -C",
56Control when Codex pauses for human approval before running a command. `on-failure` is deprecated; prefer `on-request` for interactive runs or `never` for non-interactive runs.56 type: "path",
57 57 description:
58Key58 "Set the working directory for the agent before it starts processing your request.",
59 59 },
60`--cd, -C`60 {
61 61 key: "--search",
62Type / Values62 type: "boolean",
63 63 defaultValue: "false",
64`path`64 description:
65 65 'Enable live web search (sets `web_search = "live"` instead of the default `"cached"`).',
66Details66 },
67 67 {
68Set the working directory for the agent before it starts processing your request.68 key: "--add-dir",
69 69 type: "path",
70Key70 description:
71 71 "Grant additional directories write access alongside the main workspace. Repeat for multiple paths.",
72`--config, -c`72 },
73 73 {
74Type / Values74 key: "--no-alt-screen",
75 75 type: "boolean",
76`key=value`76 defaultValue: "false",
77 77 description:
78Details78 "Disable alternate screen mode for the TUI (overrides `tui.alternate_screen` for this run).",
79 79 },
80Override configuration values. Values parse as JSON if possible; otherwise the literal string is used.80 {
81 81 key: "--remote",
82Key82 type: "ws://host:port | wss://host:port",
83 83 description:
84`--dangerously-bypass-approvals-and-sandbox, --yolo`84 "Connect the interactive TUI to a remote app-server WebSocket endpoint. Supported for `codex`, `codex resume`, and `codex fork`; other subcommands reject remote mode.",
85 85 },
86Type / Values86 {
87 87 key: "--remote-auth-token-env",
88`boolean`88 type: "ENV_VAR",
89 89 description:
90Details90 "Read a bearer token from this environment variable and send it when connecting with `--remote`. Requires `--remote`; tokens are only sent over `wss://` URLs or `ws://` URLs whose host is `localhost`, `127.0.0.1`, or `::1`.",
91 91 },
92Run every command without approvals or sandboxing. Only use inside an externally hardened environment.92 {
93 93 key: "--enable",
94Key94 type: "feature",
95 95 description:
96`--disable`96 "Force-enable a feature flag (translates to `-c features.<name>=true`). Repeatable.",
97 97 },
98Type / Values98 {
99 99 key: "--disable",
100`feature`100 type: "feature",
101 101 description:
102Details102 "Force-disable a feature flag (translates to `-c features.<name>=false`). Repeatable.",
103 103 },
104Force-disable a feature flag (translates to `-c features.<name>=false`). Repeatable.104 {
105 105 key: "--config, -c",
106Key106 type: "key=value",
107 107 description:
108`--enable`108 "Override configuration values. Values parse as JSON if possible; otherwise the literal string is used.",
109 109 },
110Type / Values110];
111 111
112`feature`112export const commandOverview = [
113 113 {
114Details114 key: "codex",
115 115 href: "/codex/cli/reference#codex-interactive",
116Force-enable a feature flag (translates to `-c features.<name>=true`). Repeatable.116 type: "stable",
117 117 description:
118Key118 "Launch the terminal UI. Accepts the global flags above plus an optional prompt or image attachments.",
119 119 },
120`--image, -i`120 {
121 121 key: "codex app-server",
122Type / Values122 href: "/codex/cli/reference#codex-app-server",
123 123 type: "experimental",
124`path[,path...]`124 description:
125 125 "Launch the Codex app server for local development or debugging.",
126Details126 },
127 127 {
128Attach one or more image files to the initial prompt. Separate multiple paths with commas or repeat the flag.128 key: "codex app",
129 129 href: "/codex/cli/reference#codex-app",
130Key130 type: "stable",
131 131 description:
132`--model, -m`132 "Launch the Codex desktop app on macOS or Windows. On macOS, Codex can open a workspace path; on Windows, Codex prints the path to open.",
133 133 },
134Type / Values134 {
135 135 key: "codex debug app-server send-message-v2",
136`string`136 href: "/codex/cli/reference#codex-debug-app-server-send-message-v2",
137 137 type: "experimental",
138Details138 description:
139 139 "Debug app-server by sending a single V2 message through the built-in test client.",
140Override the model set in configuration (for example `gpt-5.4`).140 },
141 141 {
142Key142 key: "codex debug models",
143 143 href: "/codex/cli/reference#codex-debug-models",
144`--no-alt-screen`144 type: "experimental",
145 145 description:
146Type / Values146 "Print the raw model catalog Codex sees, including an option to inspect only the bundled catalog.",
147 147 },
148`boolean`148 {
149 149 key: "codex apply",
150Details150 href: "/codex/cli/reference#codex-apply",
151 151 type: "stable",
152Disable alternate screen mode for the TUI (overrides `tui.alternate_screen` for this run).152 description:
153 153 "Apply the latest diff generated by a Codex Cloud task to your local working tree. Alias: `codex a`.",
154Key154 },
155 155 {
156`--oss`156 key: "codex cloud",
157 157 href: "/codex/cli/reference#codex-cloud",
158Type / Values158 type: "experimental",
159 159 description:
160`boolean`160 "Browse or execute Codex Cloud tasks from the terminal without opening the TUI. Alias: `codex cloud-tasks`.",
161 161 },
162Details162 {
163 163 key: "codex completion",
164Use the local open source model provider (equivalent to `-c model_provider="oss"`). Validates that Ollama is running.164 href: "/codex/cli/reference#codex-completion",
165 165 type: "stable",
166Key166 description:
167 167 "Generate shell completion scripts for Bash, Zsh, Fish, or PowerShell.",
168`--profile, -p`168 },
169 169 {
170Type / Values170 key: "codex features",
171 171 href: "/codex/cli/reference#codex-features",
172`string`172 type: "stable",
173 173 description:
174Details174 "List feature flags and persistently enable or disable them in `config.toml`.",
175 175 },
176Configuration profile name to load from `~/.codex/config.toml`.176 {
177 177 key: "codex exec",
178Key178 href: "/codex/cli/reference#codex-exec",
179 179 type: "stable",
180`--remote`180 description:
181 181 "Run Codex non-interactively. Alias: `codex e`. Stream results to stdout or JSONL and optionally resume previous sessions.",
182Type / Values182 },
183 183 {
184`ws://host:port | wss://host:port`184 key: "codex execpolicy",
185 185 href: "/codex/cli/reference#codex-execpolicy",
186Details186 type: "experimental",
187 187 description:
188Connect the interactive TUI to a remote app-server WebSocket endpoint. Supported for `codex`, `codex resume`, and `codex fork`; other subcommands reject remote mode.188 "Evaluate execpolicy rule files and see whether a command would be allowed, prompted, or blocked.",
189 189 },
190Key190 {
191 191 key: "codex login",
192`--remote-auth-token-env`192 href: "/codex/cli/reference#codex-login",
193 193 type: "stable",
194Type / Values194 description:
195 195 "Authenticate Codex using ChatGPT OAuth, device auth, or an API key piped over stdin.",
196`ENV_VAR`196 },
197 197 {
198Details198 key: "codex logout",
199 199 href: "/codex/cli/reference#codex-logout",
200Read a bearer token from this environment variable and send it when connecting with `--remote`. Requires `--remote`; tokens are only sent over `wss://` URLs or `ws://` URLs whose host is `localhost`, `127.0.0.1`, or `::1`.200 type: "stable",
201 201 description: "Remove stored authentication credentials.",
202Key202 },
203 203 {
204`--sandbox, -s`204 key: "codex mcp",
205 205 href: "/codex/cli/reference#codex-mcp",
206Type / Values206 type: "experimental",
207 207 description:
208`read-only | workspace-write | danger-full-access`208 "Manage Model Context Protocol servers (list, add, remove, authenticate).",
209 209 },
210Details210 {
211 211 key: "codex plugin marketplace",
212Select the sandbox policy for model-generated shell commands.212 href: "/codex/cli/reference#codex-plugin-marketplace",
213 213 type: "experimental",
214Key214 description:
215 215 "Add, upgrade, or remove plugin marketplaces from Git or local sources.",
216`--search`216 },
217 217 {
218Type / Values218 key: "codex mcp-server",
219 219 href: "/codex/cli/reference#codex-mcp-server",
220`boolean`220 type: "experimental",
221 221 description:
222Details222 "Run Codex itself as an MCP server over stdio. Useful when another agent consumes Codex.",
223 223 },
224Enable live web search (sets `web_search = "live"` instead of the default `"cached"`).224 {
225 225 key: "codex resume",
226Key226 href: "/codex/cli/reference#codex-resume",
227 227 type: "stable",
228`PROMPT`228 description:
229 229 "Continue a previous interactive session by ID or resume the most recent conversation.",
230Type / Values230 },
231 231 {
232`string`232 key: "codex fork",
233 233 href: "/codex/cli/reference#codex-fork",
234Details234 type: "stable",
235 235 description:
236Optional text instruction to start the session. Omit to launch the TUI without a pre-filled message.236 "Fork a previous interactive session into a new thread, preserving the original transcript.",
237 237 },
238Expand to view all238 {
239 239 key: "codex sandbox",
240These options apply to the base `codex` command and propagate to each subcommand unless a section below specifies otherwise.240 href: "/codex/cli/reference#codex-sandbox",
241When you run a subcommand, place global flags after it (for example, `codex exec --oss ...`) so Codex applies them as intended.241 type: "experimental",
242 242 description:
243## Command overview243 "Run arbitrary commands inside Codex-provided macOS, Linux, or Windows sandboxes.",
244 244 },
245The Maturity column uses feature maturity labels such as Experimental, Beta,245 {
246 and Stable. See [Feature Maturity](https://developers.openai.com/codex/feature-maturity) for how to246 key: "codex update",
247 interpret these labels.247 href: "/codex/cli/reference#codex-update",
248 248 type: "stable",
249| Key | Maturity | Details |249 description:
250| --- | --- | --- |250 "Check for and apply a Codex CLI update when the installed release supports self-update.",
251| [`codex`](https://developers.openai.com/codex/cli/reference#codex-interactive) | Stable | Launch the terminal UI. Accepts the global flags above plus an optional prompt or image attachments. |251 },
252| [`codex app`](https://developers.openai.com/codex/cli/reference#codex-app) | Stable | Launch the Codex desktop app on macOS or Windows. On macOS, Codex can open a workspace path; on Windows, Codex prints the path to open. |252];
253| [`codex app-server`](https://developers.openai.com/codex/cli/reference#codex-app-server) | Experimental | Launch the Codex app server for local development or debugging. |253
254| [`codex apply`](https://developers.openai.com/codex/cli/reference#codex-apply) | Stable | Apply the latest diff generated by a Codex Cloud task to your local working tree. Alias: `codex a`. |254export const execOptions = [
255| [`codex cloud`](https://developers.openai.com/codex/cli/reference#codex-cloud) | Experimental | Browse or execute Codex Cloud tasks from the terminal without opening the TUI. Alias: `codex cloud-tasks`. |255 {
256| [`codex completion`](https://developers.openai.com/codex/cli/reference#codex-completion) | Stable | Generate shell completion scripts for Bash, Zsh, Fish, or PowerShell. |256 key: "PROMPT",
257| [`codex debug app-server send-message-v2`](https://developers.openai.com/codex/cli/reference#codex-debug-app-server-send-message-v2) | Experimental | Debug app-server by sending a single V2 message through the built-in test client. |257 type: "string | - (read stdin)",
258| [`codex debug models`](https://developers.openai.com/codex/cli/reference#codex-debug-models) | Experimental | Print the raw model catalog Codex sees, including an option to inspect only the bundled catalog. |258 description:
259| [`codex exec`](https://developers.openai.com/codex/cli/reference#codex-exec) | Stable | Run Codex non-interactively. Alias: `codex e`. Stream results to stdout or JSONL and optionally resume previous sessions. |259 "Initial instruction for the task. Use `-` to pipe the prompt from stdin.",
260| [`codex execpolicy`](https://developers.openai.com/codex/cli/reference#codex-execpolicy) | Experimental | Evaluate execpolicy rule files and see whether a command would be allowed, prompted, or blocked. |260 },
261| [`codex features`](https://developers.openai.com/codex/cli/reference#codex-features) | Stable | List feature flags and persistently enable or disable them in `config.toml`. |261 {
262| [`codex fork`](https://developers.openai.com/codex/cli/reference#codex-fork) | Stable | Fork a previous interactive session into a new thread, preserving the original transcript. |262 key: "--image, -i",
263| [`codex login`](https://developers.openai.com/codex/cli/reference#codex-login) | Stable | Authenticate Codex using ChatGPT OAuth, device auth, or an API key piped over stdin. |263 type: "path[,path...]",
264| [`codex logout`](https://developers.openai.com/codex/cli/reference#codex-logout) | Stable | Remove stored authentication credentials. |264 description:
265| [`codex mcp`](https://developers.openai.com/codex/cli/reference#codex-mcp) | Experimental | Manage Model Context Protocol servers (list, add, remove, authenticate). |265 "Attach images to the first message. Repeatable; supports comma-separated lists.",
266| [`codex mcp-server`](https://developers.openai.com/codex/cli/reference#codex-mcp-server) | Experimental | Run Codex itself as an MCP server over stdio. Useful when another agent consumes Codex. |266 },
267| [`codex plugin marketplace`](https://developers.openai.com/codex/cli/reference#codex-plugin-marketplace) | Experimental | Add, upgrade, or remove plugin marketplaces from Git or local sources. |267 {
268| [`codex resume`](https://developers.openai.com/codex/cli/reference#codex-resume) | Stable | Continue a previous interactive session by ID or resume the most recent conversation. |268 key: "--model, -m",
269| [`codex sandbox`](https://developers.openai.com/codex/cli/reference#codex-sandbox) | Experimental | Run arbitrary commands inside Codex-provided macOS, Linux, or Windows sandboxes. |269 type: "string",
270| [`codex update`](https://developers.openai.com/codex/cli/reference#codex-update) | Stable | Check for and apply a Codex CLI update when the installed release supports self-update. |270 description: "Override the configured model for this run.",
271 271 },
272Key272 {
273 273 key: "--oss",
274[`codex`](https://developers.openai.com/codex/cli/reference#codex-interactive)274 type: "boolean",
275 275 defaultValue: "false",
276Maturity276 description:
277 277 "Use the local open source provider (requires a running Ollama instance).",
278Stable278 },
279 279 {
280Details280 key: "--sandbox, -s",
281 281 type: "read-only | workspace-write | danger-full-access",
282Launch the terminal UI. Accepts the global flags above plus an optional prompt or image attachments.282 description:
283 283 "Sandbox policy for model-generated commands. Defaults to configuration.",
284Key284 },
285 285 {
286[`codex app`](https://developers.openai.com/codex/cli/reference#codex-app)286 key: "--profile, -p",
287 287 type: "string",
288Maturity288 description: "Select a configuration profile defined in config.toml.",
289 289 },
290Stable290 {
291 291 key: "--full-auto",
292Details292 type: "boolean",
293 293 defaultValue: "false",
294Launch the Codex desktop app on macOS or Windows. On macOS, Codex can open a workspace path; on Windows, Codex prints the path to open.294 description:
295 295 "Deprecated compatibility flag. Prefer `--sandbox workspace-write`; Codex prints a warning when this flag is used.",
296Key296 },
297 297 {
298[`codex app-server`](https://developers.openai.com/codex/cli/reference#codex-app-server)298 key: "--dangerously-bypass-approvals-and-sandbox, --yolo",
299 299 type: "boolean",
300Maturity300 defaultValue: "false",
301 301 description:
302Experimental302 "Bypass approval prompts and sandboxing. Dangerous—only use inside an isolated runner.",
303 303 },
304Details304 {
305 305 key: "--cd, -C",
306Launch the Codex app server for local development or debugging.306 type: "path",
307 307 description: "Set the workspace root before executing the task.",
308Key308 },
309 309 {
310[`codex apply`](https://developers.openai.com/codex/cli/reference#codex-apply)310 key: "--skip-git-repo-check",
311 311 type: "boolean",
312Maturity312 defaultValue: "false",
313 313 description:
314Stable314 "Allow running outside a Git repository (useful for one-off directories).",
315 315 },
316Details316 {
317 317 key: "--ephemeral",
318Apply the latest diff generated by a Codex Cloud task to your local working tree. Alias: `codex a`.318 type: "boolean",
319 319 defaultValue: "false",
320Key320 description: "Run without persisting session rollout files to disk.",
321 321 },
322[`codex cloud`](https://developers.openai.com/codex/cli/reference#codex-cloud)322 {
323 323 key: "--ignore-user-config",
324Maturity324 type: "boolean",
325 325 defaultValue: "false",
326Experimental326 description:
327 327 "Do not load `$CODEX_HOME/config.toml`. Authentication still uses `CODEX_HOME`.",
328Details328 },
329 329 {
330Browse or execute Codex Cloud tasks from the terminal without opening the TUI. Alias: `codex cloud-tasks`.330 key: "--ignore-rules",
331 331 type: "boolean",
332Key332 defaultValue: "false",
333 333 description:
334[`codex completion`](https://developers.openai.com/codex/cli/reference#codex-completion)334 "Do not load user or project execpolicy `.rules` files for this run.",
335 335 },
336Maturity336 {
337 337 key: "--output-schema",
338Stable338 type: "path",
339 339 description:
340Details340 "JSON Schema file describing the expected final response shape. Codex validates tool output against it.",
341 341 },
342Generate shell completion scripts for Bash, Zsh, Fish, or PowerShell.342 {
343 343 key: "--color",
344Key344 type: "always | never | auto",
345 345 defaultValue: "auto",
346[`codex debug app-server send-message-v2`](https://developers.openai.com/codex/cli/reference#codex-debug-app-server-send-message-v2)346 description: "Control ANSI color in stdout.",
347 347 },
348Maturity348 {
349 349 key: "--json, --experimental-json",
350Experimental350 type: "boolean",
351 351 defaultValue: "false",
352Details352 description:
353 353 "Print newline-delimited JSON events instead of formatted text.",
354Debug app-server by sending a single V2 message through the built-in test client.354 },
355 355 {
356Key356 key: "--output-last-message, -o",
357 357 type: "path",
358[`codex debug models`](https://developers.openai.com/codex/cli/reference#codex-debug-models)358 description:
359 359 "Write the assistant’s final message to a file. Useful for downstream scripting.",
360Maturity360 },
361 361 {
362Experimental362 key: "Resume subcommand",
363 363 type: "codex exec resume [SESSION_ID]",
364Details364 description:
365 365 "Resume an exec session by ID or add `--last` to continue the most recent session from the current working directory. Add `--all` to consider sessions from any directory. Accepts an optional follow-up prompt.",
366Print the raw model catalog Codex sees, including an option to inspect only the bundled catalog.366 },
367 367 {
368Key368 key: "-c, --config",
369 369 type: "key=value",
370[`codex exec`](https://developers.openai.com/codex/cli/reference#codex-exec)370 description:
371 371 "Inline configuration override for the non-interactive run (repeatable).",
372Maturity372 },
373 373];
374Stable374
375 375export const appServerOptions = [
376Details376 {
377 377 key: "--listen",
378Run Codex non-interactively. Alias: `codex e`. Stream results to stdout or JSONL and optionally resume previous sessions.378 type: "stdio:// | ws://IP:PORT",
379 379 defaultValue: "stdio://",
380Key380 description:
381 381 "Transport listener URL. Use `ws://IP:PORT` to expose a WebSocket endpoint for remote clients.",
382[`codex execpolicy`](https://developers.openai.com/codex/cli/reference#codex-execpolicy)382 },
383 383 {
384Maturity384 key: "--ws-auth",
385 385 type: "capability-token | signed-bearer-token",
386Experimental386 description:
387 387 "Authentication mode for app-server WebSocket clients. If omitted, WebSocket auth is disabled; non-local listeners warn during startup.",
388Details388 },
389 389 {
390Evaluate execpolicy rule files and see whether a command would be allowed, prompted, or blocked.390 key: "--ws-token-file",
391 391 type: "absolute path",
392Key392 description:
393 393 "File containing the shared capability token. Required with `--ws-auth capability-token`.",
394[`codex features`](https://developers.openai.com/codex/cli/reference#codex-features)394 },
395 395 {
396Maturity396 key: "--ws-shared-secret-file",
397 397 type: "absolute path",
398Stable398 description:
399 399 "File containing the HMAC shared secret used to validate signed JWT bearer tokens. Required with `--ws-auth signed-bearer-token`.",
400Details400 },
401 401 {
402List feature flags and persistently enable or disable them in `config.toml`.402 key: "--ws-issuer",
403 403 type: "string",
404Key404 description:
405 405 "Expected `iss` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`.",
406[`codex fork`](https://developers.openai.com/codex/cli/reference#codex-fork)406 },
407 407 {
408Maturity408 key: "--ws-audience",
409 409 type: "string",
410Stable410 description:
411 411 "Expected `aud` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`.",
412Details412 },
413 413 {
414Fork a previous interactive session into a new thread, preserving the original transcript.414 key: "--ws-max-clock-skew-seconds",
415 415 type: "number",
416Key416 defaultValue: "30",
417 417 description:
418[`codex login`](https://developers.openai.com/codex/cli/reference#codex-login)418 "Clock skew allowance when validating signed bearer token `exp` and `nbf` claims. Requires `--ws-auth signed-bearer-token`.",
419 419 },
420Maturity420];
421 421
422Stable422export const appOptions = [
423 423 {
424Details424 key: "PATH",
425 425 type: "path",
426Authenticate Codex using ChatGPT OAuth, device auth, or an API key piped over stdin.426 defaultValue: ".",
427 427 description:
428Key428 "Workspace path for Codex Desktop. On macOS, Codex opens this path; on Windows, Codex prints the path.",
429 429 },
430[`codex logout`](https://developers.openai.com/codex/cli/reference#codex-logout)430 {
431 431 key: "--download-url",
432Maturity432 type: "url",
433 433 description:
434Stable434 "Advanced override for the Codex desktop installer URL used during install.",
435 435 },
436Details436];
437 437
438Remove stored authentication credentials.438export const debugAppServerSendMessageV2Options = [
439 439 {
440Key440 key: "USER_MESSAGE",
441 441 type: "string",
442[`codex mcp`](https://developers.openai.com/codex/cli/reference#codex-mcp)442 description:
443 443 "Message text sent to app-server through the built-in V2 test-client flow.",
444Maturity444 },
445 445];
446Experimental446
447 447export const debugModelsOptions = [
448Details448 {
449 449 key: "--bundled",
450Manage Model Context Protocol servers (list, add, remove, authenticate).450 type: "boolean",
451 451 defaultValue: "false",
452Key452 description:
453 453 "Skip refresh and print only the model catalog bundled with the current Codex binary.",
454[`codex mcp-server`](https://developers.openai.com/codex/cli/reference#codex-mcp-server)454 },
455 455];
456Maturity456
457 457export const resumeOptions = [
458Experimental458 {
459 459 key: "SESSION_ID",
460Details460 type: "uuid",
461 461 description:
462Run Codex itself as an MCP server over stdio. Useful when another agent consumes Codex.462 "Resume the specified session. Omit and use `--last` to continue the most recent session.",
463 463 },
464Key464 {
465 465 key: "--last",
466[`codex plugin marketplace`](https://developers.openai.com/codex/cli/reference#codex-plugin-marketplace)466 type: "boolean",
467 467 defaultValue: "false",
468Maturity468 description:
469 469 "Skip the picker and resume the most recent conversation from the current working directory.",
470Experimental470 },
471 471 {
472Details472 key: "--all",
473 473 type: "boolean",
474Add, upgrade, or remove plugin marketplaces from Git or local sources.474 defaultValue: "false",
475 475 description:
476Key476 "Include sessions outside the current working directory when selecting the most recent session.",
477 477 },
478[`codex resume`](https://developers.openai.com/codex/cli/reference#codex-resume)478];
479 479
480Maturity480export const featuresOptions = [
481 481 {
482Stable482 key: "List subcommand",
483 483 type: "codex features list",
484Details484 description:
485 485 "Show known feature flags, their maturity stage, and their effective state.",
486Continue a previous interactive session by ID or resume the most recent conversation.486 },
487 487 {
488Key488 key: "Enable subcommand",
489 489 type: "codex features enable <feature>",
490[`codex sandbox`](https://developers.openai.com/codex/cli/reference#codex-sandbox)490 description:
491 491 "Persistently enable a feature flag in `config.toml`. Respects the active `--profile` when provided.",
492Maturity492 },
493 493 {
494Experimental494 key: "Disable subcommand",
495 495 type: "codex features disable <feature>",
496Details496 description:
497 497 "Persistently disable a feature flag in `config.toml`. Respects the active `--profile` when provided.",
498Run arbitrary commands inside Codex-provided macOS, Linux, or Windows sandboxes.498 },
499 499];
500Key500
501 501export const execResumeOptions = [
502[`codex update`](https://developers.openai.com/codex/cli/reference#codex-update)502 {
503 503 key: "SESSION_ID",
504Maturity504 type: "uuid",
505 505 description:
506Stable506 "Resume the specified session. Omit and use `--last` to continue the most recent session.",
507 507 },
508Details508 {
509 509 key: "--last",
510Check for and apply a Codex CLI update when the installed release supports self-update.510 type: "boolean",
511 511 defaultValue: "false",
512Expand to view all512 description:
513 513 "Resume the most recent conversation from the current working directory.",
514## Command details514 },
515 515 {
516### `codex` (interactive)516 key: "--all",
517 517 type: "boolean",
518Running `codex` with no subcommand launches the interactive terminal UI (TUI). The agent accepts the global flags above plus image attachments. Web search defaults to cached mode; use `--search` to switch to live browsing. For low-friction local work, use `--sandbox workspace-write --ask-for-approval on-request`.518 defaultValue: "false",
519 519 description:
520Use `--remote ws://host:port` or `--remote wss://host:port` to connect the TUI to an app server started with `codex app-server --listen ws://IP:PORT`. Add `--remote-auth-token-env <ENV_VAR>` when the server requires a bearer token for WebSocket authentication. See [Codex CLI features](https://developers.openai.com/codex/cli/features#connect-the-tui-to-a-remote-app-server) for setup examples and authentication guidance.520 "Include sessions outside the current working directory when selecting the most recent session.",
521 521 },
522### `codex app-server`522 {
523 523 key: "--image, -i",
524Launch the Codex app server locally. This is primarily for development and debugging and may change without notice.524 type: "path[,path...]",
525 525 description:
526| Key | Type / Values | Details |526 "Attach one or more images to the follow-up prompt. Separate multiple paths with commas or repeat the flag.",
527| --- | --- | --- |527 },
528| `--listen` | `stdio:// | ws://IP:PORT` | Transport listener URL. Use `ws://IP:PORT` to expose a WebSocket endpoint for remote clients. |528 {
529| `--ws-audience` | `string` | Expected `aud` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`. |529 key: "PROMPT",
530| `--ws-auth` | `capability-token | signed-bearer-token` | Authentication mode for app-server WebSocket clients. If omitted, WebSocket auth is disabled; non-local listeners warn during startup. |530 type: "string | - (read stdin)",
531| `--ws-issuer` | `string` | Expected `iss` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`. |531 description:
532| `--ws-max-clock-skew-seconds` | `number` | Clock skew allowance when validating signed bearer token `exp` and `nbf` claims. Requires `--ws-auth signed-bearer-token`. |532 "Optional follow-up instruction sent immediately after resuming.",
533| `--ws-shared-secret-file` | `absolute path` | File containing the HMAC shared secret used to validate signed JWT bearer tokens. Required with `--ws-auth signed-bearer-token`. |533 },
534| `--ws-token-file` | `absolute path` | File containing the shared capability token. Required with `--ws-auth capability-token`. |534];
535 535
536Key536export const forkOptions = [
537 537 {
538`--listen`538 key: "SESSION_ID",
539 539 type: "uuid",
540Type / Values540 description:
541 541 "Fork the specified session. Omit and use `--last` to fork the most recent session.",
542`stdio:// | ws://IP:PORT`542 },
543 543 {
544Details544 key: "--last",
545 545 type: "boolean",
546Transport listener URL. Use `ws://IP:PORT` to expose a WebSocket endpoint for remote clients.546 defaultValue: "false",
547 547 description:
548Key548 "Skip the picker and fork the most recent conversation automatically.",
549 549 },
550`--ws-audience`550 {
551 551 key: "--all",
552Type / Values552 type: "boolean",
553 553 defaultValue: "false",
554`string`554 description:
555 555 "Show sessions beyond the current working directory in the picker.",
556Details556 },
557 557];
558Expected `aud` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`.558
559 559export const execpolicyOptions = [
560Key560 {
561 561 key: "--rules, -r",
562`--ws-auth`562 type: "path (repeatable)",
563 563 description:
564Type / Values564 "Path to an execpolicy rule file to evaluate. Provide multiple flags to combine rules across files.",
565 565 },
566`capability-token | signed-bearer-token`566 {
567 567 key: "--pretty",
568Details568 type: "boolean",
569 569 defaultValue: "false",
570Authentication mode for app-server WebSocket clients. If omitted, WebSocket auth is disabled; non-local listeners warn during startup.570 description: "Pretty-print the JSON result.",
571 571 },
572Key572 {
573 573 key: "COMMAND...",
574`--ws-issuer`574 type: "var-args",
575 575 description: "Command to be checked against the specified policies.",
576Type / Values576 },
577 577];
578`string`578
579 579export const loginOptions = [
580Details580 {
581 581 key: "--with-api-key",
582Expected `iss` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`.582 type: "boolean",
583 583 description:
584Key584 "Read an API key from stdin (for example `printenv OPENAI_API_KEY | codex login --with-api-key`).",
585 585 },
586`--ws-max-clock-skew-seconds`586 {
587 587 key: "--device-auth",
588Type / Values588 type: "boolean",
589 589 description:
590`number`590 "Use OAuth device code flow instead of launching a browser window.",
591 591 },
592Details592 {
593 593 key: "status subcommand",
594Clock skew allowance when validating signed bearer token `exp` and `nbf` claims. Requires `--ws-auth signed-bearer-token`.594 type: "codex login status",
595 595 description:
596Key596 "Print the active authentication mode and exit with 0 when logged in.",
597 597 },
598`--ws-shared-secret-file`598];
599 599
600Type / Values600export const applyOptions = [
601 601 {
602`absolute path`602 key: "TASK_ID",
603 603 type: "string",
604Details604 description:
605 605 "Identifier of the Codex Cloud task whose diff should be applied.",
606File containing the HMAC shared secret used to validate signed JWT bearer tokens. Required with `--ws-auth signed-bearer-token`.606 },
607 607];
608Key608
609 609export const sandboxMacOptions = [
610`--ws-token-file`610 {
611 611 key: "--permissions-profile",
612Type / Values612 type: "NAME",
613 613 description:
614`absolute path`614 "Apply a named permissions profile from the active configuration stack.",
615 615 },
616Details616 {
617 617 key: "--cd, -C",
618File containing the shared capability token. Required with `--ws-auth capability-token`.618 type: "DIR",
619 619 description:
620`codex app-server --listen stdio://` keeps the default JSONL-over-stdio behavior. `--listen ws://IP:PORT` enables WebSocket transport for app-server clients. The server accepts `ws://` listen URLs; use TLS termination or a secure proxy when clients connect with `wss://`. If you generate schemas for client bindings, add `--experimental` to include gated fields and methods.620 "Working directory used for profile resolution and command execution. Requires `--permissions-profile`.",
621 621 },
622### `codex app`622 {
623 623 key: "--include-managed-config",
624Launch Codex Desktop from the terminal on macOS or Windows. On macOS, Codex can open a specific workspace path; on Windows, Codex prints the path to open.624 type: "boolean",
625 625 defaultValue: "false",
626| Key | Type / Values | Details |626 description:
627| --- | --- | --- |627 "Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`.",
628| `--download-url` | `url` | Advanced override for the Codex desktop installer URL used during install. |628 },
629| `PATH` | `path` | Workspace path for Codex Desktop. On macOS, Codex opens this path; on Windows, Codex prints the path. |629 {
630 630 key: "--allow-unix-socket",
631Key631 type: "path",
632 632 description:
633`--download-url`633 "Allow the sandboxed command to bind or connect Unix sockets rooted at this path. Repeat to allow multiple paths.",
634 634 },
635Type / Values635 {
636 636 key: "--log-denials",
637`url`637 type: "boolean",
638 638 defaultValue: "false",
639Details639 description:
640 640 "Capture macOS sandbox denials with `log stream` while the command runs and print them after exit.",
641Advanced override for the Codex desktop installer URL used during install.641 },
642 642 {
643Key643 key: "--config, -c",
644 644 type: "key=value",
645`PATH`645 description:
646 646 "Pass configuration overrides into the sandboxed run (repeatable).",
647Type / Values647 },
648 648 {
649`path`649 key: "COMMAND...",
650 650 type: "var-args",
651Details651 description:
652 652 "Shell command to execute under macOS Seatbelt. Everything after `--` is forwarded.",
653Workspace path for Codex Desktop. On macOS, Codex opens this path; on Windows, Codex prints the path.653 },
654 654];
655`codex app` opens an installed Codex Desktop app, or starts the installer when655
656the app is missing. On macOS, Codex opens the provided workspace path; on656export const sandboxLinuxOptions = [
657Windows, it prints the path to open after installation.657 {
658 658 key: "--permissions-profile",
659### `codex debug app-server send-message-v2`659 type: "NAME",
660 660 description:
661Send one message through app-server's V2 thread/turn flow using the built-in app-server test client.661 "Apply a named permissions profile from the active configuration stack.",
662 662 },
663| Key | Type / Values | Details |663 {
664| --- | --- | --- |664 key: "--cd, -C",
665| `USER_MESSAGE` | `string` | Message text sent to app-server through the built-in V2 test-client flow. |665 type: "DIR",
666 666 description:
667Key667 "Working directory used for profile resolution and command execution. Requires `--permissions-profile`.",
668 668 },
669`USER_MESSAGE`669 {
670 670 key: "--include-managed-config",
671Type / Values671 type: "boolean",
672 672 defaultValue: "false",
673`string`673 description:
674 674 "Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`.",
675Details675 },
676 676 {
677Message text sent to app-server through the built-in V2 test-client flow.677 key: "--config, -c",
678 678 type: "key=value",
679This debug flow initializes with `experimentalApi: true`, starts a thread, sends a turn, and streams server notifications. Use it to reproduce and inspect app-server protocol behavior locally.679 description:
680 680 "Configuration overrides applied before launching the sandbox (repeatable).",
681### `codex debug models`681 },
682 682 {
683Print the raw model catalog Codex sees as JSON.683 key: "COMMAND...",
684 684 type: "var-args",
685| Key | Type / Values | Details |685 description:
686| --- | --- | --- |686 "Command to execute under Landlock + seccomp. Provide the executable after `--`.",
687| `--bundled` | `boolean` | Skip refresh and print only the model catalog bundled with the current Codex binary. |687 },
688 688];
689Key689
690 690export const sandboxWindowsOptions = [
691`--bundled`691 {
692 692 key: "--permissions-profile",
693Type / Values693 type: "NAME",
694 694 description:
695`boolean`695 "Apply a named permissions profile from the active configuration stack.",
696 696 },
697Details697 {
698 698 key: "--cd, -C",
699Skip refresh and print only the model catalog bundled with the current Codex binary.699 type: "DIR",
700 700 description:
701Use `--bundled` when you want to inspect only the catalog bundled with the current binary, without refreshing from the remote models endpoint.701 "Working directory used for profile resolution and command execution. Requires `--permissions-profile`.",
702 702 },
703### `codex apply`703 {
704 704 key: "--include-managed-config",
705Apply the most recent diff from a Codex cloud task to your local repository. You must authenticate and have access to the task.705 type: "boolean",
706 706 defaultValue: "false",
707| Key | Type / Values | Details |707 description:
708| --- | --- | --- |708 "Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`.",
709| `TASK_ID` | `string` | Identifier of the Codex Cloud task whose diff should be applied. |709 },
710 710 {
711Key711 key: "--config, -c",
712 712 type: "key=value",
713`TASK_ID`713 description:
714 714 "Configuration overrides applied before launching the sandbox (repeatable).",
715Type / Values715 },
716 716 {
717`string`717 key: "COMMAND...",
718 718 type: "var-args",
719Details719 description:
720 720 "Command to execute under the native Windows sandbox. Provide the executable after `--`.",
721Identifier of the Codex Cloud task whose diff should be applied.721 },
722 722];
723Codex prints the patched files and exits non-zero if `git apply` fails (for example, due to conflicts).723
724 724export const completionOptions = [
725### `codex cloud`725 {
726 726 key: "SHELL",
727Interact with Codex cloud tasks from the terminal. The default command opens an interactive picker; `codex cloud exec` submits a task directly, and `codex cloud list` returns recent tasks for scripting or quick inspection.727 type: "bash | zsh | fish | power-shell | elvish",
728 728 defaultValue: "bash",
729| Key | Type / Values | Details |729 description: "Shell to generate completions for. Output prints to stdout.",
730| --- | --- | --- |730 },
731| `--attempts` | `1-4` | Number of assistant attempts (best-of-N) Codex Cloud should run. |731];
732| `--env` | `ENV_ID` | Target Codex Cloud environment identifier (required). Use `codex cloud` to list options. |732
733| `QUERY` | `string` | Task prompt. If omitted, Codex prompts interactively for details. |733export const cloudExecOptions = [
734 734 {
735Key735 key: "QUERY",
736 736 type: "string",
737`--attempts`737 description:
738 738 "Task prompt. If omitted, Codex prompts interactively for details.",
739Type / Values739 },
740 740 {
741`1-4`741 key: "--env",
742 742 type: "ENV_ID",
743Details743 description:
744 744 "Target Codex Cloud environment identifier (required). Use `codex cloud` to list options.",
745Number of assistant attempts (best-of-N) Codex Cloud should run.745 },
746 746 {
747Key747 key: "--attempts",
748 748 type: "1-4",
749`--env`749 defaultValue: "1",
750 750 description:
751Type / Values751 "Number of assistant attempts (best-of-N) Codex Cloud should run.",
752 752 },
753`ENV_ID`753];
754 754
755Details755export const cloudListOptions = [
756 756 {
757Target Codex Cloud environment identifier (required). Use `codex cloud` to list options.757 key: "--env",
758 758 type: "ENV_ID",
759Key759 description: "Filter tasks by environment identifier.",
760 760 },
761`QUERY`761 {
762 762 key: "--limit",
763Type / Values763 type: "1-20",
764 764 defaultValue: "20",
765`string`765 description: "Maximum number of tasks to return.",
766 766 },
767Details767 {
768 768 key: "--cursor",
769Task prompt. If omitted, Codex prompts interactively for details.769 type: "string",
770 770 description: "Pagination cursor returned by a previous request.",
771Authentication follows the same credentials as the main CLI. Codex exits non-zero if the task submission fails.771 },
772 772 {
773#### `codex cloud list`773 key: "--json",
774 774 type: "boolean",
775List recent cloud tasks with optional filtering and pagination.775 defaultValue: "false",
776 776 description: "Emit machine-readable JSON instead of plain text.",
777| Key | Type / Values | Details |777 },
778| --- | --- | --- |778];
779| `--cursor` | `string` | Pagination cursor returned by a previous request. |779
780| `--env` | `ENV_ID` | Filter tasks by environment identifier. |780export const mcpCommands = [
781| `--json` | `boolean` | Emit machine-readable JSON instead of plain text. |781 {
782| `--limit` | `1-20` | Maximum number of tasks to return. |782 key: "list",
783 783 type: "--json",
784Key784 description:
785 785 "List configured MCP servers. Add `--json` for machine-readable output.",
786`--cursor`786 },
787 787 {
788Type / Values788 key: "get <name>",
789 789 type: "--json",
790`string`790 description:
791 791 "Show a specific server configuration. `--json` prints the raw config entry.",
792Details792 },
793 793 {
794Pagination cursor returned by a previous request.794 key: "add <name>",
795 795 type: "-- <command...> | --url <value>",
796Key796 description:
797 797 "Register a server using a stdio launcher command or a streamable HTTP URL. Supports `--env KEY=VALUE` for stdio transports.",
798`--env`798 },
799 799 {
800Type / Values800 key: "remove <name>",
801 801 description: "Delete a stored MCP server definition.",
802`ENV_ID`802 },
803 803 {
804Details804 key: "login <name>",
805 805 type: "--scopes scope1,scope2",
806Filter tasks by environment identifier.806 description:
807 807 "Start an OAuth login for a streamable HTTP server (servers that support OAuth only).",
808Key808 },
809 809 {
810`--json`810 key: "logout <name>",
811 811 description:
812Type / Values812 "Remove stored OAuth credentials for a streamable HTTP server.",
813 813 },
814`boolean`814];
815 815
816Details816export const mcpAddOptions = [
817 817 {
818Emit machine-readable JSON instead of plain text.818 key: "COMMAND...",
819 819 type: "stdio transport",
820Key820 description:
821 821 "Executable plus arguments to launch the MCP server. Provide after `--`.",
822`--limit`822 },
823 823 {
824Type / Values824 key: "--env KEY=VALUE",
825 825 type: "repeatable",
826`1-20`826 description:
827 827 "Environment variable assignments applied when launching a stdio server.",
828Details828 },
829 829 {
830Maximum number of tasks to return.830 key: "--url",
831 831 type: "https://…",
832Plain-text output prints a task URL followed by status details. Use `--json` for automation. The JSON payload contains a `tasks` array plus an optional `cursor` value. Each task includes `id`, `url`, `title`, `status`, `updated_at`, `environment_id`, `environment_label`, `summary`, `is_review`, and `attempt_total`.832 description:
833 833 "Register a streamable HTTP server instead of stdio. Mutually exclusive with `COMMAND...`.",
834### `codex completion`834 },
835 835 {
836Generate shell completion scripts and redirect the output to the appropriate location, for example `codex completion zsh > "${fpath[1]}/_codex"`.836 key: "--bearer-token-env-var",
837 837 type: "ENV_VAR",
838| Key | Type / Values | Details |838 description:
839| --- | --- | --- |839 "Environment variable whose value is sent as a bearer token when connecting to a streamable HTTP server.",
840| `SHELL` | `bash | zsh | fish | power-shell | elvish` | Shell to generate completions for. Output prints to stdout. |840 },
841 841];
842Key842
843 843export const marketplaceCommands = [
844`SHELL`844 {
845 845 key: "add <source>",
846Type / Values846 type: "[--ref REF] [--sparse PATH]",
847 847 description:
848`bash | zsh | fish | power-shell | elvish`848 "Install a plugin marketplace from GitHub shorthand, a Git URL, an SSH URL, or a local marketplace root directory. `--sparse` is supported only for Git sources and can be repeated.",
849 849 },
850Details850 {
851 851 key: "upgrade [marketplace-name]",
852Shell to generate completions for. Output prints to stdout.852 description:
853 853 "Refresh one configured Git marketplace, or all configured Git marketplaces when no name is provided.",
854### `codex features`854 },
855 855 {
856Manage feature flags stored in `~/.codex/config.toml`. The `enable` and `disable` commands persist changes so they apply to future sessions. When you launch with `--profile`, Codex writes to that profile instead of the root configuration.856 key: "remove <marketplace-name>",
857 857 description: "Remove a configured plugin marketplace.",
858| Key | Type / Values | Details |858 },
859| --- | --- | --- |859];
860| `Disable subcommand` | `codex features disable <feature>` | Persistently disable a feature flag in `config.toml`. Respects the active `--profile` when provided. |
861| `Enable subcommand` | `codex features enable <feature>` | Persistently enable a feature flag in `config.toml`. Respects the active `--profile` when provided. |
862| `List subcommand` | `codex features list` | Show known feature flags, their maturity stage, and their effective state. |
863
864Key
865
866`Disable subcommand`
867
868Type / Values
869
870`codex features disable <feature>`
871
872Details
873
874Persistently disable a feature flag in `config.toml`. Respects the active `--profile` when provided.
875
876Key
877
878`Enable subcommand`
879
880Type / Values
881
882`codex features enable <feature>`
883
884Details
885
886Persistently enable a feature flag in `config.toml`. Respects the active `--profile` when provided.
887
888Key
889
890`List subcommand`
891
892Type / Values
893
894`codex features list`
895
896Details
897
898Show known feature flags, their maturity stage, and their effective state.
899
900### `codex exec`
901
902Use `codex exec` (or the short form `codex e`) for scripted or CI-style runs that should finish without human interaction.
903
904| Key | Type / Values | Details |
905| --- | --- | --- |
906| `--cd, -C` | `path` | Set the workspace root before executing the task. |
907| `--color` | `always | never | auto` | Control ANSI color in stdout. |
908| `--dangerously-bypass-approvals-and-sandbox, --yolo` | `boolean` | Bypass approval prompts and sandboxing. Dangerous—only use inside an isolated runner. |
909| `--ephemeral` | `boolean` | Run without persisting session rollout files to disk. |
910| `--full-auto` | `boolean` | Deprecated compatibility flag. Prefer `--sandbox workspace-write`; Codex prints a warning when this flag is used. |
911| `--ignore-rules` | `boolean` | Do not load user or project execpolicy `.rules` files for this run. |
912| `--ignore-user-config` | `boolean` | Do not load `$CODEX_HOME/config.toml`. Authentication still uses `CODEX_HOME`. |
913| `--image, -i` | `path[,path...]` | Attach images to the first message. Repeatable; supports comma-separated lists. |
914| `--json, --experimental-json` | `boolean` | Print newline-delimited JSON events instead of formatted text. |
915| `--model, -m` | `string` | Override the configured model for this run. |
916| `--oss` | `boolean` | Use the local open source provider (requires a running Ollama instance). |
917| `--output-last-message, -o` | `path` | Write the assistant’s final message to a file. Useful for downstream scripting. |
918| `--output-schema` | `path` | JSON Schema file describing the expected final response shape. Codex validates tool output against it. |
919| `--profile, -p` | `string` | Select a configuration profile defined in config.toml. |
920| `--sandbox, -s` | `read-only | workspace-write | danger-full-access` | Sandbox policy for model-generated commands. Defaults to configuration. |
921| `--skip-git-repo-check` | `boolean` | Allow running outside a Git repository (useful for one-off directories). |
922| `-c, --config` | `key=value` | Inline configuration override for the non-interactive run (repeatable). |
923| `PROMPT` | `string | - (read stdin)` | Initial instruction for the task. Use `-` to pipe the prompt from stdin. |
924| `Resume subcommand` | `codex exec resume [SESSION_ID]` | Resume an exec session by ID or add `--last` to continue the most recent session from the current working directory. Add `--all` to consider sessions from any directory. Accepts an optional follow-up prompt. |
925
926Key
927
928`--cd, -C`
929
930Type / Values
931
932`path`
933
934Details
935
936Set the workspace root before executing the task.
937
938Key
939
940`--color`
941
942Type / Values
943
944`always | never | auto`
945
946Details
947
948Control ANSI color in stdout.
949
950Key
951
952`--dangerously-bypass-approvals-and-sandbox, --yolo`
953
954Type / Values
955
956`boolean`
957
958Details
959
960Bypass approval prompts and sandboxing. Dangerous—only use inside an isolated runner.
961
962Key
963
964`--ephemeral`
965
966Type / Values
967
968`boolean`
969
970Details
971
972Run without persisting session rollout files to disk.
973
974Key
975
976`--full-auto`
977
978Type / Values
979
980`boolean`
981
982Details
983
984Deprecated compatibility flag. Prefer `--sandbox workspace-write`; Codex prints a warning when this flag is used.
985
986Key
987
988`--ignore-rules`
989
990Type / Values
991
992`boolean`
993
994Details
995
996Do not load user or project execpolicy `.rules` files for this run.
997
998Key
999
1000`--ignore-user-config`
1001
1002Type / Values
1003
1004`boolean`
1005
1006Details
1007
1008Do not load `$CODEX_HOME/config.toml`. Authentication still uses `CODEX_HOME`.
1009
1010Key
1011
1012`--image, -i`
1013
1014Type / Values
1015
1016`path[,path...]`
1017
1018Details
1019
1020Attach images to the first message. Repeatable; supports comma-separated lists.
1021
1022Key
1023
1024`--json, --experimental-json`
1025
1026Type / Values
1027
1028`boolean`
1029
1030Details
1031
1032Print newline-delimited JSON events instead of formatted text.
1033
1034Key
1035
1036`--model, -m`
1037
1038Type / Values
1039
1040`string`
1041
1042Details
1043
1044Override the configured model for this run.
1045
1046Key
1047
1048`--oss`
1049
1050Type / Values
1051
1052`boolean`
1053
1054Details
1055
1056Use the local open source provider (requires a running Ollama instance).
1057
1058Key
1059
1060`--output-last-message, -o`
1061
1062Type / Values
1063
1064`path`
1065
1066Details
1067
1068Write the assistant’s final message to a file. Useful for downstream scripting.
1069
1070Key
1071
1072`--output-schema`
1073
1074Type / Values
1075
1076`path`
1077
1078Details
1079
1080JSON Schema file describing the expected final response shape. Codex validates tool output against it.
1081
1082Key
1083
1084`--profile, -p`
1085
1086Type / Values
1087
1088`string`
1089
1090Details
1091
1092Select a configuration profile defined in config.toml.
1093
1094Key
1095
1096`--sandbox, -s`
1097
1098Type / Values
1099
1100`read-only | workspace-write | danger-full-access`
1101
1102Details
1103
1104Sandbox policy for model-generated commands. Defaults to configuration.
1105
1106Key
1107
1108`--skip-git-repo-check`
1109
1110Type / Values
1111
1112`boolean`
1113
1114Details
1115
1116Allow running outside a Git repository (useful for one-off directories).
1117
1118Key
1119
1120`-c, --config`
1121
1122Type / Values
1123
1124`key=value`
1125
1126Details
1127
1128Inline configuration override for the non-interactive run (repeatable).
1129
1130Key
1131
1132`PROMPT`
1133
1134Type / Values
1135
1136`string | - (read stdin)`
1137
1138Details
1139
1140Initial instruction for the task. Use `-` to pipe the prompt from stdin.
1141
1142Key
1143
1144`Resume subcommand`
1145
1146Type / Values
1147
1148`codex exec resume [SESSION_ID]`
1149
1150Details
1151
1152Resume an exec session by ID or add `--last` to continue the most recent session from the current working directory. Add `--all` to consider sessions from any directory. Accepts an optional follow-up prompt.
1153
1154Expand to view all
1155
1156Codex writes formatted output by default. Add `--json` to receive newline-delimited JSON events (one per state change). The optional `resume` subcommand lets you continue non-interactive tasks. Use `--last` to pick the most recent session from the current working directory, or add `--all` to search across all sessions:
1157
1158| Key | Type / Values | Details |
1159| --- | --- | --- |
1160| `--all` | `boolean` | Include sessions outside the current working directory when selecting the most recent session. |
1161| `--image, -i` | `path[,path...]` | Attach one or more images to the follow-up prompt. Separate multiple paths with commas or repeat the flag. |
1162| `--last` | `boolean` | Resume the most recent conversation from the current working directory. |
1163| `PROMPT` | `string | - (read stdin)` | Optional follow-up instruction sent immediately after resuming. |
1164| `SESSION_ID` | `uuid` | Resume the specified session. Omit and use `--last` to continue the most recent session. |
1165
1166Key
1167
1168`--all`
1169
1170Type / Values
1171
1172`boolean`
1173
1174Details
1175
1176Include sessions outside the current working directory when selecting the most recent session.
1177
1178Key
1179
1180`--image, -i`
1181
1182Type / Values
1183
1184`path[,path...]`
1185
1186Details
1187
1188Attach one or more images to the follow-up prompt. Separate multiple paths with commas or repeat the flag.
1189
1190Key
1191
1192`--last`
1193
1194Type / Values
1195
1196`boolean`
1197
1198Details
1199
1200Resume the most recent conversation from the current working directory.
1201
1202Key
1203
1204`PROMPT`
1205
1206Type / Values
1207
1208`string | - (read stdin)`
1209
1210Details
1211
1212Optional follow-up instruction sent immediately after resuming.
1213
1214Key
1215
1216`SESSION_ID`
1217
1218Type / Values
1219
1220`uuid`
1221
1222Details
1223
1224Resume the specified session. Omit and use `--last` to continue the most recent session.
1225
1226### `codex execpolicy`
1227 860
1228Check `execpolicy` rule files before you save them. `codex execpolicy check` accepts one or more `--rules` flags (for example, files under `~/.codex/rules`) and emits JSON showing the strictest decision and any matching rules. Add `--pretty` to format the output. The `execpolicy` command is currently in preview.861## How to read this reference
1229
1230| Key | Type / Values | Details |
1231| --- | --- | --- |
1232| `--pretty` | `boolean` | Pretty-print the JSON result. |
1233| `--rules, -r` | `path (repeatable)` | Path to an execpolicy rule file to evaluate. Provide multiple flags to combine rules across files. |
1234| `COMMAND...` | `var-args` | Command to be checked against the specified policies. |
1235
1236Key
1237
1238`--pretty`
1239
1240Type / Values
1241
1242`boolean`
1243
1244Details
1245
1246Pretty-print the JSON result.
1247
1248Key
1249
1250`--rules, -r`
1251
1252Type / Values
1253
1254`path (repeatable)`
1255
1256Details
1257
1258Path to an execpolicy rule file to evaluate. Provide multiple flags to combine rules across files.
1259
1260Key
1261
1262`COMMAND...`
1263 862
1264Type / Values863This page catalogs every documented Codex CLI command and flag. Use the interactive tables to search by key or description. Each section indicates whether the option is stable or experimental and calls out risky combinations.
1265 864
1266`var-args`865The CLI inherits most defaults from <code>~/.codex/config.toml</code>. Any
866 <code>-c key=value</code> overrides you pass at the command line take
867 precedence for that invocation. See [Config
868 basics](https://developers.openai.com/codex/config-basic#configuration-precedence) for more information.
1267 869
1268Details870## Global flags
1269 871
1270Command to be checked against the specified policies.872<ConfigTable client:load options={globalFlagOptions} />
1271 873
1272### `codex login`874These options apply to the base `codex` command and propagate to each subcommand unless a section below specifies otherwise.
875When you run a subcommand, place global flags after it (for example, `codex exec --oss ...`) so Codex applies them as intended.
1273 876
1274Authenticate the CLI with a ChatGPT account or API key. With no flags, Codex opens a browser for the ChatGPT OAuth flow.877## Command overview
1275 878
1276| Key | Type / Values | Details |879The Maturity column uses feature maturity labels such as Experimental, Beta,
1277| --- | --- | --- |880 and Stable. See [Feature Maturity](https://developers.openai.com/codex/feature-maturity) for how to
1278| `--device-auth` | `boolean` | Use OAuth device code flow instead of launching a browser window. |881 interpret these labels.
1279| `--with-api-key` | `boolean` | Read an API key from stdin (for example `printenv OPENAI_API_KEY | codex login --with-api-key`). |
1280| `status subcommand` | `codex login status` | Print the active authentication mode and exit with 0 when logged in. |
1281 882
1282Key883<ConfigTable
884 client:load
885 options={commandOverview}
886 secondColumnTitle="Maturity"
887 secondColumnVariant="maturity"
888/>
1283 889
1284`--device-auth`890## Command details
1285 891
1286Type / Values892### `codex` (interactive)
1287 893
1288`boolean`894Running `codex` with no subcommand launches the interactive terminal UI (TUI). The agent accepts the global flags above plus image attachments. Web search defaults to cached mode; use `--search` to switch to live browsing. For low-friction local work, use `--sandbox workspace-write --ask-for-approval on-request`.
1289 895
1290Details896Use `--remote ws://host:port` or `--remote wss://host:port` to connect the TUI to an app server started with `codex app-server --listen ws://IP:PORT`. Add `--remote-auth-token-env <ENV_VAR>` when the server requires a bearer token for WebSocket authentication. See [Codex CLI features](https://developers.openai.com/codex/cli/features#connect-the-tui-to-a-remote-app-server) for setup examples and authentication guidance.
1291 897
1292Use OAuth device code flow instead of launching a browser window.898### `codex app-server`
1293 899
1294Key900Launch the Codex app server locally. This is primarily for development and debugging and may change without notice.
1295 901
1296`--with-api-key`902<ConfigTable client:load options={appServerOptions} />
1297 903
1298Type / Values904`codex app-server --listen stdio://` keeps the default JSONL-over-stdio behavior. `--listen ws://IP:PORT` enables WebSocket transport for app-server clients. The server accepts `ws://` listen URLs; use TLS termination or a secure proxy when clients connect with `wss://`. If you generate schemas for client bindings, add `--experimental` to include gated fields and methods.
1299 905
1300`boolean`906### `codex app`
1301 907
1302Details908Launch Codex Desktop from the terminal on macOS or Windows. On macOS, Codex can open a specific workspace path; on Windows, Codex prints the path to open.
1303 909
1304Read an API key from stdin (for example `printenv OPENAI_API_KEY | codex login --with-api-key`).910<ConfigTable client:load options={appOptions} />
1305 911
1306Key912`codex app` opens an installed Codex Desktop app, or starts the installer when
913the app is missing. On macOS, Codex opens the provided workspace path; on
914Windows, it prints the path to open after installation.
1307 915
1308`status subcommand`916### `codex debug app-server send-message-v2`
1309 917
1310Type / Values918Send one message through app-server's V2 thread/turn flow using the built-in app-server test client.
1311 919
1312`codex login status`920<ConfigTable client:load options={debugAppServerSendMessageV2Options} />
1313 921
1314Details922This debug flow initializes with `experimentalApi: true`, starts a thread, sends a turn, and streams server notifications. Use it to reproduce and inspect app-server protocol behavior locally.
1315 923
1316Print the active authentication mode and exit with 0 when logged in.924### `codex debug models`
1317 925
1318`codex login status` exits with `0` when credentials are present, which is helpful in automation scripts.926Print the raw model catalog Codex sees as JSON.
1319 927
1320### `codex logout`928<ConfigTable client:load options={debugModelsOptions} />
1321 929
1322Remove saved credentials for both API key and ChatGPT authentication. This command has no flags.930Use `--bundled` when you want to inspect only the catalog bundled with the current binary, without refreshing from the remote models endpoint.
1323 931
1324### `codex mcp`932### `codex apply`
1325 933
1326Manage Model Context Protocol server entries stored in `~/.codex/config.toml`.934Apply the most recent diff from a Codex cloud task to your local repository. You must authenticate and have access to the task.
1327 935
1328| Key | Type / Values | Details |936<ConfigTable client:load options={applyOptions} />
1329| --- | --- | --- |
1330| `add <name>` | `-- <command...> | --url <value>` | Register a server using a stdio launcher command or a streamable HTTP URL. Supports `--env KEY=VALUE` for stdio transports. |
1331| `get <name>` | `--json` | Show a specific server configuration. `--json` prints the raw config entry. |
1332| `list` | `--json` | List configured MCP servers. Add `--json` for machine-readable output. |
1333| `login <name>` | `--scopes scope1,scope2` | Start an OAuth login for a streamable HTTP server (servers that support OAuth only). |
1334| `logout <name>` | | Remove stored OAuth credentials for a streamable HTTP server. |
1335| `remove <name>` | | Delete a stored MCP server definition. |
1336 937
1337Key938Codex prints the patched files and exits non-zero if `git apply` fails (for example, due to conflicts).
1338 939
1339`add <name>`940### `codex cloud`
1340 941
1341Type / Values942Interact with Codex cloud tasks from the terminal. The default command opens an interactive picker; `codex cloud exec` submits a task directly, and `codex cloud list` returns recent tasks for scripting or quick inspection.
1342 943
1343`-- <command...> | --url <value>`944<ConfigTable client:load options={cloudExecOptions} />
1344 945
1345Details946Authentication follows the same credentials as the main CLI. Codex exits non-zero if the task submission fails.
1346 947
1347Register a server using a stdio launcher command or a streamable HTTP URL. Supports `--env KEY=VALUE` for stdio transports.948#### `codex cloud list`
1348 949
1349Key950List recent cloud tasks with optional filtering and pagination.
1350 951
1351`get <name>`952<ConfigTable client:load options={cloudListOptions} />
1352 953
1353Type / Values954Plain-text output prints a task URL followed by status details. Use `--json` for automation. The JSON payload contains a `tasks` array plus an optional `cursor` value. Each task includes `id`, `url`, `title`, `status`, `updated_at`, `environment_id`, `environment_label`, `summary`, `is_review`, and `attempt_total`.
1354 955
1355`--json`956### `codex completion`
1356 957
1357Details958Generate shell completion scripts and redirect the output to the appropriate location, for example `codex completion zsh > "${fpath[1]}/_codex"`.
1358 959
1359Show a specific server configuration. `--json` prints the raw config entry.960<ConfigTable client:load options={completionOptions} />
1360 961
1361Key962### `codex features`
1362 963
1363`list`964Manage feature flags stored in `~/.codex/config.toml`. The `enable` and `disable` commands persist changes so they apply to future sessions. When you launch with `--profile`, Codex writes to that profile instead of the root configuration.
1364 965
1365Type / Values966<ConfigTable client:load options={featuresOptions} />
1366 967
1367`--json`968### `codex exec`
1368 969
1369Details970Use `codex exec` (or the short form `codex e`) for scripted or CI-style runs that should finish without human interaction.
1370 971
1371List configured MCP servers. Add `--json` for machine-readable output.972<ConfigTable client:load options={execOptions} />
1372 973
1373Key974Codex writes formatted output by default. Add `--json` to receive newline-delimited JSON events (one per state change). The optional `resume` subcommand lets you continue non-interactive tasks. Use `--last` to pick the most recent session from the current working directory, or add `--all` to search across all sessions:
1374 975
1375`login <name>`976<ConfigTable client:load options={execResumeOptions} />
1376 977
1377Type / Values978### `codex execpolicy`
1378 979
1379`--scopes scope1,scope2`980Check `execpolicy` rule files before you save them. `codex execpolicy check` accepts one or more `--rules` flags (for example, files under `~/.codex/rules`) and emits JSON showing the strictest decision and any matching rules. Add `--pretty` to format the output. The `execpolicy` command is currently in preview.
1380 981
1381Details982<ConfigTable client:load options={execpolicyOptions} />
1382 983
1383Start an OAuth login for a streamable HTTP server (servers that support OAuth only).984### `codex login`
1384 985
1385Key986Authenticate the CLI with a ChatGPT account or API key. With no flags, Codex opens a browser for the ChatGPT OAuth flow.
1386 987
1387`logout <name>`988<ConfigTable client:load options={loginOptions} />
1388 989
1389Details990`codex login status` exits with `0` when credentials are present, which is helpful in automation scripts.
1390 991
1391Remove stored OAuth credentials for a streamable HTTP server.992### `codex logout`
1392 993
1393Key994Remove saved credentials for both API key and ChatGPT authentication. This command has no flags.
1394 995
1395`remove <name>`996### `codex mcp`
1396 997
1397Details998Manage Model Context Protocol server entries stored in `~/.codex/config.toml`.
1398 999
1399Delete a stored MCP server definition.1000<ConfigTable client:load options={mcpCommands} />
1400 1001
1401The `add` subcommand supports both stdio and streamable HTTP transports:1002The `add` subcommand supports both stdio and streamable HTTP transports:
1402 1003
1403| Key | Type / Values | Details |1004<ConfigTable client:load options={mcpAddOptions} />
1404| --- | --- | --- |
1405| `--bearer-token-env-var` | `ENV_VAR` | Environment variable whose value is sent as a bearer token when connecting to a streamable HTTP server. |
1406| `--env KEY=VALUE` | `repeatable` | Environment variable assignments applied when launching a stdio server. |
1407| `--url` | `https://…` | Register a streamable HTTP server instead of stdio. Mutually exclusive with `COMMAND...`. |
1408| `COMMAND...` | `stdio transport` | Executable plus arguments to launch the MCP server. Provide after `--`. |
1409
1410Key
1411
1412`--bearer-token-env-var`
1413
1414Type / Values
1415
1416`ENV_VAR`
1417
1418Details
1419
1420Environment variable whose value is sent as a bearer token when connecting to a streamable HTTP server.
1421
1422Key
1423
1424`--env KEY=VALUE`
1425
1426Type / Values
1427
1428`repeatable`
1429
1430Details
1431
1432Environment variable assignments applied when launching a stdio server.
1433
1434Key
1435
1436`--url`
1437
1438Type / Values
1439
1440`https://…`
1441
1442Details
1443
1444Register a streamable HTTP server instead of stdio. Mutually exclusive with `COMMAND...`.
1445
1446Key
1447
1448`COMMAND...`
1449
1450Type / Values
1451
1452`stdio transport`
1453
1454Details
1455
1456Executable plus arguments to launch the MCP server. Provide after `--`.
1457 1005
1458OAuth actions (`login`, `logout`) only work with streamable HTTP servers (and only when the server supports OAuth).1006OAuth actions (`login`, `logout`) only work with streamable HTTP servers (and only when the server supports OAuth).
1459 1007
1461 1009
1462Manage plugin marketplace sources that Codex can browse and install from.1010Manage plugin marketplace sources that Codex can browse and install from.
1463 1011
1464| Key | Type / Values | Details |1012<ConfigTable client:load options={marketplaceCommands} />
1465| --- | --- | --- |
1466| `add <source>` | `[--ref REF] [--sparse PATH]` | Install a plugin marketplace from GitHub shorthand, a Git URL, an SSH URL, or a local marketplace root directory. `--sparse` is supported only for Git sources and can be repeated. |
1467| `remove <marketplace-name>` | | Remove a configured plugin marketplace. |
1468| `upgrade [marketplace-name]` | | Refresh one configured Git marketplace, or all configured Git marketplaces when no name is provided. |
1469
1470Key
1471
1472`add <source>`
1473
1474Type / Values
1475
1476`[--ref REF] [--sparse PATH]`
1477
1478Details
1479
1480Install a plugin marketplace from GitHub shorthand, a Git URL, an SSH URL, or a local marketplace root directory. `--sparse` is supported only for Git sources and can be repeated.
1481
1482Key
1483
1484`remove <marketplace-name>`
1485
1486Details
1487
1488Remove a configured plugin marketplace.
1489
1490Key
1491
1492`upgrade [marketplace-name]`
1493
1494Details
1495
1496Refresh one configured Git marketplace, or all configured Git marketplaces when no name is provided.
1497 1013
1498`codex plugin marketplace add` accepts GitHub shorthand such as `owner/repo` or1014`codex plugin marketplace add` accepts GitHub shorthand such as `owner/repo` or
1499`owner/repo@ref`, HTTP or HTTPS Git URLs, SSH Git URLs, and local marketplace1015`owner/repo@ref`, HTTP or HTTPS Git URLs, SSH Git URLs, and local marketplace
1508 1024
1509Continue an interactive session by ID or resume the most recent conversation. `codex resume` scopes `--last` to the current working directory unless you pass `--all`. It accepts the same global flags as `codex`, including model and sandbox overrides.1025Continue an interactive session by ID or resume the most recent conversation. `codex resume` scopes `--last` to the current working directory unless you pass `--all`. It accepts the same global flags as `codex`, including model and sandbox overrides.
1510 1026
1511| Key | Type / Values | Details |1027<ConfigTable client:load options={resumeOptions} />
1512| --- | --- | --- |
1513| `--all` | `boolean` | Include sessions outside the current working directory when selecting the most recent session. |
1514| `--last` | `boolean` | Skip the picker and resume the most recent conversation from the current working directory. |
1515| `SESSION_ID` | `uuid` | Resume the specified session. Omit and use `--last` to continue the most recent session. |
1516
1517Key
1518
1519`--all`
1520
1521Type / Values
1522
1523`boolean`
1524
1525Details
1526
1527Include sessions outside the current working directory when selecting the most recent session.
1528
1529Key
1530
1531`--last`
1532
1533Type / Values
1534
1535`boolean`
1536
1537Details
1538
1539Skip the picker and resume the most recent conversation from the current working directory.
1540
1541Key
1542
1543`SESSION_ID`
1544
1545Type / Values
1546
1547`uuid`
1548
1549Details
1550
1551Resume the specified session. Omit and use `--last` to continue the most recent session.
1552 1028
1553### `codex fork`1029### `codex fork`
1554 1030
1555Fork a previous interactive session into a new thread. By default, `codex fork` opens the session picker; add `--last` to fork your most recent session instead.1031Fork a previous interactive session into a new thread. By default, `codex fork` opens the session picker; add `--last` to fork your most recent session instead.
1556 1032
1557| Key | Type / Values | Details |1033<ConfigTable client:load options={forkOptions} />
1558| --- | --- | --- |
1559| `--all` | `boolean` | Show sessions beyond the current working directory in the picker. |
1560| `--last` | `boolean` | Skip the picker and fork the most recent conversation automatically. |
1561| `SESSION_ID` | `uuid` | Fork the specified session. Omit and use `--last` to fork the most recent session. |
1562
1563Key
1564
1565`--all`
1566
1567Type / Values
1568
1569`boolean`
1570
1571Details
1572
1573Show sessions beyond the current working directory in the picker.
1574
1575Key
1576
1577`--last`
1578
1579Type / Values
1580
1581`boolean`
1582
1583Details
1584
1585Skip the picker and fork the most recent conversation automatically.
1586
1587Key
1588
1589`SESSION_ID`
1590
1591Type / Values
1592
1593`uuid`
1594
1595Details
1596
1597Fork the specified session. Omit and use `--last` to fork the most recent session.
1598 1034
1599### `codex sandbox`1035### `codex sandbox`
1600 1036
1602 1038
1603#### macOS seatbelt1039#### macOS seatbelt
1604 1040
1605| Key | Type / Values | Details |1041<ConfigTable client:load options={sandboxMacOptions} />
1606| --- | --- | --- |
1607| `--allow-unix-socket` | `path` | Allow the sandboxed command to bind or connect Unix sockets rooted at this path. Repeat to allow multiple paths. |
1608| `--cd, -C` | `DIR` | Working directory used for profile resolution and command execution. Requires `--permissions-profile`. |
1609| `--config, -c` | `key=value` | Pass configuration overrides into the sandboxed run (repeatable). |
1610| `--include-managed-config` | `boolean` | Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`. |
1611| `--log-denials` | `boolean` | Capture macOS sandbox denials with `log stream` while the command runs and print them after exit. |
1612| `--permissions-profile` | `NAME` | Apply a named permissions profile from the active configuration stack. |
1613| `COMMAND...` | `var-args` | Shell command to execute under macOS Seatbelt. Everything after `--` is forwarded. |
1614
1615Key
1616
1617`--allow-unix-socket`
1618
1619Type / Values
1620
1621`path`
1622
1623Details
1624
1625Allow the sandboxed command to bind or connect Unix sockets rooted at this path. Repeat to allow multiple paths.
1626
1627Key
1628
1629`--cd, -C`
1630
1631Type / Values
1632
1633`DIR`
1634
1635Details
1636
1637Working directory used for profile resolution and command execution. Requires `--permissions-profile`.
1638
1639Key
1640
1641`--config, -c`
1642
1643Type / Values
1644
1645`key=value`
1646
1647Details
1648
1649Pass configuration overrides into the sandboxed run (repeatable).
1650
1651Key
1652
1653`--include-managed-config`
1654
1655Type / Values
1656
1657`boolean`
1658
1659Details
1660
1661Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`.
1662
1663Key
1664
1665`--log-denials`
1666
1667Type / Values
1668
1669`boolean`
1670
1671Details
1672
1673Capture macOS sandbox denials with `log stream` while the command runs and print them after exit.
1674
1675Key
1676
1677`--permissions-profile`
1678
1679Type / Values
1680
1681`NAME`
1682
1683Details
1684
1685Apply a named permissions profile from the active configuration stack.
1686
1687Key
1688
1689`COMMAND...`
1690
1691Type / Values
1692
1693`var-args`
1694
1695Details
1696
1697Shell command to execute under macOS Seatbelt. Everything after `--` is forwarded.
1698 1042
1699#### Linux Landlock1043#### Linux Landlock
1700 1044
1701| Key | Type / Values | Details |1045<ConfigTable client:load options={sandboxLinuxOptions} />
1702| --- | --- | --- |
1703| `--cd, -C` | `DIR` | Working directory used for profile resolution and command execution. Requires `--permissions-profile`. |
1704| `--config, -c` | `key=value` | Configuration overrides applied before launching the sandbox (repeatable). |
1705| `--include-managed-config` | `boolean` | Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`. |
1706| `--permissions-profile` | `NAME` | Apply a named permissions profile from the active configuration stack. |
1707| `COMMAND...` | `var-args` | Command to execute under Landlock + seccomp. Provide the executable after `--`. |
1708
1709Key
1710
1711`--cd, -C`
1712
1713Type / Values
1714
1715`DIR`
1716
1717Details
1718
1719Working directory used for profile resolution and command execution. Requires `--permissions-profile`.
1720
1721Key
1722
1723`--config, -c`
1724
1725Type / Values
1726
1727`key=value`
1728
1729Details
1730
1731Configuration overrides applied before launching the sandbox (repeatable).
1732
1733Key
1734
1735`--include-managed-config`
1736
1737Type / Values
1738
1739`boolean`
1740
1741Details
1742
1743Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`.
1744
1745Key
1746
1747`--permissions-profile`
1748
1749Type / Values
1750
1751`NAME`
1752
1753Details
1754
1755Apply a named permissions profile from the active configuration stack.
1756
1757Key
1758
1759`COMMAND...`
1760
1761Type / Values
1762
1763`var-args`
1764
1765Details
1766
1767Command to execute under Landlock + seccomp. Provide the executable after `--`.
1768 1046
1769#### Windows1047#### Windows
1770 1048
1771| Key | Type / Values | Details |1049<ConfigTable client:load options={sandboxWindowsOptions} />
1772| --- | --- | --- |
1773| `--cd, -C` | `DIR` | Working directory used for profile resolution and command execution. Requires `--permissions-profile`. |
1774| `--config, -c` | `key=value` | Configuration overrides applied before launching the sandbox (repeatable). |
1775| `--include-managed-config` | `boolean` | Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`. |
1776| `--permissions-profile` | `NAME` | Apply a named permissions profile from the active configuration stack. |
1777| `COMMAND...` | `var-args` | Command to execute under the native Windows sandbox. Provide the executable after `--`. |
1778
1779Key
1780
1781`--cd, -C`
1782
1783Type / Values
1784
1785`DIR`
1786
1787Details
1788
1789Working directory used for profile resolution and command execution. Requires `--permissions-profile`.
1790
1791Key
1792
1793`--config, -c`
1794
1795Type / Values
1796
1797`key=value`
1798
1799Details
1800
1801Configuration overrides applied before launching the sandbox (repeatable).
1802
1803Key
1804
1805`--include-managed-config`
1806
1807Type / Values
1808
1809`boolean`
1810
1811Details
1812
1813Include managed requirements while resolving an explicit permissions profile. Requires `--permissions-profile`.
1814
1815Key
1816
1817`--permissions-profile`
1818
1819Type / Values
1820
1821`NAME`
1822
1823Details
1824
1825Apply a named permissions profile from the active configuration stack.
1826
1827Key
1828
1829`COMMAND...`
1830
1831Type / Values
1832
1833`var-args`
1834
1835Details
1836
1837Command to execute under the native Windows sandbox. Provide the executable after `--`.
1838 1050
1839### `codex update`1051### `codex update`
1840 1052