ralph-codex 0.1.1 → 0.1.2
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/CHANGELOG.md +4 -1
- package/README.md +106 -4
- package/package.json +1 -1
- package/src/commands/docker.js +4 -4
- package/src/commands/plan.js +7 -1
- package/src/commands/run.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.1.2] - 2026-01-22
|
|
6
|
+
- Improved README with setup, defaults, Docker guidance, and troubleshooting.
|
|
7
|
+
|
|
5
8
|
## [0.1.1] - 2026-01-22
|
|
6
|
-
- Added shell completion command
|
|
9
|
+
- Added shell completion command (bash/zsh/fish) with dynamic suggestions.
|
|
7
10
|
|
|
8
11
|
## [0.1.0] - 2026-01-21
|
|
9
12
|
- Initial release.
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# ralph-codex
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
Codex-first Ralph-style planning and run loops.
|
|
4
6
|
|
|
5
7
|
## What it does
|
|
@@ -9,7 +11,14 @@ Codex-first Ralph-style planning and run loops.
|
|
|
9
11
|
- Optional Docker mode for reproducible runs.
|
|
10
12
|
- Colorized Codex output in TTY for easier scanning (disable with `NO_COLOR=1`).
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
## How it works
|
|
15
|
+
|
|
16
|
+
- `plan` asks for success criteria, runs Codex, and writes `tasks.md`.
|
|
17
|
+
- `run` executes tasks until `LOOP_COMPLETE`, updating `.ralph/` state and logs.
|
|
18
|
+
- `revise` adds new tasks from feedback without touching existing items.
|
|
19
|
+
- `view` and `reset` help you inspect and reset task status.
|
|
20
|
+
|
|
21
|
+

|
|
13
22
|
|
|
14
23
|
## Requirements
|
|
15
24
|
|
|
@@ -17,6 +26,19 @@ Codex-first Ralph-style planning and run loops.
|
|
|
17
26
|
- Codex CLI installed and authenticated (`codex` available in PATH)
|
|
18
27
|
- Docker (optional, only for Docker mode)
|
|
19
28
|
|
|
29
|
+
## Codex CLI setup
|
|
30
|
+
|
|
31
|
+
Install and verify:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g @openai/codex
|
|
35
|
+
codex --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Authenticate using the Codex CLI and/or create a profile in `~/.codex/config.toml`.
|
|
39
|
+
Follow the auth guide at https://developers.openai.com/codex/auth.
|
|
40
|
+
If you use profiles, pass `--profile` or set `codex.profile` in `ralph.config.yml`.
|
|
41
|
+
|
|
20
42
|
## Install
|
|
21
43
|
|
|
22
44
|
```bash
|
|
@@ -36,6 +58,45 @@ ralph-codex view
|
|
|
36
58
|
ralph-codex reset
|
|
37
59
|
```
|
|
38
60
|
|
|
61
|
+
## Demo (sample output)
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
$ ralph-codex plan "Add screenshot flow"
|
|
65
|
+
... (interactive prompts) ...
|
|
66
|
+
tasks.md written
|
|
67
|
+
$ ralph-codex run
|
|
68
|
+
... (loop output) ...
|
|
69
|
+
LOOP_COMPLETE
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Cookbook
|
|
73
|
+
|
|
74
|
+
### Basic flow
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
ralph-codex init
|
|
78
|
+
ralph-codex plan "Add screenshot flow for /demo" --output tasks.md
|
|
79
|
+
ralph-codex run --max-iterations 10
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Docker flow
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ralph-codex docker
|
|
86
|
+
# Ensure docker.codex_install is set in ralph.config.yml
|
|
87
|
+
ralph-codex plan "Add screenshot flow for /demo"
|
|
88
|
+
ralph-codex run
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Low-touch automation (still interactive)
|
|
92
|
+
|
|
93
|
+
Use a prefilled config and pass flags to minimize prompts. This CLI still expects a TTY.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
ralph-codex plan "Add screenshot flow" --full-auto --reasoning low
|
|
97
|
+
ralph-codex run --full-auto --reasoning low
|
|
98
|
+
```
|
|
99
|
+
|
|
39
100
|
## Command reference
|
|
40
101
|
|
|
41
102
|
Use `--help` with any command to see its available options.
|
|
@@ -174,6 +235,7 @@ run:
|
|
|
174
235
|
max_iterations: 15
|
|
175
236
|
max_iteration_seconds: null
|
|
176
237
|
max_total_seconds: null
|
|
238
|
+
completion_promise: LOOP_COMPLETE
|
|
177
239
|
```
|
|
178
240
|
|
|
179
241
|
Codex settings quick guide:
|
|
@@ -187,6 +249,20 @@ Enable `plan.auto_detect_success_criteria` to add detected checks based on repo
|
|
|
187
249
|
|
|
188
250
|
CLI flags always override config values.
|
|
189
251
|
|
|
252
|
+
## Defaults
|
|
253
|
+
|
|
254
|
+
Defaults are from the template `ralph.config.yml`.
|
|
255
|
+
|
|
256
|
+
| Setting | Default | Details |
|
|
257
|
+
| --- | --- | --- |
|
|
258
|
+
| `plan.tasks_path` | `tasks.md` | Output path for generated tasks. |
|
|
259
|
+
| `plan.auto_detect_success_criteria` | `false` | Detect and suggest checks from the repo. |
|
|
260
|
+
| `run.tasks_path` | `tasks.md` | Input path for tasks during runs. |
|
|
261
|
+
| `run.max_iterations` | `15` | Max loop iterations before stopping. |
|
|
262
|
+
| `run.completion_promise` | `LOOP_COMPLETE` | Completion token printed by the loop. |
|
|
263
|
+
| `docker.enabled` | `false` | Enable Docker execution. |
|
|
264
|
+
| `docker.use_for_plan` | `false` | Run planning inside Docker too. |
|
|
265
|
+
|
|
190
266
|
## Docker mode
|
|
191
267
|
|
|
192
268
|
1. Run `ralph-codex docker` to pick a base image.
|
|
@@ -194,6 +270,20 @@ CLI flags always override config values.
|
|
|
194
270
|
3. Run `ralph-codex plan` and `ralph-codex run` as usual. Enable `docker.use_for_plan`
|
|
195
271
|
if you want planning to happen inside Docker as well.
|
|
196
272
|
|
|
273
|
+
Why Docker (especially with `danger-full-access`):
|
|
274
|
+
- Isolation: lets you grant broad permissions inside the container without exposing your host.
|
|
275
|
+
- Reproducibility: consistent OS/package stack across runs and teammates.
|
|
276
|
+
- Safer cleanup: delete the container/image to reset state.
|
|
277
|
+
|
|
278
|
+
Why `danger-full-access`:
|
|
279
|
+
- Fewer approval prompts for tooling that needs broad filesystem or network access.
|
|
280
|
+
- Works better for complex build/test flows that span many paths.
|
|
281
|
+
- Faster iterations when you trust the environment (best paired with Docker).
|
|
282
|
+
|
|
283
|
+
> **Warning**: Avoid `danger-full-access` on your host unless you fully trust the prompts,
|
|
284
|
+
> scripts, and dependencies. It grants broad access to your machine and can write
|
|
285
|
+
> outside the repo. Prefer Docker when you need this mode.
|
|
286
|
+
|
|
197
287
|
`Dockerfile.ralph` is generated automatically when Docker is enabled.
|
|
198
288
|
|
|
199
289
|
## Files created
|
|
@@ -207,12 +297,24 @@ CLI flags always override config values.
|
|
|
207
297
|
Codex output is colorized when stdout is a TTY. Plan uses spinners and run shows a task
|
|
208
298
|
progress bar when interactive. Set `NO_COLOR=1` to disable color styling.
|
|
209
299
|
|
|
300
|
+
## Exit codes
|
|
301
|
+
|
|
302
|
+
- `0` success.
|
|
303
|
+
- `1` invalid usage or runtime error.
|
|
304
|
+
|
|
210
305
|
## Troubleshooting
|
|
211
306
|
|
|
212
307
|
- `codex: command not found` -> install Codex CLI and ensure it is in PATH.
|
|
308
|
+
- Auth errors (401/403) -> authenticate Codex CLI or select a valid profile.
|
|
309
|
+
- `Missing tasks.md` -> run `ralph-codex plan` first or pass `--tasks`.
|
|
213
310
|
- Docker errors -> start Docker Desktop/Colima and retry.
|
|
214
|
-
-
|
|
311
|
+
- Config read errors -> verify `ralph.config.yml` path or pass `--config`.
|
|
312
|
+
|
|
313
|
+
## Changelog and license
|
|
314
|
+
|
|
315
|
+
- Changelog: `CHANGELOG.md`
|
|
316
|
+
- License: `LICENSE` (MIT)
|
|
215
317
|
|
|
216
|
-
##
|
|
318
|
+
## Privacy
|
|
217
319
|
|
|
218
|
-
|
|
320
|
+
ralph-codex does not add its own telemetry. It sends prompts and context to the Codex CLI you configure; follow your Codex policies and settings.
|
package/package.json
CHANGED
package/src/commands/docker.js
CHANGED
|
@@ -122,12 +122,12 @@ function runCodex(prompt, codexConfig) {
|
|
|
122
122
|
|
|
123
123
|
function buildPrompt(nodeVersion) {
|
|
124
124
|
const nodeLine = nodeVersion ? `Node version: ${nodeVersion}` : "Node 20+";
|
|
125
|
-
return `
|
|
126
|
-
|
|
125
|
+
return `Find the best Docker base image for this project.
|
|
126
|
+
Consider that it needs to run npm scripts, native modules, and should avoid Alpine.
|
|
127
127
|
${nodeLine}
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
BASE_IMAGE: <
|
|
129
|
+
Respond with a single line in this format:
|
|
130
|
+
BASE_IMAGE: <image>`;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
async function main() {
|
package/src/commands/plan.js
CHANGED
|
@@ -675,6 +675,7 @@ Context scan (read-only):
|
|
|
675
675
|
pyproject.toml, requirements.txt, go.mod, Cargo.toml, pom.xml, build.gradle, Makefile,
|
|
676
676
|
.nvmrc, Dockerfile, etc. Only inspect files that exist.
|
|
677
677
|
- Use this context to infer file locations, tooling, and sensible commands.
|
|
678
|
+
- You may use read-only commands like ls, rg, and cat to inspect files.
|
|
678
679
|
|
|
679
680
|
Requirements:
|
|
680
681
|
- If there are open questions, ask them first and do not write ${tasksPath}.
|
|
@@ -693,13 +694,18 @@ Requirements:
|
|
|
693
694
|
- Tasks must be atomic, ordered, and verifiable. Include exact file paths,
|
|
694
695
|
commands to run (if any), and expected outcomes. Avoid vague verbs like "handle" or "improve".
|
|
695
696
|
- Keep scope minimal: avoid refactors unless required by the idea or to unblock tasks.
|
|
697
|
+
- Use this exact section order and headings in ${tasksPath}:
|
|
698
|
+
1) # Tasks
|
|
699
|
+
2) ## Assumptions (only if needed)
|
|
700
|
+
3) ## Success criteria
|
|
701
|
+
4) ## Required tools
|
|
696
702
|
${successCriteriaBlock}
|
|
697
703
|
- Include a "Required tools" section using this exact format:
|
|
698
704
|
- \`- apt: <comma-separated packages or none>\`
|
|
699
705
|
- \`- npm: <comma-separated packages or none>\`
|
|
700
706
|
- \`- pip: <comma-separated packages or none>\`
|
|
701
707
|
- Do not edit any files other than ${tasksPath}.
|
|
702
|
-
- Do not run commands, tests, or start dev servers during planning.
|
|
708
|
+
- Do not run write commands, tests, installs, or start dev servers during planning.
|
|
703
709
|
|
|
704
710
|
When done, output exactly: LOOP_COMPLETE
|
|
705
711
|
`;
|
package/src/commands/run.js
CHANGED
|
@@ -356,6 +356,8 @@ ${result.output}
|
|
|
356
356
|
Constraints:
|
|
357
357
|
- Only edit ${dockerConfig.dockerfile}
|
|
358
358
|
- Do not change other files
|
|
359
|
+
- Keep the existing base image unless the error requires changing it
|
|
360
|
+
- Do not add new dependencies unless required by the error
|
|
359
361
|
- Do not ask questions
|
|
360
362
|
- Output exactly: LOOP_COMPLETE
|
|
361
363
|
`;
|