@openai/codex 0.2.0 → 0.3.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 +18 -10
- package/bin/codex-aarch64-apple-darwin +0 -0
- package/bin/codex-aarch64-unknown-linux-musl +0 -0
- package/bin/codex-linux-sandbox-arm64 +0 -0
- package/bin/codex-linux-sandbox-x64 +0 -0
- package/bin/codex-x86_64-apple-darwin +0 -0
- package/bin/codex-x86_64-unknown-linux-musl +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h1 align="center">OpenAI Codex CLI</h1>
|
|
2
2
|
<p align="center">Lightweight coding agent that runs in your terminal</p>
|
|
3
3
|
|
|
4
|
-
<p align="center"><code>brew install codex</code></p>
|
|
4
|
+
<p align="center"><code>npm i -g @openai/codex</code><br />or <code>brew install codex</code></p>
|
|
5
5
|
|
|
6
6
|
This is the home of the **Codex CLI**, which is a coding agent from OpenAI that runs locally on your computer. If you are looking for the _cloud-based agent_ from OpenAI, **Codex [Web]**, see <https://chatgpt.com/codex>.
|
|
7
7
|
|
|
@@ -66,10 +66,10 @@ Help us improve by filing issues or submitting PRs (see the section below for ho
|
|
|
66
66
|
|
|
67
67
|
## Quickstart
|
|
68
68
|
|
|
69
|
-
Install globally:
|
|
69
|
+
Install globally with your preferred package manager:
|
|
70
70
|
|
|
71
71
|
```shell
|
|
72
|
-
brew install codex
|
|
72
|
+
npm install -g @openai/codex # Alternatively: `brew install codex`
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
Or go to the [latest GitHub Release](https://github.com/openai/codex/releases/latest) and download the appropriate binary for your platform.
|
|
@@ -202,12 +202,12 @@ Codex lets you decide _how much autonomy_ you want to grant the agent. The follo
|
|
|
202
202
|
- [`approval_policy`](./codex-rs/config.md#approval_policy) determines when you should be prompted to approve whether Codex can execute a command
|
|
203
203
|
- [`sandbox`](./codex-rs/config.md#sandbox) determines the _sandbox policy_ that Codex uses to execute untrusted commands
|
|
204
204
|
|
|
205
|
-
By default, Codex runs with
|
|
205
|
+
By default, Codex runs with `--ask-for-approval untrusted` and `--sandbox read-only`, which means that:
|
|
206
206
|
|
|
207
207
|
- The user is prompted to approve every command not on the set of "trusted" commands built into Codex (`cat`, `ls`, etc.)
|
|
208
208
|
- Approved commands are run outside of a sandbox because user approval implies "trust," in this case.
|
|
209
209
|
|
|
210
|
-
|
|
210
|
+
Running Codex with the `--full-auto` convenience flag changes the configuration to `--ask-for-approval on-failure` and `--sandbox workspace-write`, which means that:
|
|
211
211
|
|
|
212
212
|
- Codex does not initially ask for user approval before running an individual command.
|
|
213
213
|
- Though when it runs a command, it is run under a sandbox in which:
|
|
@@ -216,16 +216,16 @@ Though running Codex with the `--full-auto` option changes the configuration to
|
|
|
216
216
|
- Network requests are completely disabled.
|
|
217
217
|
- Only if the command exits with a non-zero exit code will it ask the user for approval. If granted, it will re-attempt the command outside of the sandbox. (A common case is when Codex cannot `npm install` a dependency because that requires network access.)
|
|
218
218
|
|
|
219
|
-
Again, these two options can be configured independently. For example, if you want Codex to perform an "exploration" where you are happy for it to read anything it wants but you never want to be prompted, you could run Codex with
|
|
219
|
+
Again, these two options can be configured independently. For example, if you want Codex to perform an "exploration" where you are happy for it to read anything it wants but you never want to be prompted, you could run Codex with `--ask-for-approval never` and `--sandbox read-only`.
|
|
220
220
|
|
|
221
221
|
### Platform sandboxing details
|
|
222
222
|
|
|
223
223
|
The mechanism Codex uses to implement the sandbox policy depends on your OS:
|
|
224
224
|
|
|
225
|
-
- **macOS 12+** uses **Apple Seatbelt** and runs commands using `sandbox-exec` with a profile (`-p`) that corresponds to the
|
|
225
|
+
- **macOS 12+** uses **Apple Seatbelt** and runs commands using `sandbox-exec` with a profile (`-p`) that corresponds to the `--sandbox` that was specified.
|
|
226
226
|
- **Linux** uses a combination of Landlock/seccomp APIs to enforce the `sandbox` configuration.
|
|
227
227
|
|
|
228
|
-
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
|
|
228
|
+
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.
|
|
229
229
|
|
|
230
230
|
---
|
|
231
231
|
|
|
@@ -268,7 +268,7 @@ Run Codex head-less in pipelines. Example GitHub Action step:
|
|
|
268
268
|
```yaml
|
|
269
269
|
- name: Update changelog via Codex
|
|
270
270
|
run: |
|
|
271
|
-
npm install -g @openai/codex
|
|
271
|
+
npm install -g @openai/codex
|
|
272
272
|
export OPENAI_API_KEY="${{ secrets.OPENAI_KEY }}"
|
|
273
273
|
codex exec --full-auto "update CHANGELOG for next release"
|
|
274
274
|
```
|
|
@@ -323,12 +323,20 @@ Below are a few bite-size examples you can copy-paste. Replace the text in quote
|
|
|
323
323
|
## Installation
|
|
324
324
|
|
|
325
325
|
<details open>
|
|
326
|
-
<summary><strong>
|
|
326
|
+
<summary><strong>Install Codex CLI using your preferred package manager.</strong></summary>
|
|
327
|
+
|
|
328
|
+
From `brew` (recommended, downloads only the binary for your platform):
|
|
327
329
|
|
|
328
330
|
```bash
|
|
329
331
|
brew install codex
|
|
330
332
|
```
|
|
331
333
|
|
|
334
|
+
From `npm` (generally more readily available, but downloads binaries for all supported platforms):
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
npm i -g @openai/codex
|
|
338
|
+
```
|
|
339
|
+
|
|
332
340
|
Or go to the [latest GitHub Release](https://github.com/openai/codex/releases/latest) and download the appropriate binary for your platform.
|
|
333
341
|
|
|
334
342
|
Admittedly, each GitHub Release contains many executables, but in practice, you likely want one of these:
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|