@samooth/open-codex 0.3.11 → 0.3.13
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 -130
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
- [CLI Reference](#clireference)
|
|
25
25
|
- [Memory & Project Docs](#memoryprojectdocs)
|
|
26
26
|
- [Non‑interactive / CI mode](#noninteractivecimode)
|
|
27
|
+
- [Editor Integration](#editor-integration)
|
|
27
28
|
- [Recipes](#recipes)
|
|
28
29
|
- [Installation](#installation)
|
|
29
30
|
- [Configuration](#configuration)
|
|
@@ -112,6 +113,7 @@ development_ that understands and executes your repo.
|
|
|
112
113
|
- **Multiple AI providers** — use OpenAI, Gemini, OpenRouter, Ollama, xAI, DeepSeek, or Hugging Face!
|
|
113
114
|
- **High Performance** — parallel tool execution and asynchronous file indexing for speed ✨
|
|
114
115
|
- **Syntax Highlighting** — full terminal color support for code diffs and file contents 🎨
|
|
116
|
+
- **Security & Dependency Auditing** — built-in tools for searching npm and Snyk vulnerability databases 🛡️
|
|
115
117
|
- **Full auto-approval, while safe + secure** by running network-disabled and directory-sandboxed
|
|
116
118
|
- **Multimodal** — pass in screenshots or diagrams to implement features ✨
|
|
117
119
|
- **Planning Visibility** — real-time display of agent `<plan>` blocks in the UI thinking state 📋
|
|
@@ -208,6 +210,21 @@ Key flags:
|
|
|
208
210
|
|
|
209
211
|
---
|
|
210
212
|
|
|
213
|
+
## Documentation Index
|
|
214
|
+
|
|
215
|
+
For more detailed information, please refer to the following documents:
|
|
216
|
+
|
|
217
|
+
- **[Installation Guide](#installation)**: How to install and build from source.
|
|
218
|
+
- **[Configuration Guide](#configuration)**: Customizing models, providers, and settings.
|
|
219
|
+
- **[Editor Integration](#editor-integration)**: Using OpenCodex with Sublime Text and other editors.
|
|
220
|
+
- **[Non-interactive / CI Mode](CI.md)**: Running OpenCodex in automated pipelines.
|
|
221
|
+
- **[Recipes](RECIPES.md)**: A collection of common tasks and prompts.
|
|
222
|
+
- **[Project Memory & Docs](#memoryprojectdocs)**: Managing persistent project context.
|
|
223
|
+
- **[Contributing](CONTRIBUTING.md)**: Workflow and guidelines for developers.
|
|
224
|
+
- **[Internal Tools](TOOLS.md)**: Details on the built-in tool architecture.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
211
228
|
## Memory & Project Docs
|
|
212
229
|
|
|
213
230
|
Codex merges Markdown instructions in this order:
|
|
@@ -219,30 +236,6 @@ Codex merges Markdown instructions in this order:
|
|
|
219
236
|
|
|
220
237
|
Disable with `--no-project-doc` or `CODEX_DISABLE_PROJECT_DOC=1`.
|
|
221
238
|
|
|
222
|
-
---
|
|
223
|
-
|
|
224
|
-
## Non‑interactive / CI mode
|
|
225
|
-
|
|
226
|
-
Run Codex head‑less in pipelines. Codex will automatically detect if it's running in a non-TTY environment and enable quiet mode if a prompt is provided.
|
|
227
|
-
|
|
228
|
-
Prompts can be passed as command-line arguments or piped via **stdin**:
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
echo "explain this project" | open-codex
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
Example GitHub Action step:
|
|
235
|
-
|
|
236
|
-
```yaml
|
|
237
|
-
- name: Update changelog via Codex
|
|
238
|
-
run: |
|
|
239
|
-
npm install -g @samooth/open-codex
|
|
240
|
-
export OPENAI_API_KEY="${{ secrets.OPENAI_KEY }}"
|
|
241
|
-
open-codex -a auto-edit "update CHANGELOG for next release"
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
You can also explicitly enable it with the `--quiet` flag or by setting `CODEX_QUIET_MODE=1`.
|
|
245
|
-
|
|
246
239
|
## Tracing / Verbose Logging
|
|
247
240
|
|
|
248
241
|
Setting the environment variable `DEBUG=true` prints full API request and response details:
|
|
@@ -255,32 +248,6 @@ DEBUG=true open-codex
|
|
|
255
248
|
|
|
256
249
|
## Editor Integration
|
|
257
250
|
|
|
258
|
-
You can integrate OpenCodex into your favorite text editor for a seamless workflow.
|
|
259
|
-
|
|
260
|
-
### External Editor (Ctrl+E)
|
|
261
|
-
|
|
262
|
-
You can hit `Ctrl+E` at any time while typing in the chat to open your current prompt in your system's default editor (defined by the `$EDITOR` environment variable, like Vim, Nano, or VS Code). This is ideal for writing long instructions or pasting large blocks of code.
|
|
263
|
-
|
|
264
|
-
- **Sublime Text**: Use build systems or the Terminus plugin to run Codex directly from your editor. See the [Sublime Text Integration Guide](SUBLIME.md) for details.
|
|
265
|
-
|
|
266
|
-
---
|
|
267
|
-
|
|
268
|
-
## Recipes
|
|
269
|
-
|
|
270
|
-
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/samooth/open-codex/blob/main/codex-cli/examples/prompting_guide.md) for more tips and usage patterns.
|
|
271
|
-
|
|
272
|
-
| ✨ | What you type | What happens |
|
|
273
|
-
| --- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
274
|
-
| 1 | `codex "Refactor the Dashboard component to React Hooks"` | Codex rewrites the class component, runs `npm test`, and shows the diff. |
|
|
275
|
-
| 2 | `codex "Generate SQL migrations for adding a users table"` | Infers your ORM, creates migration files, and runs them in a sandboxed DB. |
|
|
276
|
-
| 3 | `codex "Write unit tests for utils/date.ts"` | Generates tests, executes them, and iterates until they pass. |
|
|
277
|
-
| 4 | `codex "Bulk‑rename *.jpeg → *.jpg with git mv"` | Safely renames files and updates imports/usages. |
|
|
278
|
-
| 5 | `codex "Explain what this regex does: ^(?=.*[A-Z]).{8,}$"` | Outputs a step‑by‑step human explanation. |
|
|
279
|
-
| 6 | `codex "Carefully review this repo, and propose 3 high impact well-scoped PRs"` | Suggests impactful PRs in the current codebase. |
|
|
280
|
-
| 7 | `codex "Look for vulnerabilities and create a security review report"` | Finds and explains security bugs. |
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
251
|
## Installation
|
|
285
252
|
|
|
286
253
|
<details open>
|
|
@@ -517,88 +484,9 @@ OpenAI rejected the request. Error details: Status: 400, Code: unsupported_param
|
|
|
517
484
|
|
|
518
485
|
---
|
|
519
486
|
|
|
520
|
-
## Contributing
|
|
521
|
-
|
|
522
|
-
This project is under active development and the code will likely change pretty significantly. We'll update this message once that's complete!
|
|
523
|
-
|
|
524
|
-
More broadly we welcome contributions – whether you are opening your very first pull request or you're a seasoned maintainer. At the same time we care about reliability and long‑term maintainability, so the bar for merging code is intentionally **high**. The guidelines below spell out what "high‑quality" means in practice and should make the whole process transparent and friendly.
|
|
525
|
-
|
|
526
|
-
### Development workflow
|
|
527
|
-
|
|
528
|
-
- Create a _topic branch_ from `main` – e.g. `feat/interactive-prompt`.
|
|
529
|
-
- Keep your changes focused. Multiple unrelated fixes should be opened as separate PRs.
|
|
530
|
-
- Use `npm run test:watch` during development for super‑fast feedback.
|
|
531
|
-
- We use **Vitest** for unit tests, **ESLint** + **Prettier** for style, and **TypeScript** for type‑checking.
|
|
532
|
-
- Before pushing, run the full test/type/lint suite:
|
|
533
|
-
|
|
534
|
-
```bash
|
|
535
|
-
npm test && npm run lint && npm run typecheck
|
|
536
|
-
```
|
|
537
|
-
|
|
538
|
-
```bash
|
|
539
|
-
# Watch mode (tests rerun on change)
|
|
540
|
-
npm run test:watch
|
|
541
|
-
|
|
542
|
-
# Type‑check without emitting files
|
|
543
|
-
npm run typecheck
|
|
544
|
-
|
|
545
|
-
# Automatically fix lint + prettier issues
|
|
546
|
-
npm run lint:fix
|
|
547
|
-
npm run format:fix
|
|
548
|
-
```
|
|
549
|
-
|
|
550
|
-
### Writing high‑impact code changes
|
|
551
|
-
|
|
552
|
-
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.
|
|
553
|
-
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.
|
|
554
|
-
3. **Document behaviour.** If your change affects user‑facing behaviour, update the README, inline help (`codex --help`), or relevant example projects.
|
|
555
|
-
4. **Keep commits atomic.** Each commit should compile and the tests should pass. This makes reviews and potential rollbacks easier.
|
|
556
|
-
|
|
557
|
-
### Opening a pull request
|
|
558
|
-
|
|
559
|
-
- Fill in the PR template (or include similar information) – **What? Why? How?**
|
|
560
|
-
- Run **all** checks locally (`npm test && npm run lint && npm run typecheck`). CI failures that could have been caught locally slow down the process.
|
|
561
|
-
- Make sure your branch is up‑to‑date with `main` and that you have resolved merge conflicts.
|
|
562
|
-
- Mark the PR as **Ready for review** only when you believe it is in a merge‑able state.
|
|
563
|
-
|
|
564
|
-
### Review process
|
|
565
|
-
|
|
566
|
-
1. One maintainer will be assigned as a primary reviewer.
|
|
567
|
-
2. We may ask for changes – please do not take this personally. We value the work, we just also value consistency and long‑term maintainability.
|
|
568
|
-
3. When there is consensus that the PR meets the bar, a maintainer will squash‑and‑merge.
|
|
569
|
-
|
|
570
|
-
### Community values
|
|
571
|
-
|
|
572
|
-
- **Be kind and inclusive.** Treat others with respect; we follow the [Contributor Covenant](https://www.contributor-covenant.org/).
|
|
573
|
-
- **Assume good intent.** Written communication is hard – err on the side of generosity.
|
|
574
|
-
- **Teach & learn.** If you spot something confusing, open an issue or PR with improvements.
|
|
575
|
-
|
|
576
|
-
### Getting help
|
|
577
|
-
|
|
578
|
-
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.
|
|
579
|
-
|
|
580
|
-
Together we can make Codex CLI an incredible tool. **Happy hacking!** :rocket:
|
|
581
|
-
|
|
582
|
-
### Releasing `codex`
|
|
583
|
-
|
|
584
|
-
To publish a new version of the CLI, run the release scripts defined in `codex-cli/package.json`:
|
|
585
|
-
|
|
586
|
-
1. Open the `codex-cli` directory
|
|
587
|
-
2. Make sure you're on a branch like `git checkout -b bump-version`
|
|
588
|
-
3. Bump the version and `CLI_VERSION` to current datetime: `npm run release:version`
|
|
589
|
-
4. Commit the version bump (with DCO sign-off):
|
|
590
|
-
```bash
|
|
591
|
-
git add codex-cli/src/utils/session.ts codex-cli/package.json
|
|
592
|
-
git commit -s -m "chore(release): codex-cli v$(node -p \"require('./codex-cli/package.json').version\")"
|
|
593
|
-
```
|
|
594
|
-
5. Copy README, build, and publish to npm: `npm run release`
|
|
595
|
-
6. Push to branch: `git push origin HEAD`
|
|
596
|
-
|
|
597
|
-
---
|
|
598
|
-
|
|
599
487
|
## Security & Responsible AI
|
|
600
488
|
|
|
601
|
-
Have you discovered a vulnerability or have concerns about model output? Please
|
|
489
|
+
Have you discovered a vulnerability or have concerns about model output? Please **open a GitHub issue** or submit a pull request with a fix. We take security seriously and will respond promptly.
|
|
602
490
|
|
|
603
491
|
---
|
|
604
492
|
|