You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: sync llms-full.txt with current CLI and feature set
Remove stale ralph init, ralph new, and ralph add sections that
referenced commands no longer in the CLI. Add peek (p key) docs,
update codebase map with _keypress.py and _brand.py, and fix
installed-ralph paths from .ralphify/ to .agents/ralphs/.
Co-authored-by: Ralphify <noreply@ralphify.co>
The fastest way to scaffold a ralph is `ralph init`:
149
+
The fastest way to scaffold a ralph is `ralph scaffold`:
150
150
151
151
```bash
152
-
ralph init my-ralph
152
+
ralph scaffold my-ralph
153
153
```
154
154
155
155
```text
@@ -159,18 +159,17 @@ Edit the file, then run: ralph run my-ralph
159
159
160
160
This creates `my-ralph/RALPH.md` with a ready-to-customize template including an example command, arg, and prompt. Edit the task section, [test it](#step-3-do-a-test-run), then follow [Step 4](#step-4-add-a-test-command) to add a test command — test feedback is what makes the loop self-healing.
161
161
162
-
Alternatively, use `ralph new` for AI-guided setup, or create the file manually as shown below.
162
+
Or create the file manually as shown below.
163
163
164
164
Installing an existing ralph?
165
165
166
-
If someone has shared a ralph on GitHub, skip the manual setup and install it directly:
166
+
Use [agr](https://github.com/computerlovetech/agr) to install shared ralphs from GitHub:
167
167
168
168
```bash
169
-
ralph add owner/repo
169
+
agr add owner/repo/my-ralph # install a ralph from GitHub
170
+
ralph run my-ralph # run it by name
170
171
```
171
172
172
-
This installs to `.ralphify/ralphs/` so you can run it by name with `ralph run <name>`. See the [CLI reference](cli.md#ralph-add) for all source formats.
173
-
174
173
### Manual setup
175
174
176
175
Create a ralph directory and `RALPH.md` with the agent field — this is the only required frontmatter:
@@ -582,12 +581,12 @@ This page shows how to configure the `agent` field in your RALPH.md for popular
582
581
583
582
## Agent comparison
584
583
585
-
| Agent | Stdin support | Streaming | `ralph new` support | Wrapper needed |
| [Aider](#aider) | Via bash wrapper | No | Yes (`bash -c`) |
588
+
| [Codex CLI](#codex-cli) | Native (`exec`) | No | No |
589
+
| [Custom](#custom-wrapper-script) | You implement it | No | Yes (script) |
591
590
592
591
If you're not sure which to pick: **start with Claude Code.** It has the deepest integration, the best autonomous coding capabilities, and is the default.
593
592
@@ -1616,15 +1615,8 @@ ralph run my-ralph --delay 10 # Wait 10s between iterations
1616
1615
ralph run my-ralph --timeout 300 # Kill agent after 5 min per iteration
1617
1616
ralph run my-ralph --dir ./src # Pass user args to the ralph
1618
1617
1619
-
ralph init my-task # Scaffold a ralph from template (no AI)
1620
-
ralph init # Scaffold in current directory
1621
-
1622
-
ralph new # AI-guided ralph creation
1623
-
ralph new docs # AI-guided creation with name pre-filled
1624
-
1625
-
ralph add owner/repo # Install ralph(s) from a GitHub repo
1626
-
ralph add owner/repo/my-ralph # Install a specific ralph by name
1627
-
ralph add https://github.com/owner/repo/tree/main/my-ralph # URL from GitHub
1618
+
ralph scaffold my-task # Scaffold a ralph from template
1619
+
ralph scaffold # Scaffold in current directory
1628
1620
1629
1621
ralph --version # Show version
1630
1622
```
@@ -1753,6 +1745,7 @@ Each iteration:
1753
1745
|---|---|
1754
1746
| `Ctrl+C` (once) | Finishes the current iteration gracefully, then stops |
1755
1747
| `Ctrl+C` (twice) | Force-kills the agent process and exits immediately |
1748
+
| `p` | Toggle live peek of the agent's stdout (on by default in an interactive terminal — press to silence, press again to resume) |
1756
1749
| `-n` limit reached | Stops after the specified number of iterations |
1757
1750
| `--stop-on-error` | Stops if agent exits non-zero or times out |
1758
1751
@@ -1761,17 +1754,6 @@ Each iteration:
1761
1754
- The prompt body is re-read from disk every iteration — edit the prompt while the loop runs (frontmatter is parsed once at startup)
1762
1755
- HTML comments (``) are stripped from the prompt — use them for notes to yourself
1763
1756
1764
-
## `ralph add` source formats
1765
-
1766
-
| Format | Example | What it does |
1767
-
|---|---|---|
1768
-
| Shorthand | `owner/repo` | Installs all ralphs in the repo (or the repo itself if root has `RALPH.md`) |
1769
-
| Subpath | `owner/repo/my-ralph` | Installs the ralph named `my-ralph` from the repo |
1770
-
| Full URL | `https://github.com/owner/repo` | Same as shorthand |
1771
-
| GitHub tree URL | `https://github.com/owner/repo/tree/main/my-ralph` | Extracts the path from the URL — works when you copy a URL from the GitHub browser UI |
1772
-
1773
-
Installed ralphs go to `.ralphify/ralphs//`. Re-running `ralph add` overwrites without warning (that's how you update). See the [CLI reference](cli.md) for full `ralph add` options.
1774
-
1775
1757
## Common patterns
1776
1758
1777
1759
### Minimal ralph
@@ -1885,7 +1867,7 @@ ralph run my-ralph --dir ./src # Pass user args to the ralph
| `PATH` | | (required) | Path to a ralph directory containing `RALPH.md`, a direct path to a `RALPH.md` file, or the name of an installed ralph (from `ralph add`) |
1870
+
| `PATH` | | (required) | Path to a ralph directory containing `RALPH.md`, a direct path to a `RALPH.md` file, or the name of an installed ralph in `.agents/ralphs/` |
1889
1871
| `-n` | | unlimited | Max number of iterations |
1890
1872
| `--stop-on-error` | `-s` | off | Stop loop if agent exits non-zero or times out |
1891
1873
| `--delay` | `-d` | `0` | Seconds to wait between iterations |
@@ -1947,70 +1929,30 @@ The loop also stops automatically when:
1947
1929
- All `-n` iterations have completed
1948
1930
- `--stop-on-error` is set and the agent exits non-zero or times out
1949
1931
1950
-
---
1951
-
1952
-
## `ralph init`
1953
-
1954
-
Scaffold a new ralph with a ready-to-customize template. No AI agent required. For a guided setup, see [`ralph new`](#ralph-new) instead.
1955
-
1956
-
```bash
1957
-
ralph init my-task # Creates my-task/RALPH.md with a generic template
1958
-
ralph init # Creates RALPH.md in the current directory
1959
-
```
1960
-
1961
-
| Argument | Default | Description |
1962
-
|---|---|---|
1963
-
| `[NAME]` | none | Directory name. If omitted, creates RALPH.md in the current directory |
1964
-
1965
-
The generated template includes an example command (`git-log`), an example arg (`focus`), and a prompt body with placeholders for both. Edit it, then run [`ralph run`](#ralph-run). See [Getting Started](getting-started.md) for a full walkthrough.
1966
-
1967
-
Errors if `RALPH.md` already exists at the target location.
1968
-
1969
-
---
1970
-
1971
-
## `ralph new`
1972
-
1973
-
Create a new ralph with AI-guided setup. Launches an interactive session where the agent guides you through creating a complete ralph via conversation.
1974
-
1975
-
```bash
1976
-
ralph new # Agent helps you choose a name and build everything
1977
-
ralph new my-task # Start with a name already chosen
1978
-
```
1932
+
### Peeking at live agent output
1979
1933
1980
-
| Argument | Default | Description |
1981
-
|---|---|---|
1982
-
| `[NAME]` | none | Name for the new ralph. If omitted, the agent will help you choose |
1934
+
When you run `ralph run` in an interactive terminal, the agent's stdout and stderr stream live to the console by default. Press `p` to silence the stream (useful for quieter loops) and press `p` again to resume it. The default is off whenever the output is not a real terminal (piped, redirected, or captured in CI), so `ralph run ... | cat` is unaffected.
1983
1935
1984
-
The command detects your [agent](agents.md) and installs a skill to guide the creation process.
1936
+
Live streaming works with line-buffered agents such as Claude Code, OpenAI Codex, Aider, and any other process that writes one line at a time. When `--log-dir` is set, output is captured to the log file and also echoed after each iteration completes; live peek still works the same way in that mode.
1985
1937
1986
1938
---
1987
1939
1988
-
## `ralph add`
1940
+
## `ralph scaffold`
1989
1941
1990
-
Add a ralph from a GitHub repository. Installs it to `.ralphify/ralphs//` so you can run it by name.
1942
+
Scaffold a new ralph with a ready-to-customize template.
1991
1943
1992
1944
```bash
1993
-
ralph add owner/repo # Install all ralphs in the repo
1994
-
ralph add owner/repo/ralph-name # Specific ralph by name
1995
-
ralph add https://github.com/owner/repo # Full GitHub URL
1996
-
ralph add https://github.com/owner/repo/tree/main/my-ralph # URL copied from GitHub browser
1945
+
ralph scaffold my-task # Creates my-task/RALPH.md with a generic template
1946
+
ralph scaffold # Creates RALPH.md in the current directory
1997
1947
```
1998
1948
1999
1949
| Argument | Default | Description |
2000
1950
|---|---|---|
2001
-
| `SOURCE` | required | GitHub source — shorthand (`owner/repo`), subpath (`owner/repo/path`), or full GitHub URL |
2002
-
2003
-
**How it resolves:**
2004
-
2005
-
- `owner/repo` — if the repo root contains `RALPH.md`, installs it as a single ralph named after the repo. Otherwise, finds and installs all ralphs in the repo.
2006
-
- `owner/repo/ralph-name` — searches the repo for a directory named `ralph-name` containing `RALPH.md`. If multiple matches are found, prints the paths and asks you to use the full subpath to disambiguate.
2007
-
- `https://github.com/owner/repo/tree/branch/path` — extracts the path from the URL. This is the format you get when you copy a URL from the GitHub web UI while browsing a directory. The branch name is used only to locate the path — `ralph add` always clones the default branch.
1951
+
| `[NAME]` | none | Directory name. If omitted, creates RALPH.md in the current directory |
2008
1952
2009
-
After adding, run the ralph by name:
1953
+
The generated template includes an example command (`git-log`), an example arg (`focus`), and a prompt body with placeholders for both. Edit it, then run [`ralph run`](#ralph-run). See [Getting Started](getting-started.md) for a full walkthrough.
2010
1954
2011
-
```bash
2012
-
ralph run ralph-name
2013
-
```
1955
+
Errors if `RALPH.md` already exists at the target location.
2014
1956
2015
1957
---
2016
1958
@@ -2485,19 +2427,19 @@ Common issues and how to fix them. If your problem isn't listed here, run [`ralp
2485
2427
2486
2428
### "is not a directory, RALPH.md file, or installed ralph"
2487
2429
2488
-
The path you passed to [`ralph run`](cli.md#ralph-run) doesn't resolve to a valid ralph. The command accepts a **directory** containing `RALPH.md`, a **direct path** to a `RALPH.md` file, or the **name of an installed ralph** (from [`ralph add`](cli.md#ralph-add)):
2430
+
The path you passed to [`ralph run`](cli.md#ralph-run) doesn't resolve to a valid ralph. The command accepts a **directory** containing `RALPH.md`, a **direct path** to a `RALPH.md` file, or the **name of an installed ralph** in `.agents/ralphs/`:
2489
2431
2490
2432
```bash
2491
2433
ralph run my-ralph # directory containing RALPH.md
2492
2434
ralph run my-ralph/RALPH.md # direct path to the file
2493
-
ralph run my-ralph # installed ralph in .ralphify/ralphs/my-ralph/
2435
+
ralph run my-ralph # installed ralph in .agents/ralphs/my-ralph/
2494
2436
```
2495
2437
2496
2438
If you're getting this error, check that the path exists and points to the right place:
2497
2439
2498
2440
```bash
2499
2441
ls my-ralph/RALPH.md # local ralph
2500
-
ls .ralphify/ralphs/my-ralph/RALPH.md # installed ralph
2442
+
ls .agents/ralphs/my-ralph/RALPH.md # installed ralph
2501
2443
```
2502
2444
2503
2445
### "Missing or empty 'agent' field in RALPH.md frontmatter"
@@ -2516,56 +2458,18 @@ The agent CLI isn't installed or isn't in your shell's PATH. Verify by running `
2516
2458
2517
2459
### "RALPH.md already exists"
2518
2460
2519
-
You ran [`ralph new`](cli.md#ralph-new) in a directory that already contains a `RALPH.md`. Either use a different directory name or edit the existing file:
2461
+
You ran [`ralph scaffold`](cli.md#ralph-scaffold) in a directory that already contains a `RALPH.md`. Either use a different directory name or edit the existing file:
2520
2462
2521
2463
```bash
2522
2464
# ✗ Fails — RALPH.md already exists in my-ralph/
2523
-
ralph new my-ralph
2465
+
ralph scaffold my-ralph
2524
2466
2525
2467
# ✓ Option A — use a different name
2526
-
ralph new my-other-ralph
2468
+
ralph scaffold my-other-ralph
2527
2469
2528
2470
# ✓ Option B — edit the existing file directly
2529
2471
```
2530
2472
2531
-
## `ralph add` issues
2532
-
2533
-
### "Cannot parse source"
2534
-
2535
-
The source format wasn't recognized. [`ralph add`](cli.md#ralph-add) accepts these formats:
2536
-
2537
-
```bash
2538
-
ralph add owner/repo # shorthand
2539
-
ralph add owner/repo/ralph-name # specific ralph
2540
-
ralph add https://github.com/owner/repo # full URL
2541
-
ralph add https://github.com/owner/repo/tree/main/my-ralph # URL copied from GitHub
2542
-
```
2543
-
2544
-
The easiest way to add a ralph from GitHub is to navigate to the directory in your browser and copy the URL — it works directly with `ralph add`.
2545
-
2546
-
### "git is required for 'ralph add'"
2547
-
2548
-
`ralph add` uses `git clone` under the hood. Install git from [git-scm.com](https://git-scm.com/) and make sure it's on your PATH:
2549
-
2550
-
```bash
2551
-
git --version
2552
-
```
2553
-
2554
-
### "git clone failed"
2555
-
2556
-
The repository couldn't be cloned. Common causes:
2557
-
2558
-
- The repository doesn't exist or has a typo in the owner/repo name
2559
-
- The repository is **private** — `ralph add` uses `git clone` under the hood, so your local git credentials must have access. If you can `git clone https://github.com/owner/repo.git` manually, `ralph add` will work too.
2560
-
2561
-
### "No RALPH.md found" / "No ralph named '...' found"
2562
-
2563
-
The repository was cloned successfully but no ralphs were found. Either the repo doesn't contain any `RALPH.md` files, or the ralph name you specified doesn't match any directory in the repo.
2564
-
2565
-
### Re-running `ralph add` overwrites without warning
2566
-
2567
-
If you `ralph add` a ralph that's already installed in `.ralphify/ralphs/`, the existing copy is replaced silently. This is by design — it's how you update an installed ralph to the latest version. If you've made local edits to an installed ralph, copy them elsewhere before re-adding.
2568
-
2569
2473
## Loop issues
2570
2474
2571
2475
### Agent produces no output or seems to hang
@@ -3517,21 +3421,19 @@ The core loop is simple. The complexity lives in **prompt assembly** — running
3517
3421
```
3518
3422
src/ralphify/ # All source code
3519
3423
├── __init__.py # Version detection + app entry point
3520
-
├── cli.py # CLI commands (run, new, init) — delegates to engine for the loop
3424
+
├── cli.py # CLI commands (run, scaffold) — delegates to engine for the loop
3521
3425
├── engine.py # Core run loop orchestration with structured event emission
3522
3426
├── manager.py # Multi-run orchestration (concurrent runs via threads)
└── new-ralph/ # AI-guided ralph creation skill for `ralph new`
3436
+
└── _brand.py # Brand color constants shared across CLI and console rendering
3535
3437
3536
3438
tests/ # Pytest tests — one test file per module
3537
3439
docs/ # MkDocs site (Material theme) — user-facing documentation
@@ -3615,7 +3517,6 @@ The CLI uses a `ConsoleEmitter` (defined in `_console_emitter.py`) that renders
3615
3517
3. **`cli.py`** — All CLI commands. Validates frontmatter fields via extracted helpers (`_validate_agent`, `_validate_commands`, `_validate_credit`, `_validate_run_options`, `_validate_declared_args`), builds a `RunConfig`, and delegates to `engine.run_loop()` for the actual loop. Terminal event rendering lives in `_console_emitter.py`.
3616
3518
4. **`_frontmatter.py`** — YAML frontmatter parsing. Extracts `agent`, `commands`, `args` from the RALPH.md file.
3617
3519
5. **`_resolver.py`** — Template placeholder logic. Small file but critical.
3618
-
6. **`_skills.py`** + **`skills/`** — The skill system behind `ralph new`. `_skills.py` handles agent detection, reads bundled skill definitions from `skills/`, installs them into the agent's skill directory, and builds the command to launch the agent.
3619
3520
3620
3521
## Traps and gotchas
3621
3522
@@ -3633,6 +3534,10 @@ Add it in `cli.py`. The CLI uses Typer. Update `docs/cli.md` to document the new
3633
3534
3634
3535
Events are defined in `_events.py:EventType`, with a corresponding TypedDict payload class for each type. Adding a new event type requires a new `EventType` member, a new TypedDict payload class, adding it to the `EventData` union, and handling it in `ConsoleEmitter` (`_console_emitter.py`).
3635
3536
3537
+
### Live agent output (peek)
3538
+
3539
+
Both execution paths in `_agent.py` accept an `on_output_line(line, stream)` callback and drain the agent's stdout/stderr line-by-line — the blocking path uses two background reader threads, and the streaming path forwards each raw line from `_read_agent_stream`. The engine wires this callback to emit `EventType.AGENT_OUTPUT_LINE` events, which the `ConsoleEmitter` renders only while peek is enabled. The `p` keybinding flips that state via `ConsoleEmitter.toggle_peek()`, driven by `KeypressListener` in `_keypress.py`. The listener only activates on a real TTY; in CI or when stdin is piped it silently no-ops.
3540
+
3636
3541
### Credit trailer
3637
3542
3638
3543
When `credit` is `true` (the default), `engine.py:_assemble_prompt()` appends `_CREDIT_INSTRUCTION` to the prompt — a short instruction telling the agent to include a `Co-authored-by: Ralphify` trailer in git commits. Users can opt out with `credit: false` in frontmatter.
0 commit comments