@samooth/open-codex 0.1.45
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 +93 -0
- package/dist/cli.js +884 -0
- package/dist/cli.js.map +7 -0
- package/package.json +87 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @samooth/open-codex
|
|
2
|
+
|
|
3
|
+
> Lightweight coding agent that runs in your terminal.
|
|
4
|
+
|
|
5
|
+
**Open Codex** is a powerful, terminal-based coding assistant designed to help you build, refactor, and maintain your codebase directly from your CLI. It combines LLM reasoning with the ability to execute shell commands and apply file edits safely.
|
|
6
|
+
|
|
7
|
+
This is a community-maintained fork of the original OpenAI Codex CLI, featuring expanded support for multiple AI providers and a more flexible architecture.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Multi-Provider Support**: Use OpenAI, Google Gemini, OpenRouter, Ollama, xAI, DeepSeek, or Hugging Face.
|
|
12
|
+
- **Interactive Chat**: A rich terminal UI built with Ink for seamless developer interaction.
|
|
13
|
+
- **High Performance**: Parallel tool execution and asynchronous file indexing for faster responses.
|
|
14
|
+
- **Autonomous Action**: The agent can read/write files and execute shell commands to solve complex tasks.
|
|
15
|
+
- **Safety First**: Three levels of autonomy (`suggest`, `auto-edit`, `full-auto`) with optional sandboxing (macOS Seatbelt) and a **Dry Run** mode.
|
|
16
|
+
- **Context Aware**: Automatically picks up project-specific instructions from `codex.md` files and maintains a persistent memory of your project.
|
|
17
|
+
- **Multimodal**: Supports passing images (screenshots, diagrams) to guide the coding process.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g @samooth/open-codex
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quickstart
|
|
26
|
+
|
|
27
|
+
1. **Set your API key** (OpenAI is default, but others are supported):
|
|
28
|
+
```bash
|
|
29
|
+
export OPENAI_API_KEY="sk-..."
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. **Launch the agent**:
|
|
33
|
+
```bash
|
|
34
|
+
open-codex
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
3. **Or run a one-off task**:
|
|
38
|
+
```bash
|
|
39
|
+
open-codex "Refactor src/utils.ts to use async/await"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage & Slash Commands
|
|
43
|
+
|
|
44
|
+
Inside the interactive chat, you can use several slash commands to control the agent:
|
|
45
|
+
|
|
46
|
+
- `/help` – Show available commands and shortcuts.
|
|
47
|
+
- `/model` – Switch the LLM model for the current session.
|
|
48
|
+
- `/approval` – Switch between autonomy levels (Suggest, Auto Edit, Full Auto).
|
|
49
|
+
- `/history` – Review the commands run and files touched in this session.
|
|
50
|
+
- `/clear` – Reset the conversation context.
|
|
51
|
+
|
|
52
|
+
### Keyboard Shortcuts
|
|
53
|
+
|
|
54
|
+
- **Enter**: Send message.
|
|
55
|
+
- **Up/Down**: Navigate prompt history.
|
|
56
|
+
- **Ctrl+J**: Insert a newline.
|
|
57
|
+
- **Esc (twice)**: Interrupt the agent's current action.
|
|
58
|
+
- **Ctrl+C**: Exit the application.
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
Codex stores its settings in `~/.codex/config.json`. You can configure the default provider, model, and approval mode there.
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"model": "o4-mini",
|
|
67
|
+
"provider": "openai",
|
|
68
|
+
"approvalMode": "suggest",
|
|
69
|
+
"memory": {
|
|
70
|
+
"enabled": true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Supported Providers
|
|
76
|
+
|
|
77
|
+
| Provider | Env Variable |
|
|
78
|
+
| :--- | :--- |
|
|
79
|
+
| **OpenAI** | `OPENAI_API_KEY` |
|
|
80
|
+
| **Gemini** | `GOOGLE_GENERATIVE_AI_API_KEY` |
|
|
81
|
+
| **OpenRouter** | `OPENROUTER_API_KEY` |
|
|
82
|
+
| **xAI** | `XAI_API_KEY` |
|
|
83
|
+
| **DeepSeek** | `DS_API_KEY` |
|
|
84
|
+
| **Hugging Face** | `HF_API_KEY` |
|
|
85
|
+
| **Ollama** | (Runs locally) |
|
|
86
|
+
|
|
87
|
+
## Security
|
|
88
|
+
|
|
89
|
+
Open Codex is designed to be safe by default. It warns you when running outside of a Git repository and provides a `--dry-run` flag to preview all intended actions before they happen. On macOS, it supports `sandbox-exec` to restrict file system access and disable networking during execution.
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
[Apache-2.0](./LICENSE)
|