@openai/codex 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,65 +5,11 @@
5
5
  <p align="center"><strong>Codex CLI</strong> is a coding agent from OpenAI that runs locally on your computer.</br>If you are looking for the <em>cloud-based agent</em> from OpenAI, <strong>Codex Web</strong>, see <a href="https://chatgpt.com/codex">chatgpt.com/codex</a>.</p>
6
6
 
7
7
  <p align="center">
8
- <img src="./.github/codex-cli-splash.png" alt="Codex CLI splash" width="50%" />
8
+ <img src="./.github/codex-cli-splash.png" alt="Codex CLI splash" width="80%" />
9
9
  </p>
10
10
 
11
11
  ---
12
12
 
13
- <details>
14
- <summary><strong>Table of contents</strong></summary>
15
-
16
- <!-- Begin ToC -->
17
-
18
- - [Quickstart](#quickstart)
19
- - [Installing and running Codex CLI](#installing-and-running-codex-cli)
20
- - [Using Codex with your ChatGPT plan](#using-codex-with-your-chatgpt-plan)
21
- - [Connecting on a "Headless" Machine](#connecting-on-a-headless-machine)
22
- - [Authenticate locally and copy your credentials to the "headless" machine](#authenticate-locally-and-copy-your-credentials-to-the-headless-machine)
23
- - [Connecting through VPS or remote](#connecting-through-vps-or-remote)
24
- - [Usage-based billing alternative: Use an OpenAI API key](#usage-based-billing-alternative-use-an-openai-api-key)
25
- - [Forcing a specific auth method (advanced)](#forcing-a-specific-auth-method-advanced)
26
- - [Choosing Codex's level of autonomy](#choosing-codexs-level-of-autonomy)
27
- - [**1. Read/write**](#1-readwrite)
28
- - [**2. Read-only**](#2-read-only)
29
- - [**3. Advanced configuration**](#3-advanced-configuration)
30
- - [Can I run without ANY approvals?](#can-i-run-without-any-approvals)
31
- - [Fine-tuning in `config.toml`](#fine-tuning-in-configtoml)
32
- - [Example prompts](#example-prompts)
33
- - [Running with a prompt as input](#running-with-a-prompt-as-input)
34
- - [Using Open Source Models](#using-open-source-models)
35
- - [Platform sandboxing details](#platform-sandboxing-details)
36
- - [Experimental technology disclaimer](#experimental-technology-disclaimer)
37
- - [System requirements](#system-requirements)
38
- - [CLI reference](#cli-reference)
39
- - [Memory & project docs](#memory--project-docs)
40
- - [Non-interactive / CI mode](#non-interactive--ci-mode)
41
- - [Model Context Protocol (MCP)](#model-context-protocol-mcp)
42
- - [Tracing / verbose logging](#tracing--verbose-logging)
43
- - [DotSlash](#dotslash)
44
- - [Configuration](#configuration)
45
- - [FAQ](#faq)
46
- - [Zero data retention (ZDR) usage](#zero-data-retention-zdr-usage)
47
- - [Codex open source fund](#codex-open-source-fund)
48
- - [Contributing](#contributing)
49
- - [Development workflow](#development-workflow)
50
- - [Writing high-impact code changes](#writing-high-impact-code-changes)
51
- - [Opening a pull request](#opening-a-pull-request)
52
- - [Review process](#review-process)
53
- - [Community values](#community-values)
54
- - [Getting help](#getting-help)
55
- - [Contributor license agreement (CLA)](#contributor-license-agreement-cla)
56
- - [Quick fixes](#quick-fixes)
57
- - [Releasing `codex`](#releasing-codex)
58
- - [Security & responsible AI](#security--responsible-ai)
59
- - [License](#license)
60
-
61
- <!-- End ToC -->
62
-
63
- </details>
64
-
65
- ---
66
-
67
13
  ## Quickstart
68
14
 
69
15
  ### Installing and running Codex CLI
@@ -99,607 +45,52 @@ Each archive contains a single entry with the platform baked into the name (e.g.
99
45
  ### Using Codex with your ChatGPT plan
100
46
 
101
47
  <p align="center">
102
- <img src="./.github/codex-cli-login.png" alt="Codex CLI login" width="50%" />
48
+ <img src="./.github/codex-cli-login.png" alt="Codex CLI login" width="80%" />
103
49
  </p>
104
50
 
105
- Run `codex` and select **Sign in with ChatGPT**. You'll need a Plus, Pro, or Team ChatGPT account, and will get access to our latest models, including `gpt-5`, at no extra cost to your plan. (Enterprise is coming soon.)
106
-
107
- > Important: If you've used the Codex CLI before, follow these steps to migrate from usage-based billing with your API key:
108
- >
109
- > 1. Update the CLI and ensure `codex --version` is `0.20.0` or later
110
- > 2. Delete `~/.codex/auth.json` (this should be `C:\Users\USERNAME\.codex\auth.json` on Windows)
111
- > 3. Run `codex login` again
112
-
113
- If you encounter problems with the login flow, please comment on [this issue](https://github.com/openai/codex/issues/1243).
114
-
115
- ### Connecting on a "Headless" Machine
116
-
117
- Today, the login process entails running a server on `localhost:1455`. If you are on a "headless" server, such as a Docker container or are `ssh`'d into a remote machine, loading `localhost:1455` in the browser on your local machine will not automatically connect to the webserver running on the _headless_ machine, so you must use one of the following workarounds:
118
-
119
- #### Authenticate locally and copy your credentials to the "headless" machine
120
-
121
- The easiest solution is likely to run through the `codex login` process on your local machine such that `localhost:1455` _is_ accessible in your web browser. When you complete the authentication process, an `auth.json` file should be available at `$CODEX_HOME/auth.json` (on Mac/Linux, `$CODEX_HOME` defaults to `~/.codex` whereas on Windows, it defaults to `%USERPROFILE%\.codex`).
122
-
123
- Because the `auth.json` file is not tied to a specific host, once you complete the authentication flow locally, you can copy the `$CODEX_HOME/auth.json` file to the headless machine and then `codex` should "just work" on that machine. Note to copy a file to a Docker container, you can do:
124
-
125
- ```shell
126
- # substitute MY_CONTAINER with the name or id of your Docker container:
127
- CONTAINER_HOME=$(docker exec MY_CONTAINER printenv HOME)
128
- docker exec MY_CONTAINER mkdir -p "$CONTAINER_HOME/.codex"
129
- docker cp auth.json MY_CONTAINER:"$CONTAINER_HOME/.codex/auth.json"
130
- ```
131
-
132
- whereas if you are `ssh`'d into a remote machine, you likely want to use [`scp`](https://en.wikipedia.org/wiki/Secure_copy_protocol):
51
+ Run `codex` and select **Sign in with ChatGPT**. We recommend signing into your ChatGPT account to use Codex as part of your Plus, Pro, Team, Edu, or Enterprise plan. [Learn more about what's included in your ChatGPT plan](https://help.openai.com/en/articles/11369540-codex-in-chatgpt).
133
52
 
134
- ```shell
135
- ssh user@remote 'mkdir -p ~/.codex'
136
- scp ~/.codex/auth.json user@remote:~/.codex/auth.json
137
- ```
138
-
139
- or try this one-liner:
140
-
141
- ```shell
142
- ssh user@remote 'mkdir -p ~/.codex && cat > ~/.codex/auth.json' < ~/.codex/auth.json
143
- ```
53
+ You can also use Codex with an API key, but this requires [additional setup](./docs/authentication.md#usage-based-billing-alternative-use-an-openai-api-key). If you previously used an API key for usage-based billing, see the [migration steps](./docs/authentication.md#migrating-from-usage-based-billing-api-key). If you're having trouble with login, please comment on [this issue](https://github.com/openai/codex/issues/1243).
144
54
 
145
- #### Connecting through VPS or remote
55
+ ### Model Context Protocol (MCP)
146
56
 
147
- If you run Codex on a remote machine (VPS/server) without a local browser, the login helper starts a server on `localhost:1455` on the remote host. To complete login in your local browser, forward that port to your machine before starting the login flow:
148
-
149
- ```bash
150
- # From your local machine
151
- ssh -L 1455:localhost:1455 <user>@<remote-host>
152
- ```
153
-
154
- Then, in that SSH session, run `codex` and select "Sign in with ChatGPT". When prompted, open the printed URL (it will be `http://localhost:1455/...`) in your local browser. The traffic will be tunneled to the remote server.
155
-
156
- ### Usage-based billing alternative: Use an OpenAI API key
157
-
158
- If you prefer to pay-as-you-go, you can still authenticate with your OpenAI API key by setting it as an environment variable:
159
-
160
- ```shell
161
- export OPENAI_API_KEY="your-api-key-here"
162
- ```
57
+ Codex CLI supports [MCP servers](./docs/advanced.md#model-context-protocol-mcp). Enable by adding an `mcp_servers` section to your `~/.codex/config.toml`.
163
58
 
164
- Notes:
165
59
 
166
- - This command only sets the key for your current terminal session, which we recommend. To set it for all future sessions, you can also add the `export` line to your shell's configuration file (e.g., `~/.zshrc`).
167
- - If you have signed in with ChatGPT, Codex will default to using your ChatGPT credits. If you wish to use your API key, use the `/logout` command to clear your ChatGPT authentication.
60
+ ### Configuration
168
61
 
169
- #### Forcing a specific auth method (advanced)
170
-
171
- You can explicitly choose which authentication Codex should prefer when both are available.
172
-
173
- - To always use your API key (even when ChatGPT auth exists), set:
174
-
175
- ```toml
176
- # ~/.codex/config.toml
177
- preferred_auth_method = "apikey"
178
- ```
179
-
180
- Or override ad-hoc via CLI:
181
-
182
- ```bash
183
- codex --config preferred_auth_method="apikey"
184
- ```
185
-
186
- - To prefer ChatGPT auth (default), set:
187
-
188
- ```toml
189
- # ~/.codex/config.toml
190
- preferred_auth_method = "chatgpt"
191
- ```
192
-
193
- Notes:
194
-
195
- - When `preferred_auth_method = "apikey"` and an API key is available, the login screen is skipped.
196
- - When `preferred_auth_method = "chatgpt"` (default), Codex prefers ChatGPT auth if present; if only an API key is present, it will use the API key. Certain account types may also require API-key mode.
197
-
198
- ### Choosing Codex's level of autonomy
199
-
200
- We always recommend running Codex in its default sandbox that gives you strong guardrails around what the agent can do. The default sandbox prevents it from editing files outside its workspace, or from accessing the network.
201
-
202
- When you launch Codex in a new folder, it detects whether the folder is version controlled and recommends one of two levels of autonomy:
203
-
204
- #### **1. Read/write**
205
-
206
- - Codex can run commands and write files in the workspace without approval.
207
- - To write files in other folders, access network, update git or perform other actions protected by the sandbox, Codex will need your permission.
208
- - By default, the workspace includes the current directory, as well as temporary directories like `/tmp`. You can see what directories are in the workspace with the `/status` command. See the docs for how to customize this behavior.
209
- - Advanced: You can manually specify this configuration by running `codex --sandbox workspace-write --ask-for-approval on-request`
210
- - This is the recommended default for version-controlled folders.
211
-
212
- #### **2. Read-only**
213
-
214
- - Codex can run read-only commands without approval.
215
- - To edit files, access network, or perform other actions protected by the sandbox, Codex will need your permission.
216
- - Advanced: You can manually specify this configuration by running `codex --sandbox read-only --ask-for-approval on-request`
217
- - This is the recommended default non-version-controlled folders.
218
-
219
- #### **3. Advanced configuration**
220
-
221
- Codex gives you fine-grained control over the sandbox with the `--sandbox` option, and over when it requests approval with the `--ask-for-approval` option. Run `codex help` for more on these options.
222
-
223
- #### Can I run without ANY approvals?
224
-
225
- Yes, run codex non-interactively with `--ask-for-approval never`. This option works with all `--sandbox` options, so you still have full control over Codex's level of autonomy. It will make its best attempt with whatever contrainsts you provide. For example:
226
-
227
- - Use `codex --ask-for-approval never --sandbox read-only` when you are running many agents to answer questions in parallel in the same workspace.
228
- - Use `codex --ask-for-approval never --sandbox workspace-write` when you want the agent to non-interactively take time to produce the best outcome, with strong guardrails around its behavior.
229
- - Use `codex --ask-for-approval never --sandbox danger-full-access` to dangerously give the agent full autonomy. Because this disables important safety mechanisms, we recommend against using this unless running Codex in an isolated environment.
230
-
231
- #### Fine-tuning in `config.toml`
232
-
233
- ```toml
234
- # approval mode
235
- approval_policy = "untrusted"
236
- sandbox_mode = "read-only"
237
-
238
- # full-auto mode
239
- approval_policy = "on-request"
240
- sandbox_mode = "workspace-write"
241
-
242
- # Optional: allow network in workspace-write mode
243
- [sandbox_workspace_write]
244
- network_access = true
245
- ```
246
-
247
- You can also save presets as **profiles**:
248
-
249
- ```toml
250
- [profiles.full_auto]
251
- approval_policy = "on-request"
252
- sandbox_mode = "workspace-write"
253
-
254
- [profiles.readonly_quiet]
255
- approval_policy = "never"
256
- sandbox_mode = "read-only"
257
- ```
258
-
259
- ### Example prompts
260
-
261
- Below are a few bite-size examples you can copy-paste. Replace the text in quotes with your own task. See the [prompting guide](https://github.com/openai/codex/blob/main/codex-cli/examples/prompting_guide.md) for more tips and usage patterns.
262
-
263
- | ✨ | What you type | What happens |
264
- | --- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
265
- | 1 | `codex "Refactor the Dashboard component to React Hooks"` | Codex rewrites the class component, runs `npm test`, and shows the diff. |
266
- | 2 | `codex "Generate SQL migrations for adding a users table"` | Infers your ORM, creates migration files, and runs them in a sandboxed DB. |
267
- | 3 | `codex "Write unit tests for utils/date.ts"` | Generates tests, executes them, and iterates until they pass. |
268
- | 4 | `codex "Bulk-rename *.jpeg -> *.jpg with git mv"` | Safely renames files and updates imports/usages. |
269
- | 5 | `codex "Explain what this regex does: ^(?=.*[A-Z]).{8,}$"` | Outputs a step-by-step human explanation. |
270
- | 6 | `codex "Carefully review this repo, and propose 3 high impact well-scoped PRs"` | Suggests impactful PRs in the current codebase. |
271
- | 7 | `codex "Look for vulnerabilities and create a security review report"` | Finds and explains security bugs. |
272
-
273
- ## Running with a prompt as input
274
-
275
- You can also run Codex CLI with a prompt as input:
276
-
277
- ```shell
278
- codex "explain this codebase to me"
279
- ```
280
-
281
- ```shell
282
- codex --full-auto "create the fanciest todo-list app"
283
- ```
284
-
285
- That's it - Codex will scaffold a file, run it inside a sandbox, install any
286
- missing dependencies, and show you the live result. Approve the changes and
287
- they'll be committed to your working directory.
288
-
289
- ## Using Open Source Models
290
-
291
- <details>
292
- <summary><strong>Use <code>--profile</code> to use other models</strong></summary>
293
-
294
- Codex also allows you to use other providers that support the OpenAI Chat Completions (or Responses) API.
295
-
296
- To do so, you must first define custom [providers](./config.md#model_providers) in `~/.codex/config.toml`. For example, the provider for a standard Ollama setup would be defined as follows:
297
-
298
- ```toml
299
- [model_providers.ollama]
300
- name = "Ollama"
301
- base_url = "http://localhost:11434/v1"
302
- ```
303
-
304
- The `base_url` will have `/chat/completions` appended to it to build the full URL for the request.
305
-
306
- For providers that also require an `Authorization` header of the form `Bearer: SECRET`, an `env_key` can be specified, which indicates the environment variable to read to use as the value of `SECRET` when making a request:
307
-
308
- ```toml
309
- [model_providers.openrouter]
310
- name = "OpenRouter"
311
- base_url = "https://openrouter.ai/api/v1"
312
- env_key = "OPENROUTER_API_KEY"
313
- ```
314
-
315
- Providers that speak the Responses API are also supported by adding `wire_api = "responses"` as part of the definition. Accessing OpenAI models via Azure is an example of such a provider, though it also requires specifying additional `query_params` that need to be appended to the request URL:
316
-
317
- ```toml
318
- [model_providers.azure]
319
- name = "Azure"
320
- # Make sure you set the appropriate subdomain for this URL.
321
- base_url = "https://YOUR_PROJECT_NAME.openai.azure.com/openai"
322
- env_key = "AZURE_OPENAI_API_KEY" # Or "OPENAI_API_KEY", whichever you use.
323
- # Newer versions appear to support the responses API, see https://github.com/openai/codex/pull/1321
324
- query_params = { api-version = "2025-04-01-preview" }
325
- wire_api = "responses"
326
- ```
327
-
328
- Once you have defined a provider you wish to use, you can configure it as your default provider as follows:
329
-
330
- ```toml
331
- model_provider = "azure"
332
- ```
333
-
334
- > [!TIP]
335
- > If you find yourself experimenting with a variety of models and providers, then you likely want to invest in defining a _profile_ for each configuration like so:
336
-
337
- ```toml
338
- [profiles.o3]
339
- model_provider = "azure"
340
- model = "o3"
341
-
342
- [profiles.mistral]
343
- model_provider = "ollama"
344
- model = "mistral"
345
- ```
346
-
347
- This way, you can specify one command-line argument (.e.g., `--profile o3`, `--profile mistral`) to override multiple settings together.
348
-
349
- </details>
350
-
351
- Codex can run fully locally against an OpenAI-compatible OSS host (like Ollama) using the `--oss` flag:
352
-
353
- - Interactive UI:
354
- - codex --oss
355
- - Non-interactive (programmatic) mode:
356
- - echo "Refactor utils" | codex exec --oss
357
-
358
- Model selection when using `--oss`:
359
-
360
- - If you omit `-m/--model`, Codex defaults to -m gpt-oss:20b and will verify it exists locally (downloading if needed).
361
- - To pick a different size, pass one of:
362
- - -m "gpt-oss:20b"
363
- - -m "gpt-oss:120b"
364
-
365
- Point Codex at your own OSS host:
366
-
367
- - By default, `--oss` talks to http://localhost:11434/v1.
368
- - To use a different host, set one of these environment variables before running Codex:
369
- - CODEX_OSS_BASE_URL, for example:
370
- - CODEX_OSS_BASE_URL="http://my-ollama.example.com:11434/v1" codex --oss -m gpt-oss:20b
371
- - or CODEX_OSS_PORT (when the host is localhost):
372
- - CODEX_OSS_PORT=11434 codex --oss
373
-
374
- Advanced: you can persist this in your config instead of environment variables by overriding the built-in `oss` provider in `~/.codex/config.toml`:
375
-
376
- ```toml
377
- [model_providers.oss]
378
- name = "Open Source"
379
- base_url = "http://my-ollama.example.com:11434/v1"
380
- ```
62
+ Codex CLI supports a rich set of configuration options, with preferences stored in `~/.codex/config.toml`. For full configuration options, see [Configuration](./docs/config.md).
381
63
 
382
64
  ---
383
65
 
384
- ### Platform sandboxing details
385
-
386
- By default, Codex CLI runs code and shell commands inside a restricted sandbox to protect your system.
66
+ ### Docs & FAQ
387
67
 
388
- > [!IMPORTANT]
389
- > Not all tool calls are sandboxed. Specifically, **trusted Model Context Protocol (MCP) tool calls** are executed outside of the sandbox.
390
- > This is intentional: MCP tools are explicitly configured and trusted by you, and they often need to connect to **external applications or services** (e.g. issue trackers, databases, messaging systems).
391
- > Running them outside the sandbox allows Codex to integrate with these external systems without being blocked by sandbox restrictions.
392
-
393
- The mechanism Codex uses to implement the sandbox policy depends on your OS:
394
-
395
- - **macOS 12+** uses **Apple Seatbelt** and runs commands using `sandbox-exec` with a profile (`-p`) that corresponds to the `--sandbox` that was specified.
396
- - **Linux** uses a combination of Landlock/seccomp APIs to enforce the `sandbox` configuration.
397
-
398
- Note that when running Linux in a containerized environment such as Docker, sandboxing may not work if the host/container configuration does not support the necessary Landlock/seccomp APIs. In such cases, we recommend configuring your Docker container so that it provides the sandbox guarantees you are looking for and then running `codex` with `--sandbox danger-full-access` (or, more simply, the `--dangerously-bypass-approvals-and-sandbox` flag) within your container.
399
-
400
- ---
401
-
402
- ## Experimental technology disclaimer
403
-
404
- Codex CLI is an experimental project under active development. It is not yet stable, may contain bugs, incomplete features, or undergo breaking changes. We're building it in the open with the community and welcome:
405
-
406
- - Bug reports
407
- - Feature requests
408
- - Pull requests
409
- - Good vibes
410
-
411
- Help us improve by filing issues or submitting PRs (see the section below for how to contribute)!
412
-
413
- ---
414
-
415
- ## System requirements
416
-
417
- | Requirement | Details |
418
- | --------------------------- | --------------------------------------------------------------- |
419
- | Operating systems | macOS 12+, Ubuntu 20.04+/Debian 10+, or Windows 11 **via WSL2** |
420
- | Git (optional, recommended) | 2.23+ for built-in PR helpers |
421
- | RAM | 4-GB minimum (8-GB recommended) |
422
-
423
- ---
424
-
425
- ## CLI reference
426
-
427
- | Command | Purpose | Example |
428
- | ------------------ | ---------------------------------- | ------------------------------- |
429
- | `codex` | Interactive TUI | `codex` |
430
- | `codex "..."` | Initial prompt for interactive TUI | `codex "fix lint errors"` |
431
- | `codex exec "..."` | Non-interactive "automation mode" | `codex exec "explain utils.ts"` |
432
-
433
- Key flags: `--model/-m`, `--ask-for-approval/-a`.
434
-
435
- ---
436
-
437
- ## Memory & project docs
438
-
439
- You can give Codex extra instructions and guidance using `AGENTS.md` files. Codex looks for `AGENTS.md` files in the following places, and merges them top-down:
440
-
441
- 1. `~/.codex/AGENTS.md` - personal global guidance
442
- 2. `AGENTS.md` at repo root - shared project notes
443
- 3. `AGENTS.md` in the current working directory - sub-folder/feature specifics
444
-
445
- ---
446
-
447
- ## Non-interactive / CI mode
448
-
449
- Run Codex head-less in pipelines. Example GitHub Action step:
450
-
451
- ```yaml
452
- - name: Update changelog via Codex
453
- run: |
454
- npm install -g @openai/codex
455
- export OPENAI_API_KEY="${{ secrets.OPENAI_KEY }}"
456
- codex exec --full-auto "update CHANGELOG for next release"
457
- ```
458
-
459
- ## Model Context Protocol (MCP)
460
-
461
- The Codex CLI can be configured to leverage MCP servers by defining an [`mcp_servers`](./codex-rs/config.md#mcp_servers) section in `~/.codex/config.toml`. It is intended to mirror how tools such as Claude and Cursor define `mcpServers` in their respective JSON config files, though the Codex format is slightly different since it uses TOML rather than JSON, e.g.:
462
-
463
- ```toml
464
- # IMPORTANT: the top-level key is `mcp_servers` rather than `mcpServers`.
465
- [mcp_servers.server-name]
466
- command = "npx"
467
- args = ["-y", "mcp-server"]
468
- env = { "API_KEY" = "value" }
469
- ```
470
-
471
- > [!TIP]
472
- > It is somewhat experimental, but the Codex CLI can also be run as an MCP _server_ via `codex mcp`. If you launch it with an MCP client such as `npx @modelcontextprotocol/inspector codex mcp` and send it a `tools/list` request, you will see that there is only one tool, `codex`, that accepts a grab-bag of inputs, including a catch-all `config` map for anything you might want to override. Feel free to play around with it and provide feedback via GitHub issues.
473
-
474
- ## Tracing / verbose logging
475
-
476
- Because Codex is written in Rust, it honors the `RUST_LOG` environment variable to configure its logging behavior.
477
-
478
- The TUI defaults to `RUST_LOG=codex_core=info,codex_tui=info` and log messages are written to `~/.codex/log/codex-tui.log`, so you can leave the following running in a separate terminal to monitor log messages as they are written:
479
-
480
- ```
481
- tail -F ~/.codex/log/codex-tui.log
482
- ```
483
-
484
- By comparison, the non-interactive mode (`codex exec`) defaults to `RUST_LOG=error`, but messages are printed inline, so there is no need to monitor a separate file.
485
-
486
- See the Rust documentation on [`RUST_LOG`](https://docs.rs/env_logger/latest/env_logger/#enabling-logging) for more information on the configuration options.
487
-
488
- ---
489
-
490
- ### DotSlash
491
-
492
- The GitHub Release also contains a [DotSlash](https://dotslash-cli.com/) file for the Codex CLI named `codex`. Using a DotSlash file makes it possible to make a lightweight commit to source control to ensure all contributors use the same version of an executable, regardless of what platform they use for development.
493
-
494
- </details>
495
-
496
- <details>
497
- <summary><strong>Build from source</strong></summary>
498
-
499
- ```bash
500
- # Clone the repository and navigate to the root of the Cargo workspace.
501
- git clone https://github.com/openai/codex.git
502
- cd codex/codex-rs
503
-
504
- # Install the Rust toolchain, if necessary.
505
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
506
- source "$HOME/.cargo/env"
507
- rustup component add rustfmt
508
- rustup component add clippy
509
-
510
- # Build Codex.
511
- cargo build
512
-
513
- # Launch the TUI with a sample prompt.
514
- cargo run --bin codex -- "explain this codebase to me"
515
-
516
- # After making changes, ensure the code is clean.
517
- cargo fmt -- --config imports_granularity=Item
518
- cargo clippy --tests
519
-
520
- # Run the tests.
521
- cargo test
522
- ```
523
-
524
- </details>
525
-
526
- ---
527
-
528
- ## Configuration
529
-
530
- Codex supports a rich set of configuration options documented in [`codex-rs/config.md`](./codex-rs/config.md).
531
-
532
- By default, Codex loads its configuration from `~/.codex/config.toml`.
533
-
534
- Though `--config` can be used to set/override ad-hoc config values for individual invocations of `codex`.
535
-
536
- ---
537
-
538
- ## FAQ
539
-
540
- <details>
541
- <summary>OpenAI released a model called Codex in 2021 - is this related?</summary>
542
-
543
- In 2021, OpenAI released Codex, an AI system designed to generate code from natural language prompts. That original Codex model was deprecated as of March 2023 and is separate from the CLI tool.
544
-
545
- </details>
546
-
547
- <details>
548
- <summary>Which models are supported?</summary>
549
-
550
- Any model available with [Responses API](https://platform.openai.com/docs/api-reference/responses). The default is `o4-mini`, but pass `--model gpt-4.1` or set `model: gpt-4.1` in your config file to override.
551
-
552
- </details>
553
- <details>
554
- <summary>Why does <code>o3</code> or <code>o4-mini</code> not work for me?</summary>
555
-
556
- It's possible that your [API account needs to be verified](https://help.openai.com/en/articles/10910291-api-organization-verification) in order to start streaming responses and seeing chain of thought summaries from the API. If you're still running into issues, please let us know!
557
-
558
- </details>
559
-
560
- <details>
561
- <summary>How do I stop Codex from editing my files?</summary>
562
-
563
- Codex runs model-generated commands in a sandbox. If a proposed command or file change doesn't look right, you can simply type **n** to deny the command or give the model feedback.
564
-
565
- </details>
566
- <details>
567
- <summary>Does it work on Windows?</summary>
568
-
569
- Not directly. It requires [Windows Subsystem for Linux (WSL2)](https://learn.microsoft.com/en-us/windows/wsl/install) - Codex has been tested on macOS and Linux with Node 22.
570
-
571
- </details>
572
-
573
- ---
574
-
575
- ## Zero data retention (ZDR) usage
576
-
577
- Codex CLI **does** support OpenAI organizations with [Zero Data Retention (ZDR)](https://platform.openai.com/docs/guides/your-data#zero-data-retention) enabled. If your OpenAI organization has Zero Data Retention enabled and you still encounter errors such as:
578
-
579
- ```
580
- OpenAI rejected the request. Error details: Status: 400, Code: unsupported_parameter, Type: invalid_request_error, Message: 400 Previous response cannot be used for this organization due to Zero Data Retention.
581
- ```
582
-
583
- Ensure you are running `codex` with `--config disable_response_storage=true` or add this line to `~/.codex/config.toml` to avoid specifying the command line option each time:
584
-
585
- ```toml
586
- disable_response_storage = true
587
- ```
588
-
589
- See [the configuration documentation on `disable_response_storage`](./codex-rs/config.md#disable_response_storage) for details.
590
-
591
- ---
592
-
593
- ## Codex open source fund
594
-
595
- We're excited to launch a **$1 million initiative** supporting open source projects that use Codex CLI and other OpenAI models.
596
-
597
- - Grants are awarded up to **$25,000** API credits.
598
- - Applications are reviewed **on a rolling basis**.
599
-
600
- **Interested? [Apply here](https://openai.com/form/codex-open-source-fund/).**
601
-
602
- ---
603
-
604
- ## Contributing
605
-
606
- This project is under active development and the code will likely change pretty significantly.
607
-
608
- **At the moment, we only plan to prioritize reviewing external contributions for bugs or security fixes.**
609
-
610
- If you want to add a new feature or change the behavior of an existing one, please open an issue proposing the feature and get approval from an OpenAI team member before spending time building it.
611
-
612
- **New contributions that don't go through this process may be closed** if they aren't aligned with our current roadmap or conflict with other priorities/upcoming features.
613
-
614
- ### Development workflow
615
-
616
- - Create a _topic branch_ from `main` - e.g. `feat/interactive-prompt`.
617
- - Keep your changes focused. Multiple unrelated fixes should be opened as separate PRs.
618
- - Following the [development setup](#development-workflow) instructions above, ensure your change is free of lint warnings and test failures.
619
-
620
- ### Writing high-impact code changes
621
-
622
- 1. **Start with an issue.** Open a new one or comment on an existing discussion so we can agree on the solution before code is written.
623
- 2. **Add or update tests.** Every new feature or bug-fix should come with test coverage that fails before your change and passes afterwards. 100% coverage is not required, but aim for meaningful assertions.
624
- 3. **Document behaviour.** If your change affects user-facing behaviour, update the README, inline help (`codex --help`), or relevant example projects.
625
- 4. **Keep commits atomic.** Each commit should compile and the tests should pass. This makes reviews and potential rollbacks easier.
626
-
627
- ### Opening a pull request
628
-
629
- - Fill in the PR template (or include similar information) - **What? Why? How?**
630
- - Run **all** checks locally (`cargo test && cargo clippy --tests && cargo fmt -- --config imports_granularity=Item`). CI failures that could have been caught locally slow down the process.
631
- - Make sure your branch is up-to-date with `main` and that you have resolved merge conflicts.
632
- - Mark the PR as **Ready for review** only when you believe it is in a merge-able state.
633
-
634
- ### Review process
635
-
636
- 1. One maintainer will be assigned as a primary reviewer.
637
- 2. If your PR adds a new feature that was not previously discussed and approved, we may choose to close your PR (see [Contributing](#contributing)).
638
- 3. We may ask for changes - please do not take this personally. We value the work, but we also value consistency and long-term maintainability.
639
- 5. When there is consensus that the PR meets the bar, a maintainer will squash-and-merge.
640
-
641
- ### Community values
642
-
643
- - **Be kind and inclusive.** Treat others with respect; we follow the [Contributor Covenant](https://www.contributor-covenant.org/).
644
- - **Assume good intent.** Written communication is hard - err on the side of generosity.
645
- - **Teach & learn.** If you spot something confusing, open an issue or PR with improvements.
646
-
647
- ### Getting help
648
-
649
- If you run into problems setting up the project, would like feedback on an idea, or just want to say _hi_ - please open a Discussion or jump into the relevant issue. We are happy to help.
650
-
651
- Together we can make Codex CLI an incredible tool. **Happy hacking!** :rocket:
652
-
653
- ### Contributor license agreement (CLA)
654
-
655
- All contributors **must** accept the CLA. The process is lightweight:
656
-
657
- 1. Open your pull request.
658
- 2. Paste the following comment (or reply `recheck` if you've signed before):
659
-
660
- ```text
661
- I have read the CLA Document and I hereby sign the CLA
662
- ```
663
-
664
- 3. The CLA-Assistant bot records your signature in the repo and marks the status check as passed.
665
-
666
- No special Git commands, email attachments, or commit footers required.
667
-
668
- #### Quick fixes
669
-
670
- | Scenario | Command |
671
- | ----------------- | ------------------------------------------------ |
672
- | Amend last commit | `git commit --amend -s --no-edit && git push -f` |
673
-
674
- The **DCO check** blocks merges until every commit in the PR carries the footer (with squash this is just the one).
675
-
676
- ### Releasing `codex`
677
-
678
- _For admins only._
679
-
680
- Make sure you are on `main` and have no local changes. Then run:
681
-
682
- ```shell
683
- VERSION=0.2.0 # Can also be 0.2.0-alpha.1 or any valid Rust version.
684
- ./codex-rs/scripts/create_github_release.sh "$VERSION"
685
- ```
686
-
687
- This will make a local commit on top of `main` with `version` set to `$VERSION` in `codex-rs/Cargo.toml` (note that on `main`, we leave the version as `version = "0.0.0"`).
688
-
689
- This will push the commit using the tag `rust-v${VERSION}`, which in turn kicks off [the release workflow](.github/workflows/rust-release.yml). This will create a new GitHub Release named `$VERSION`.
690
-
691
- If everything looks good in the generated GitHub Release, uncheck the **pre-release** box so it is the latest release.
692
-
693
- Create a PR to update [`Formula/c/codex.rb`](https://github.com/Homebrew/homebrew-core/blob/main/Formula/c/codex.rb) on Homebrew.
694
-
695
- ---
696
-
697
- ## Security & responsible AI
698
-
699
- Have you discovered a vulnerability or have concerns about model output? Please e-mail **security@openai.com** and we will respond promptly.
68
+ - [**Getting started**](./docs/getting-started.md)
69
+ - [CLI usage](./docs/getting-started.md#cli-usage)
70
+ - [Running with a prompt as input](./docs/getting-started.md#running-with-a-prompt-as-input)
71
+ - [Example prompts](./docs/getting-started.md#example-prompts)
72
+ - [Memory with AGENTS.md](./docs/getting-started.md#memory--project-docs)
73
+ - [Configuration](./docs/config.md)
74
+ - [**Sandbox & approvals**](./docs/sandbox.md)
75
+ - [**Authentication**](./docs/authentication.md)
76
+ - [Auth methods](./docs/authentication.md#forcing-a-specific-auth-method-advanced)
77
+ - [Login on a "Headless" machine](./docs/authentication.md#connecting-on-a-headless-machine)
78
+ - [**Advanced**](./docs/advanced.md)
79
+ - [Non-interactive / CI mode](./docs/advanced.md#non-interactive--ci-mode)
80
+ - [Tracing / verbose logging](./docs/advanced.md#tracing--verbose-logging)
81
+ - [Model Context Protocol (MCP)](./docs/advanced.md#model-context-protocol-mcp)
82
+ - [**Zero data retention (ZDR)**](./docs/zdr.md)
83
+ - [**Contributing**](./docs/contributing.md)
84
+ - [**Install & build**](./docs/install.md)
85
+ - [System Requirements](./docs/install.md#system-requirements)
86
+ - [DotSlash](./docs/install.md#dotslash)
87
+ - [Build from source](./docs/install.md#build-from-source)
88
+ - [**FAQ**](./docs/faq.md)
89
+ - [**Open source fund**](./docs/open-source-fund.md)
700
90
 
701
91
  ---
702
92
 
703
93
  ## License
704
94
 
705
95
  This repository is licensed under the [Apache-2.0 License](LICENSE).
96
+
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openai/codex",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "license": "Apache-2.0",
5
5
  "bin": {
6
6
  "codex": "bin/codex.js"