Skip to content

Commit b8a79c6

Browse files
Kasper JungeRalphify
authored andcommitted
docs: add missing error messages to troubleshooting page (category 4)
Cover five error strings from the source code that weren't documented: RALPH.md already exists, git required, command missing name/run fields, malformed agent field, and invalid credit value. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 13e7851 commit b8a79c6

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

docs/troubleshooting.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ agent: claude -p --dangerously-skip-permissions
4747

4848
The agent CLI isn't installed or isn't in your shell's PATH. Verify by running `claude --version` directly. If it's installed but not found, check your PATH. See [supported agents](agents.md) for setup instructions.
4949

50+
### "RALPH.md already exists"
51+
52+
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:
53+
54+
```bash
55+
# ✗ Fails — RALPH.md already exists in my-ralph/
56+
ralph new my-ralph
57+
58+
# ✓ Option A — use a different name
59+
ralph new my-other-ralph
60+
61+
# ✓ Option B — edit the existing file directly
62+
```
63+
5064
## `ralph add` issues
5165

5266
### "Cannot parse source"
@@ -62,6 +76,14 @@ ralph add https://github.com/owner/repo/tree/main/my-ralph # URL copied from Gi
6276

6377
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`.
6478

79+
### "git is required for 'ralph add'"
80+
81+
`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:
82+
83+
```bash
84+
git --version
85+
```
86+
6587
### "git clone failed"
6688

6789
The repository couldn't be cloned. Common causes:
@@ -189,6 +211,53 @@ agent: claude -p --dangerously-skip-permissions
189211
---
190212
```
191213

214+
### "Each command must have 'name' and 'run' fields"
215+
216+
A command entry in `commands` is missing a required key. Every command needs both `name` and `run`:
217+
218+
```yaml
219+
# ✗ Wrong — missing 'run'
220+
commands:
221+
- name: tests
222+
223+
# ✗ Wrong — missing 'name'
224+
commands:
225+
- run: uv run pytest -x
226+
227+
# ✓ Correct
228+
commands:
229+
- name: tests
230+
run: uv run pytest -x
231+
```
232+
233+
The related error **"Command '...' must be a non-empty string"** means a `name` or `run` value is empty or not a string.
234+
235+
### "Malformed 'agent' field in RALPH.md frontmatter"
236+
237+
The `agent` value couldn't be parsed as a shell command — usually an unmatched quote:
238+
239+
```yaml
240+
# ✗ Wrong — unclosed quote
241+
agent: claude -p "dangerously-skip-permissions
242+
243+
# ✓ Correct
244+
agent: claude -p --dangerously-skip-permissions
245+
```
246+
247+
### "'credit' must be true or false"
248+
249+
The `credit` field only accepts boolean values. YAML bare words `true`/`false` work, but quoted strings don't:
250+
251+
```yaml
252+
# ✗ Wrong
253+
credit: "yes"
254+
credit: 0
255+
256+
# ✓ Correct
257+
credit: false
258+
credit: true
259+
```
260+
192261
### "Command name contains invalid characters" / "Arg name contains invalid characters"
193262

194263
Command names and arg names may only contain letters, digits, hyphens, and underscores (`a-z`, `A-Z`, `0-9`, `-`, `_`). Names with dots, spaces, or special characters are rejected because they can't be used in [`{{ commands.<name> }}` or `{{ args.<name> }}` placeholders](writing-prompts.md#ralph-context-placeholders).

0 commit comments

Comments
 (0)