Skip to content

Commit bb27e79

Browse files
Kasper JungeRalphify
authored andcommitted
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>
1 parent eccab8c commit bb27e79

File tree

1 file changed

+39
-134
lines changed

1 file changed

+39
-134
lines changed

docs/llms-full.txt

Lines changed: 39 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ ralphify 0.3.0
146146

147147
## Step 2: Create a ralph
148148

149-
The fastest way to scaffold a ralph is `ralph init`:
149+
The fastest way to scaffold a ralph is `ralph scaffold`:
150150

151151
```bash
152-
ralph init my-ralph
152+
ralph scaffold my-ralph
153153
```
154154

155155
```text
@@ -159,18 +159,17 @@ Edit the file, then run: ralph run my-ralph
159159

160160
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.
161161

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.
163163

164164
Installing an existing ralph?
165165

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:
167167

168168
```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
170171
```
171172

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-
174173
### Manual setup
175174

176175
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
582581

583582
## Agent comparison
584583

585-
| Agent | Stdin support | Streaming | `ralph new` support | Wrapper needed |
586-
|---|---|---|---|---|
587-
| [Claude Code](#claude-code) | Native (`-p`) | Yes — real-time activity tracking | Yes | No |
588-
| [Aider](#aider) | Via bash wrapper | No | No | Yes (`bash -c`) |
589-
| [Codex CLI](#codex-cli) | Native (`exec`) | No | Yes | No |
590-
| [Custom](#custom-wrapper-script) | You implement it | No | No | Yes (script) |
584+
| Agent | Stdin support | Streaming | Wrapper needed |
585+
|---|---|---|---|
586+
| [Claude Code](#claude-code) | Native (`-p`) | Yes — real-time activity tracking | No |
587+
| [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) |
591590

592591
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.
593592

@@ -1616,15 +1615,8 @@ ralph run my-ralph --delay 10 # Wait 10s between iterations
16161615
ralph run my-ralph --timeout 300 # Kill agent after 5 min per iteration
16171616
ralph run my-ralph --dir ./src # Pass user args to the ralph
16181617

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
16281620

16291621
ralph --version # Show version
16301622
```
@@ -1753,6 +1745,7 @@ Each iteration:
17531745
|---|---|
17541746
| `Ctrl+C` (once) | Finishes the current iteration gracefully, then stops |
17551747
| `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) |
17561749
| `-n` limit reached | Stops after the specified number of iterations |
17571750
| `--stop-on-error` | Stops if agent exits non-zero or times out |
17581751

@@ -1761,17 +1754,6 @@ Each iteration:
17611754
- The prompt body is re-read from disk every iteration — edit the prompt while the loop runs (frontmatter is parsed once at startup)
17621755
- HTML comments (``) are stripped from the prompt — use them for notes to yourself
17631756

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-
17751757
## Common patterns
17761758

17771759
### Minimal ralph
@@ -1885,7 +1867,7 @@ ralph run my-ralph --dir ./src # Pass user args to the ralph
18851867

18861868
| Argument / Option | Short | Default | Description |
18871869
|---|---|---|---|
1888-
| `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/` |
18891871
| `-n` | | unlimited | Max number of iterations |
18901872
| `--stop-on-error` | `-s` | off | Stop loop if agent exits non-zero or times out |
18911873
| `--delay` | `-d` | `0` | Seconds to wait between iterations |
@@ -1947,70 +1929,30 @@ The loop also stops automatically when:
19471929
- All `-n` iterations have completed
19481930
- `--stop-on-error` is set and the agent exits non-zero or times out
19491931

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
19791933

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.
19831935

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.
19851937

19861938
---
19871939

1988-
## `ralph add`
1940+
## `ralph scaffold`
19891941

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.
19911943

19921944
```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
19971947
```
19981948

19991949
| Argument | Default | Description |
20001950
|---|---|---|
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 |
20081952

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.
20101954

2011-
```bash
2012-
ralph run ralph-name
2013-
```
1955+
Errors if `RALPH.md` already exists at the target location.
20141956

20151957
---
20161958

@@ -2485,19 +2427,19 @@ Common issues and how to fix them. If your problem isn't listed here, run [`ralp
24852427

24862428
### "is not a directory, RALPH.md file, or installed ralph"
24872429

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/`:
24892431

24902432
```bash
24912433
ralph run my-ralph # directory containing RALPH.md
24922434
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/
24942436
```
24952437

24962438
If you're getting this error, check that the path exists and points to the right place:
24972439

24982440
```bash
24992441
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
25012443
```
25022444

25032445
### "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 `
25162458

25172459
### "RALPH.md already exists"
25182460

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:
25202462

25212463
```bash
25222464
# ✗ Fails — RALPH.md already exists in my-ralph/
2523-
ralph new my-ralph
2465+
ralph scaffold my-ralph
25242466

25252467
# ✓ Option A — use a different name
2526-
ralph new my-other-ralph
2468+
ralph scaffold my-other-ralph
25272469

25282470
# ✓ Option B — edit the existing file directly
25292471
```
25302472

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-
25692473
## Loop issues
25702474

25712475
### Agent produces no output or seems to hang
@@ -3517,21 +3421,19 @@ The core loop is simple. The complexity lives in **prompt assembly** — running
35173421
```
35183422
src/ralphify/ # All source code
35193423
├── __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
35213425
├── engine.py # Core run loop orchestration with structured event emission
35223426
├── manager.py # Multi-run orchestration (concurrent runs via threads)
35233427
├── _resolver.py # Template placeholder resolution ({{ commands.* }}, {{ args.* }}, {{ ralph.* }})
35243428
├── _agent.py # Run agent subprocesses (streaming + blocking modes, log writing)
35253429
├── _run_types.py # RunConfig, RunState, RunStatus, Command — shared data types
35263430
├── _runner.py # Execute shell commands with timeout and capture output
35273431
├── _frontmatter.py # Parse YAML frontmatter from RALPH.md, marker constants
3528-
├── _source.py # GitHub source parsing and git-based ralph fetching for `ralph add`
3529-
├── _skills.py # Skill installation and agent detection for `ralph new`
35303432
├── _console_emitter.py # Rich console renderer for run-loop events (ConsoleEmitter)
35313433
├── _events.py # Event types, emitter protocol, and BoundEmitter convenience wrapper
3434+
├── _keypress.py # Cross-platform single-keypress listener (powers the `p` peek toggle)
35323435
├── _output.py # ProcessResult base class, combine stdout+stderr, format durations
3533-
└── skills/ # Bundled skill definitions (installed into agent skill dirs)
3534-
└── new-ralph/ # AI-guided ralph creation skill for `ralph new`
3436+
└── _brand.py # Brand color constants shared across CLI and console rendering
35353437

35363438
tests/ # Pytest tests — one test file per module
35373439
docs/ # MkDocs site (Material theme) — user-facing documentation
@@ -3615,7 +3517,6 @@ The CLI uses a `ConsoleEmitter` (defined in `_console_emitter.py`) that renders
36153517
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`.
36163518
4. **`_frontmatter.py`** — YAML frontmatter parsing. Extracts `agent`, `commands`, `args` from the RALPH.md file.
36173519
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.
36193520

36203521
## Traps and gotchas
36213522

@@ -3633,6 +3534,10 @@ Add it in `cli.py`. The CLI uses Typer. Update `docs/cli.md` to document the new
36333534

36343535
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`).
36353536

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+
36363541
### Credit trailer
36373542

36383543
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

Comments
 (0)