oh-my-codex 0.3.4 → 0.3.6
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 +136 -271
- package/dist/cli/__tests__/index.test.js +19 -1
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +44 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +48 -1
- package/dist/cli/setup.js.map +1 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.d.ts +10 -0
- package/dist/hud/__tests__/hud-tmux-injection.test.d.ts.map +1 -0
- package/dist/hud/__tests__/hud-tmux-injection.test.js +143 -0
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -0
- package/dist/hud/index.d.ts +10 -0
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +32 -8
- package/dist/hud/index.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +100 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/state.d.ts +1 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +2 -2
- package/dist/team/state.js.map +1 -1
- package/dist/team/tmux-session.d.ts +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +44 -4
- package/dist/team/tmux-session.js.map +1 -1
- package/package.json +1 -1
- package/prompts/analyst.md +102 -105
- package/prompts/api-reviewer.md +90 -93
- package/prompts/architect.md +102 -104
- package/prompts/build-fixer.md +81 -84
- package/prompts/code-reviewer.md +98 -100
- package/prompts/critic.md +79 -82
- package/prompts/debugger.md +85 -88
- package/prompts/deep-executor.md +105 -107
- package/prompts/dependency-expert.md +91 -94
- package/prompts/designer.md +96 -98
- package/prompts/executor.md +92 -94
- package/prompts/explore.md +104 -107
- package/prompts/git-master.md +84 -87
- package/prompts/information-architect.md +28 -29
- package/prompts/performance-reviewer.md +86 -89
- package/prompts/planner.md +108 -111
- package/prompts/product-analyst.md +28 -29
- package/prompts/product-manager.md +33 -34
- package/prompts/qa-tester.md +90 -93
- package/prompts/quality-reviewer.md +98 -100
- package/prompts/quality-strategist.md +33 -34
- package/prompts/researcher.md +88 -91
- package/prompts/scientist.md +84 -87
- package/prompts/security-reviewer.md +119 -121
- package/prompts/style-reviewer.md +79 -82
- package/prompts/test-engineer.md +96 -98
- package/prompts/ux-researcher.md +28 -29
- package/prompts/verifier.md +87 -90
- package/prompts/vision.md +67 -70
- package/prompts/writer.md +78 -81
- package/skills/analyze/SKILL.md +1 -1
- package/skills/autopilot/SKILL.md +11 -16
- package/skills/code-review/SKILL.md +1 -1
- package/skills/configure-discord/SKILL.md +6 -6
- package/skills/configure-telegram/SKILL.md +6 -6
- package/skills/doctor/SKILL.md +47 -45
- package/skills/ecomode/SKILL.md +1 -1
- package/skills/frontend-ui-ux/SKILL.md +2 -2
- package/skills/help/SKILL.md +1 -1
- package/skills/learner/SKILL.md +5 -5
- package/skills/omx-setup/SKILL.md +47 -1109
- package/skills/plan/SKILL.md +1 -1
- package/skills/project-session-manager/SKILL.md +5 -5
- package/skills/release/SKILL.md +3 -3
- package/skills/research/SKILL.md +10 -15
- package/skills/security-review/SKILL.md +1 -1
- package/skills/skill/SKILL.md +20 -20
- package/skills/tdd/SKILL.md +1 -1
- package/skills/ultrapilot/SKILL.md +11 -16
- package/skills/writer-memory/SKILL.md +1 -1
- package/templates/AGENTS.md +7 -7
package/README.md
CHANGED
|
@@ -1,340 +1,201 @@
|
|
|
1
1
|
# oh-my-codex (OMX)
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://yeachan-heo.github.io/oh-my-codex-website/omx-character-nobg.png" alt="oh-my-codex character" width="280">
|
|
5
|
+
<br>
|
|
6
|
+
<em>Your codex is not alone.</em>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
3
9
|
[](https://www.npmjs.com/package/oh-my-codex)
|
|
4
10
|
[](https://opensource.org/licenses/MIT)
|
|
5
11
|
[](https://nodejs.org)
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
> **[Website](https://yeachan-heo.github.io/oh-my-codex-website/)** | **[GitHub](https://github.com/Yeachan-Heo/oh-my-codex)** | **[npm](https://www.npmjs.com/package/oh-my-codex)**
|
|
14
|
+
|
|
15
|
+
Multi-agent orchestration layer for [OpenAI Codex CLI](https://github.com/openai/codex).
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
OMX turns Codex from a single-session agent into a coordinated system with:
|
|
18
|
+
- Role prompts (`/prompts:name`) for specialized agents
|
|
19
|
+
- Workflow skills (`$name`) for repeatable execution modes
|
|
20
|
+
- Team orchestration in tmux (`omx team`, `$team`)
|
|
21
|
+
- Persistent state + memory via MCP servers
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
## Why OMX
|
|
12
24
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
| No multi-agent coordination | Team pipeline with verify/fix loops, up to 6 concurrent agents |
|
|
19
|
-
| No verification protocol | Evidence-backed verification with architect sign-off |
|
|
25
|
+
Codex CLI is strong for direct tasks. OMX adds structure for larger work:
|
|
26
|
+
- Decomposition and staged execution (`team-plan -> team-prd -> team-exec -> team-verify -> team-fix`)
|
|
27
|
+
- Persistent mode lifecycle state (`.omx/state/`)
|
|
28
|
+
- Memory + notepad surfaces for long-running sessions
|
|
29
|
+
- Operational controls for launch, verification, and cancellation
|
|
20
30
|
|
|
21
|
-
|
|
31
|
+
OMX is an add-on, not a fork. It uses Codex-native extension points.
|
|
22
32
|
|
|
23
|
-
##
|
|
33
|
+
## Requirements
|
|
24
34
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- **OpenAI API key** configured
|
|
35
|
+
- macOS or Linux (Windows via WSL2)
|
|
36
|
+
- Node.js >= 20
|
|
37
|
+
- Codex CLI installed (`npm install -g @openai/codex`)
|
|
38
|
+
- Codex auth configured
|
|
30
39
|
|
|
31
|
-
##
|
|
40
|
+
## Quickstart (3 minutes)
|
|
32
41
|
|
|
33
42
|
```bash
|
|
34
|
-
# Install
|
|
35
43
|
npm install -g oh-my-codex
|
|
36
|
-
|
|
37
|
-
# Setup (installs prompts, skills, configures Codex CLI)
|
|
38
44
|
omx setup
|
|
39
|
-
|
|
40
|
-
# Verify installation
|
|
41
45
|
omx doctor
|
|
42
|
-
|
|
43
|
-
# Recommended launch profile (trusted / externally sandboxed environments)
|
|
44
|
-
omx --xhigh --madmax
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
Recommended trusted-environment launch profile:
|
|
48
49
|
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
> /prompts:executor "add input validation to the login flow"
|
|
52
|
-
> $autopilot "build a REST API for user management"
|
|
53
|
-
> $team 3:executor "fix all TypeScript errors"
|
|
50
|
+
```bash
|
|
51
|
+
omx --xhigh --madmax
|
|
54
52
|
```
|
|
55
53
|
|
|
56
|
-
##
|
|
54
|
+
## First Session
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- Use `$team` inside Codex when you want staged multi-agent delivery with verify/fix loops.
|
|
61
|
-
- Use `omx team` from terminal when you want tmux worker panes plus shared task/mailbox state.
|
|
62
|
-
- OMX includes a HUD + tmux hook workaround path for Codex CLI behavior that is not natively supported yet.
|
|
63
|
-
|
|
64
|
-
Canonical pipeline:
|
|
56
|
+
Inside Codex:
|
|
65
57
|
|
|
66
|
-
```
|
|
67
|
-
|
|
58
|
+
```text
|
|
59
|
+
/prompts:architect "analyze current auth boundaries"
|
|
60
|
+
/prompts:executor "implement input validation in login"
|
|
61
|
+
$plan "ship OAuth callback safely"
|
|
62
|
+
$team 3:executor "fix all TypeScript errors"
|
|
68
63
|
```
|
|
69
64
|
|
|
70
|
-
|
|
65
|
+
From terminal:
|
|
71
66
|
|
|
72
67
|
```bash
|
|
73
|
-
# Inside Codex
|
|
74
|
-
$team 3:executor "fix all TypeScript errors across the project"
|
|
75
|
-
$team ralph "ship a complete feature with persistence + verification"
|
|
76
|
-
|
|
77
|
-
# From terminal
|
|
78
68
|
omx team 4:executor "parallelize a multi-module refactor"
|
|
79
|
-
omx
|
|
80
|
-
|
|
81
|
-
# Recommended high-throughput launch profile
|
|
82
|
-
omx --xhigh --madmax
|
|
69
|
+
omx team status <team-name>
|
|
70
|
+
omx team shutdown <team-name>
|
|
83
71
|
```
|
|
84
72
|
|
|
85
|
-
##
|
|
86
|
-
|
|
87
|
-
OMX installs into Codex CLI's native extension points:
|
|
73
|
+
## Core Model
|
|
88
74
|
|
|
89
|
-
|
|
90
|
-
|----------------|---------------------|
|
|
91
|
-
| `AGENTS.md` | Orchestration brain loaded at session start |
|
|
92
|
-
| `~/.codex/prompts/*.md` | 30 agent definitions as `/prompts:name` commands |
|
|
93
|
-
| `~/.agents/skills/*/SKILL.md` | 39 workflow skills invoked via `$name` |
|
|
94
|
-
| `config.toml` MCP servers | State management + project memory |
|
|
95
|
-
| `config.toml` notify | Post-turn logging and metrics |
|
|
96
|
-
| `config.toml` features | `collab` (sub-agents) + `child_agents_md` |
|
|
75
|
+
OMX installs and wires these layers:
|
|
97
76
|
|
|
98
|
-
```
|
|
99
|
-
User
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
77
|
+
```text
|
|
78
|
+
User
|
|
79
|
+
-> Codex CLI
|
|
80
|
+
-> AGENTS.md (orchestration brain)
|
|
81
|
+
-> ~/.codex/prompts/*.md (30 agent prompts)
|
|
82
|
+
-> ~/.agents/skills/*/SKILL.md (40 skills)
|
|
83
|
+
-> ~/.codex/config.toml (features, notify, MCP)
|
|
84
|
+
-> .omx/ (runtime state, memory, plans, logs)
|
|
104
85
|
```
|
|
105
86
|
|
|
106
|
-
##
|
|
107
|
-
|
|
108
|
-
Invoke agents with `/prompts:name` in Codex CLI.
|
|
109
|
-
|
|
110
|
-
### Build & Analysis
|
|
111
|
-
| Agent | Tier | Description |
|
|
112
|
-
|-------|------|-------------|
|
|
113
|
-
| `/prompts:explore` | Low | Codebase discovery, symbol/file mapping |
|
|
114
|
-
| `/prompts:analyst` | High | Requirements clarity, acceptance criteria |
|
|
115
|
-
| `/prompts:planner` | High | Task sequencing, execution plans, risk flags |
|
|
116
|
-
| `/prompts:architect` | High | System design, boundaries, interfaces |
|
|
117
|
-
| `/prompts:debugger` | Standard | Root-cause analysis, failure diagnosis |
|
|
118
|
-
| `/prompts:executor` | Standard | Code implementation, refactoring |
|
|
119
|
-
| `/prompts:deep-executor` | High | Complex autonomous goal-oriented tasks |
|
|
120
|
-
| `/prompts:verifier` | Standard | Completion evidence, claim validation |
|
|
121
|
-
|
|
122
|
-
### Review
|
|
123
|
-
| Agent | Tier | Description |
|
|
124
|
-
|-------|------|-------------|
|
|
125
|
-
| `/prompts:style-reviewer` | Low | Formatting, naming, lint conventions |
|
|
126
|
-
| `/prompts:quality-reviewer` | Standard | Logic defects, anti-patterns |
|
|
127
|
-
| `/prompts:api-reviewer` | Standard | API contracts, versioning |
|
|
128
|
-
| `/prompts:security-reviewer` | Standard | Vulnerabilities, OWASP Top 10 |
|
|
129
|
-
| `/prompts:performance-reviewer` | Standard | Hotspots, complexity optimization |
|
|
130
|
-
| `/prompts:code-reviewer` | High | Comprehensive review across concerns |
|
|
131
|
-
|
|
132
|
-
### Domain Specialists
|
|
133
|
-
| Agent | Tier | Description |
|
|
134
|
-
|-------|------|-------------|
|
|
135
|
-
| `/prompts:dependency-expert` | Standard | External SDK/API evaluation |
|
|
136
|
-
| `/prompts:test-engineer` | Standard | Test strategy, coverage |
|
|
137
|
-
| `/prompts:quality-strategist` | Standard | Release readiness, risk assessment |
|
|
138
|
-
| `/prompts:build-fixer` | Standard | Build/toolchain failures |
|
|
139
|
-
| `/prompts:designer` | Standard | UX/UI architecture |
|
|
140
|
-
| `/prompts:writer` | Low | Docs, migration notes |
|
|
141
|
-
| `/prompts:qa-tester` | Standard | Interactive CLI validation |
|
|
142
|
-
| `/prompts:scientist` | Standard | Data/statistical analysis |
|
|
143
|
-
| `/prompts:git-master` | Standard | Commit strategy, history hygiene |
|
|
144
|
-
| `/prompts:researcher` | Standard | External documentation research |
|
|
145
|
-
|
|
146
|
-
### Product
|
|
147
|
-
| Agent | Tier | Description |
|
|
148
|
-
|-------|------|-------------|
|
|
149
|
-
| `/prompts:product-manager` | Standard | Problem framing, PRDs |
|
|
150
|
-
| `/prompts:ux-researcher` | Standard | Heuristic audits, usability |
|
|
151
|
-
| `/prompts:information-architect` | Standard | Taxonomy, navigation |
|
|
152
|
-
| `/prompts:product-analyst` | Standard | Product metrics, experiments |
|
|
153
|
-
|
|
154
|
-
### Coordination
|
|
155
|
-
| Agent | Tier | Description |
|
|
156
|
-
|-------|------|-------------|
|
|
157
|
-
| `/prompts:critic` | High | Plan/design critical challenge |
|
|
158
|
-
| `/prompts:vision` | Standard | Image/screenshot analysis |
|
|
159
|
-
|
|
160
|
-
## Skills (39 skills)
|
|
161
|
-
|
|
162
|
-
Invoke skills with `$name` in Codex CLI (e.g., `$autopilot "build a REST API"`).
|
|
163
|
-
|
|
164
|
-
### Execution Modes
|
|
165
|
-
| Skill | Description |
|
|
166
|
-
|-------|-------------|
|
|
167
|
-
| `$autopilot` | Full autonomous execution from idea to working code |
|
|
168
|
-
| `$ralph` | Persistence loop with architect verification |
|
|
169
|
-
| `$ultrawork` (`$ulw`) | Maximum parallelism with parallel agent orchestration |
|
|
170
|
-
| `$team` | N coordinated agents on shared task list |
|
|
171
|
-
| `$pipeline` | Sequential agent chaining with data passing |
|
|
172
|
-
| `$ecomode` | Token-efficient execution using lightweight models |
|
|
173
|
-
| `$ultrapilot` | Parallel autopilot with file ownership partitioning |
|
|
174
|
-
| `$ultraqa` | QA cycling: test, verify, fix, repeat |
|
|
175
|
-
|
|
176
|
-
### Planning
|
|
177
|
-
| Skill | Description |
|
|
178
|
-
|-------|-------------|
|
|
179
|
-
| `$plan` | Strategic planning with optional consensus/review modes |
|
|
180
|
-
| `$ralplan` | Consensus planning (planner + architect + critic) |
|
|
181
|
-
|
|
182
|
-
### Agent Shortcuts
|
|
183
|
-
| Skill | Routes To | Trigger |
|
|
184
|
-
|-------|-----------|---------|
|
|
185
|
-
| `$analyze` | debugger | "analyze", "debug", "investigate" |
|
|
186
|
-
| `$deepsearch` | explore | "search", "find in codebase" |
|
|
187
|
-
| `$tdd` | test-engineer | "tdd", "test first" |
|
|
188
|
-
| `$build-fix` | build-fixer | "fix build", "type errors" |
|
|
189
|
-
| `$code-review` | code-reviewer | "review code" |
|
|
190
|
-
| `$security-review` | security-reviewer | "security review" |
|
|
191
|
-
| `$frontend-ui-ux` | designer | UI/component work |
|
|
192
|
-
| `$git-master` | git-master | Git/commit work |
|
|
193
|
-
|
|
194
|
-
### Utilities
|
|
195
|
-
`$cancel` `$doctor` `$help` `$note` `$trace` `$skill` `$learner` `$research` `$deepinit` `$release` `$hud` `$omx-setup` `$configure-telegram` `$configure-discord` `$writer-memory` `$psm` `$ralph-init` `$learn-about-omx` `$review`
|
|
196
|
-
|
|
197
|
-
## MCP Servers
|
|
198
|
-
|
|
199
|
-
OMX provides two MCP servers configured via `config.toml`:
|
|
200
|
-
|
|
201
|
-
- **`omx_state`** -- Mode lifecycle state (autopilot, ralph, ultrawork, team, etc.)
|
|
202
|
-
- **`omx_memory`** -- Project memory and session notepad
|
|
203
|
-
|
|
204
|
-
## Magic Keywords
|
|
205
|
-
|
|
206
|
-
The AGENTS.md orchestration brain detects keywords and activates skills automatically:
|
|
207
|
-
|
|
208
|
-
| Say this... | Activates |
|
|
209
|
-
|-------------|-----------|
|
|
210
|
-
| "ralph", "don't stop", "keep going" | `$ralph` persistence loop |
|
|
211
|
-
| "autopilot", "build me" | `$autopilot` autonomous pipeline |
|
|
212
|
-
| "team", "coordinated team" | `$team` multi-agent orchestration |
|
|
213
|
-
| "plan this", "let's plan" | `$plan` strategic planning |
|
|
214
|
-
| "fix build", "type errors" | `$build-fix` build error resolution |
|
|
215
|
-
|
|
216
|
-
## CLI Commands
|
|
87
|
+
## Main Commands
|
|
217
88
|
|
|
218
89
|
```bash
|
|
219
|
-
omx
|
|
220
|
-
omx
|
|
221
|
-
omx
|
|
222
|
-
omx --
|
|
223
|
-
omx
|
|
224
|
-
omx
|
|
225
|
-
omx
|
|
226
|
-
omx
|
|
227
|
-
omx tmux-hook #
|
|
228
|
-
omx
|
|
229
|
-
omx
|
|
230
|
-
omx cancel # Cancel active execution modes
|
|
231
|
-
omx hud # Show HUD statusline (--watch, --json, --preset=NAME)
|
|
232
|
-
omx version # Print version info
|
|
233
|
-
omx help # Usage guide
|
|
90
|
+
omx # Launch Codex (+ HUD in tmux when available)
|
|
91
|
+
omx setup # Install prompts, skills, config wiring, AGENTS.md
|
|
92
|
+
omx doctor # Installation/runtime diagnostics
|
|
93
|
+
omx doctor --team # Team/swarm diagnostics
|
|
94
|
+
omx team ... # Start/status/resume/shutdown tmux team workers
|
|
95
|
+
omx status # Show active modes
|
|
96
|
+
omx cancel # Cancel active execution modes
|
|
97
|
+
omx reasoning <mode> # low|medium|high|xhigh
|
|
98
|
+
omx tmux-hook ... # init|status|validate|test
|
|
99
|
+
omx hud ... # --watch|--json|--preset
|
|
100
|
+
omx help
|
|
234
101
|
```
|
|
235
102
|
|
|
236
|
-
## Launch
|
|
237
|
-
|
|
238
|
-
- `--yolo`
|
|
239
|
-
Launch shorthand for `omx launch --yolo`.
|
|
240
|
-
|
|
241
|
-
- `--madmax`
|
|
242
|
-
Launches Codex with `--dangerously-bypass-approvals-and-sandbox` (native Codex flag).
|
|
243
|
-
This bypasses approval prompts and sandboxing.
|
|
244
|
-
Use only in externally sandboxed/trusted environments.
|
|
245
|
-
|
|
246
|
-
- `--high`
|
|
247
|
-
Launches Codex with reasoning effort set to `high` (default).
|
|
103
|
+
## Launch Flags
|
|
248
104
|
|
|
249
|
-
|
|
250
|
-
|
|
105
|
+
```bash
|
|
106
|
+
--yolo
|
|
107
|
+
--high
|
|
108
|
+
--xhigh
|
|
109
|
+
--madmax
|
|
110
|
+
--force
|
|
111
|
+
--dry-run
|
|
112
|
+
--verbose
|
|
113
|
+
```
|
|
251
114
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
Use this for maximum throughput in trusted environments with external sandboxing.
|
|
115
|
+
`--madmax` maps to Codex `--dangerously-bypass-approvals-and-sandbox`.
|
|
116
|
+
Use it only in trusted/external sandbox environments.
|
|
255
117
|
|
|
256
|
-
##
|
|
118
|
+
## Codex-First Prompt Control
|
|
257
119
|
|
|
258
|
-
|
|
120
|
+
By default, OMX injects:
|
|
259
121
|
|
|
260
|
-
|
|
122
|
+
```text
|
|
123
|
+
-c model_instructions_file="<cwd>/AGENTS.md"
|
|
124
|
+
```
|
|
261
125
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
- Guardrails: allowed-mode gating, dedupe keying, cooldown, max injections/session, marker loop guard
|
|
265
|
-
- Failures are non-fatal and logged
|
|
126
|
+
This layers project `AGENTS.md` guidance into Codex launch instructions.
|
|
127
|
+
It extends Codex behavior, but does not replace/bypass Codex core system policies.
|
|
266
128
|
|
|
267
|
-
|
|
129
|
+
Controls:
|
|
268
130
|
|
|
269
131
|
```bash
|
|
270
|
-
omx
|
|
132
|
+
OMX_BYPASS_DEFAULT_SYSTEM_PROMPT=0 omx # disable AGENTS.md injection
|
|
133
|
+
OMX_MODEL_INSTRUCTIONS_FILE=/path/to/instructions.md omx
|
|
271
134
|
```
|
|
272
135
|
|
|
273
|
-
|
|
136
|
+
## Team Mode
|
|
274
137
|
|
|
275
|
-
|
|
276
|
-
omx tmux-hook status
|
|
277
|
-
```
|
|
138
|
+
Use team mode for broad work that benefits from parallel workers.
|
|
278
139
|
|
|
279
|
-
|
|
140
|
+
Lifecycle:
|
|
280
141
|
|
|
281
|
-
```
|
|
282
|
-
|
|
142
|
+
```text
|
|
143
|
+
start -> assign scoped lanes -> monitor -> verify terminal tasks -> shutdown
|
|
283
144
|
```
|
|
284
145
|
|
|
285
|
-
|
|
146
|
+
Operational commands:
|
|
286
147
|
|
|
287
148
|
```bash
|
|
288
|
-
omx
|
|
149
|
+
omx team <args>
|
|
150
|
+
omx team status <team-name>
|
|
151
|
+
omx team resume <team-name>
|
|
152
|
+
omx team shutdown <team-name>
|
|
289
153
|
```
|
|
290
154
|
|
|
291
|
-
|
|
292
|
-
Runtime state: `.omx/state/tmux-hook-state.json`
|
|
293
|
-
Structured logs: `.omx/logs/tmux-hook-YYYY-MM-DD.jsonl`
|
|
294
|
-
|
|
295
|
-
Compatibility note:
|
|
296
|
-
- OMX writes `notify` as a TOML array by default.
|
|
297
|
-
- Override with `OMX_NOTIFY_FORMAT=string` before `omx setup` for environments that require string notify syntax.
|
|
298
|
-
|
|
299
|
-
## Setup Details
|
|
155
|
+
Important rule: do not shutdown while tasks are still `in_progress` unless aborting.
|
|
300
156
|
|
|
301
|
-
`omx setup`
|
|
157
|
+
## What `omx setup` writes
|
|
302
158
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
159
|
+
- `~/.codex/prompts/` (30 prompt files)
|
|
160
|
+
- `~/.agents/skills/` (40 skills)
|
|
161
|
+
- `~/.codex/config.toml` updates:
|
|
162
|
+
- `notify = ["node", "..."]`
|
|
163
|
+
- `model_reasoning_effort = "high"`
|
|
164
|
+
- `developer_instructions = "..."`
|
|
165
|
+
- `[features] collab = true, child_agents_md = true`
|
|
166
|
+
- MCP server entries (`omx_state`, `omx_memory`, `omx_code_intel`, `omx_trace`)
|
|
167
|
+
- `[tui] status_line`
|
|
168
|
+
- Project `AGENTS.md`
|
|
169
|
+
- `.omx/` runtime directories and HUD config
|
|
310
170
|
|
|
311
|
-
|
|
171
|
+
## Agents and Skills
|
|
312
172
|
|
|
313
|
-
|
|
173
|
+
- Prompts: `prompts/*.md` (installed to `~/.codex/prompts/`)
|
|
174
|
+
- Skills: `skills/*/SKILL.md` (installed to `~/.agents/skills/`)
|
|
314
175
|
|
|
315
|
-
|
|
176
|
+
Examples:
|
|
177
|
+
- Agents: `architect`, `planner`, `executor`, `debugger`, `verifier`, `security-reviewer`
|
|
178
|
+
- Skills: `autopilot`, `plan`, `team`, `ralph`, `ultrawork`, `ultrapilot`, `research`, `cancel`
|
|
316
179
|
|
|
317
|
-
## Project
|
|
180
|
+
## Project Layout
|
|
318
181
|
|
|
319
|
-
```
|
|
182
|
+
```text
|
|
320
183
|
oh-my-codex/
|
|
321
|
-
bin/omx.js
|
|
184
|
+
bin/omx.js
|
|
322
185
|
src/
|
|
323
|
-
cli/
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
modes/
|
|
330
|
-
|
|
331
|
-
verification/
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
templates/ # AGENTS.md template
|
|
337
|
-
scripts/ # notify-hook.js, tmux-hook-engine.js
|
|
186
|
+
cli/
|
|
187
|
+
team/
|
|
188
|
+
mcp/
|
|
189
|
+
hooks/
|
|
190
|
+
hud/
|
|
191
|
+
config/
|
|
192
|
+
modes/
|
|
193
|
+
notifications/
|
|
194
|
+
verification/
|
|
195
|
+
prompts/
|
|
196
|
+
skills/
|
|
197
|
+
templates/
|
|
198
|
+
scripts/
|
|
338
199
|
```
|
|
339
200
|
|
|
340
201
|
## Development
|
|
@@ -344,13 +205,17 @@ git clone https://github.com/Yeachan-Heo/oh-my-codex.git
|
|
|
344
205
|
cd oh-my-codex
|
|
345
206
|
npm install
|
|
346
207
|
npm run build
|
|
347
|
-
npm
|
|
348
|
-
omx setup && omx doctor
|
|
208
|
+
npm test
|
|
349
209
|
```
|
|
350
210
|
|
|
211
|
+
## Notes
|
|
212
|
+
|
|
213
|
+
- Coverage and parity notes: `COVERAGE.md`
|
|
214
|
+
- Setup and contribution details: `CONTRIBUTING.md`
|
|
215
|
+
|
|
351
216
|
## Acknowledgments
|
|
352
217
|
|
|
353
|
-
|
|
218
|
+
Inspired by [oh-my-claudecode](https://github.com/Yeachan-Heo/oh-my-claudecode), adapted for Codex CLI.
|
|
354
219
|
|
|
355
220
|
## License
|
|
356
221
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it } from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import { normalizeCodexLaunchArgs, buildTmuxShellCommand, buildTmuxSessionName, readTopLevelTomlString, upsertTopLevelTomlString, collectInheritableTeamWorkerArgs, resolveTeamWorkerLaunchArgsEnv, } from '../index.js';
|
|
3
|
+
import { normalizeCodexLaunchArgs, buildTmuxShellCommand, buildTmuxSessionName, readTopLevelTomlString, upsertTopLevelTomlString, collectInheritableTeamWorkerArgs, resolveTeamWorkerLaunchArgsEnv, injectModelInstructionsBypassArgs, } from '../index.js';
|
|
4
4
|
describe('normalizeCodexLaunchArgs', () => {
|
|
5
5
|
it('maps --madmax to codex bypass flag', () => {
|
|
6
6
|
assert.deepEqual(normalizeCodexLaunchArgs(['--madmax']), ['--dangerously-bypass-approvals-and-sandbox']);
|
|
@@ -76,6 +76,24 @@ describe('readTopLevelTomlString', () => {
|
|
|
76
76
|
assert.equal(value, null);
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
+
describe('injectModelInstructionsBypassArgs', () => {
|
|
80
|
+
it('appends model_instructions_file override by default', () => {
|
|
81
|
+
const args = injectModelInstructionsBypassArgs('/tmp/my-project', ['--model', 'gpt-5'], {});
|
|
82
|
+
assert.deepEqual(args, ['--model', 'gpt-5', '-c', 'model_instructions_file="/tmp/my-project/AGENTS.md"']);
|
|
83
|
+
});
|
|
84
|
+
it('does not append when bypass is disabled via env', () => {
|
|
85
|
+
const args = injectModelInstructionsBypassArgs('/tmp/my-project', ['--model', 'gpt-5'], { OMX_BYPASS_DEFAULT_SYSTEM_PROMPT: '0' });
|
|
86
|
+
assert.deepEqual(args, ['--model', 'gpt-5']);
|
|
87
|
+
});
|
|
88
|
+
it('does not append when model_instructions_file is already set', () => {
|
|
89
|
+
const args = injectModelInstructionsBypassArgs('/tmp/my-project', ['-c', 'model_instructions_file="/tmp/custom.md"'], {});
|
|
90
|
+
assert.deepEqual(args, ['-c', 'model_instructions_file="/tmp/custom.md"']);
|
|
91
|
+
});
|
|
92
|
+
it('respects OMX_MODEL_INSTRUCTIONS_FILE env override', () => {
|
|
93
|
+
const args = injectModelInstructionsBypassArgs('/tmp/my-project', [], { OMX_MODEL_INSTRUCTIONS_FILE: '/tmp/alt instructions.md' });
|
|
94
|
+
assert.deepEqual(args, ['-c', 'model_instructions_file="/tmp/alt instructions.md"']);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
79
97
|
describe('upsertTopLevelTomlString', () => {
|
|
80
98
|
it('replaces an existing top-level key', () => {
|
|
81
99
|
const updated = upsertTopLevelTomlString('model_reasoning_effort = "low"\n[tui]\nstatus_line = []\n', 'model_reasoning_effort', 'high');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,8BAA8B,
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,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CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,0CAA0C,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,IAAI,GAAG,iCAAiC,CAC5C,iBAAiB,EACjB,EAAE,EACF,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,CAC5D,CAAC;QACF,MAAM,CAAC,SAAS,CACd,IAAI,EACJ,CAAC,IAAI,EAAE,oDAAoD,CAAC,CAC7D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,OAAO,GAAG,wBAAwB,CACtC,2DAA2D,EAC3D,wBAAwB,EACxB,MAAM,CACP,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,oCAAoC,CAAC,CAAC;QAC5D,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,mCAAmC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,OAAO,GAAG,wBAAwB,CACtC,2BAA2B,EAC3B,wBAAwB,EACxB,OAAO,CACR,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,6DAA6D,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function main(args: string[]): Promise<void>;
|
|
6
6
|
export declare function normalizeCodexLaunchArgs(args: string[]): string[];
|
|
7
|
+
export declare function injectModelInstructionsBypassArgs(cwd: string, args: string[], env?: NodeJS.ProcessEnv): string[];
|
|
7
8
|
export declare function collectInheritableTeamWorkerArgs(codexArgs: string[]): string[];
|
|
8
9
|
export declare function resolveTeamWorkerLaunchArgsEnv(existingRaw: string | undefined, codexArgs: string[], inheritLeaderFlags?: boolean): string | null;
|
|
9
10
|
export declare function readTopLevelTomlString(content: string, key: string): string | null;
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmEH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmExD;AAgGD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA2CjE;AAsCD,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,EAAE,CAI7H;AAUD,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAwB9E;AA+BD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,kBAAkB,UAAO,GAAG,MAAM,GAAG,IAAI,CAM7I;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgBlF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAyC5F;AAsBD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAgB3E;AAwGD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7E"}
|
package/dist/cli/index.js
CHANGED
|
@@ -51,9 +51,13 @@ const CODEX_BYPASS_FLAG = '--dangerously-bypass-approvals-and-sandbox';
|
|
|
51
51
|
const HIGH_REASONING_FLAG = '--high';
|
|
52
52
|
const XHIGH_REASONING_FLAG = '--xhigh';
|
|
53
53
|
const CONFIG_FLAG = '-c';
|
|
54
|
+
const LONG_CONFIG_FLAG = '--config';
|
|
54
55
|
const REASONING_KEY = 'model_reasoning_effort';
|
|
56
|
+
const MODEL_INSTRUCTIONS_FILE_KEY = 'model_instructions_file';
|
|
55
57
|
const TEAM_WORKER_LAUNCH_ARGS_ENV = 'OMX_TEAM_WORKER_LAUNCH_ARGS';
|
|
56
58
|
const TEAM_INHERIT_LEADER_FLAGS_ENV = 'OMX_TEAM_INHERIT_LEADER_FLAGS';
|
|
59
|
+
const OMX_BYPASS_DEFAULT_SYSTEM_PROMPT_ENV = 'OMX_BYPASS_DEFAULT_SYSTEM_PROMPT';
|
|
60
|
+
const OMX_MODEL_INSTRUCTIONS_FILE_ENV = 'OMX_MODEL_INSTRUCTIONS_FILE';
|
|
57
61
|
const REASONING_MODES = ['low', 'medium', 'high', 'xhigh'];
|
|
58
62
|
const REASONING_MODE_SET = new Set(REASONING_MODES);
|
|
59
63
|
const REASONING_USAGE = 'Usage: omx reasoning <low|medium|high|xhigh>';
|
|
@@ -251,6 +255,41 @@ export function normalizeCodexLaunchArgs(args) {
|
|
|
251
255
|
function isReasoningOverride(value) {
|
|
252
256
|
return new RegExp(`^${REASONING_KEY}\\s*=`).test(value.trim());
|
|
253
257
|
}
|
|
258
|
+
function isModelInstructionsOverride(value) {
|
|
259
|
+
return new RegExp(`^${MODEL_INSTRUCTIONS_FILE_KEY}\\s*=`).test(value.trim());
|
|
260
|
+
}
|
|
261
|
+
function hasModelInstructionsOverride(args) {
|
|
262
|
+
for (let i = 0; i < args.length; i++) {
|
|
263
|
+
const arg = args[i];
|
|
264
|
+
if (arg === CONFIG_FLAG || arg === LONG_CONFIG_FLAG) {
|
|
265
|
+
const maybeValue = args[i + 1];
|
|
266
|
+
if (typeof maybeValue === 'string' && isModelInstructionsOverride(maybeValue)) {
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (arg.startsWith(`${LONG_CONFIG_FLAG}=`)) {
|
|
272
|
+
const inlineValue = arg.slice(`${LONG_CONFIG_FLAG}=`.length);
|
|
273
|
+
if (isModelInstructionsOverride(inlineValue))
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
function shouldBypassDefaultSystemPrompt(env) {
|
|
280
|
+
return env[OMX_BYPASS_DEFAULT_SYSTEM_PROMPT_ENV] !== '0';
|
|
281
|
+
}
|
|
282
|
+
function buildModelInstructionsOverride(cwd, env) {
|
|
283
|
+
const filePath = env[OMX_MODEL_INSTRUCTIONS_FILE_ENV] || join(cwd, 'AGENTS.md');
|
|
284
|
+
return `${MODEL_INSTRUCTIONS_FILE_KEY}="${escapeTomlString(filePath)}"`;
|
|
285
|
+
}
|
|
286
|
+
export function injectModelInstructionsBypassArgs(cwd, args, env = process.env) {
|
|
287
|
+
if (!shouldBypassDefaultSystemPrompt(env))
|
|
288
|
+
return [...args];
|
|
289
|
+
if (hasModelInstructionsOverride(args))
|
|
290
|
+
return [...args];
|
|
291
|
+
return [...args, CONFIG_FLAG, buildModelInstructionsOverride(cwd, env)];
|
|
292
|
+
}
|
|
254
293
|
function splitWorkerLaunchArgs(raw) {
|
|
255
294
|
if (!raw || raw.trim() === '')
|
|
256
295
|
return [];
|
|
@@ -456,11 +495,12 @@ async function preLaunch(cwd, sessionId) {
|
|
|
456
495
|
* All 3 paths (new tmux, existing tmux, no tmux) block via execSync/execFileSync.
|
|
457
496
|
*/
|
|
458
497
|
function runCodex(cwd, args) {
|
|
498
|
+
const launchArgs = injectModelInstructionsBypassArgs(cwd, args);
|
|
459
499
|
const omxBin = process.argv[1];
|
|
460
|
-
const codexCmd = buildTmuxShellCommand('codex',
|
|
500
|
+
const codexCmd = buildTmuxShellCommand('codex', launchArgs);
|
|
461
501
|
const hudCmd = buildTmuxShellCommand('node', [omxBin, 'hud', '--watch']);
|
|
462
502
|
const inheritLeaderFlags = process.env[TEAM_INHERIT_LEADER_FLAGS_ENV] !== '0';
|
|
463
|
-
const workerLaunchArgs = resolveTeamWorkerLaunchArgsEnv(process.env[TEAM_WORKER_LAUNCH_ARGS_ENV],
|
|
503
|
+
const workerLaunchArgs = resolveTeamWorkerLaunchArgsEnv(process.env[TEAM_WORKER_LAUNCH_ARGS_ENV], launchArgs, inheritLeaderFlags);
|
|
464
504
|
const codexEnv = workerLaunchArgs
|
|
465
505
|
? { ...process.env, [TEAM_WORKER_LAUNCH_ARGS_ENV]: workerLaunchArgs }
|
|
466
506
|
: process.env;
|
|
@@ -474,7 +514,7 @@ function runCodex(cwd, args) {
|
|
|
474
514
|
}
|
|
475
515
|
// execFileSync imported at top level
|
|
476
516
|
try {
|
|
477
|
-
execFileSync('codex',
|
|
517
|
+
execFileSync('codex', launchArgs, { cwd, stdio: 'inherit', env: codexEnv });
|
|
478
518
|
}
|
|
479
519
|
catch {
|
|
480
520
|
// Codex exited
|
|
@@ -502,7 +542,7 @@ function runCodex(cwd, args) {
|
|
|
502
542
|
console.log('tmux not available, launching codex without HUD...');
|
|
503
543
|
// execFileSync imported at top level
|
|
504
544
|
try {
|
|
505
|
-
execFileSync('codex',
|
|
545
|
+
execFileSync('codex', launchArgs, { cwd, stdio: 'inherit', env: codexEnv });
|
|
506
546
|
}
|
|
507
547
|
catch {
|
|
508
548
|
// Codex exited
|