Skip to content

Commit 6917275

Browse files
committed
Enhance README with detailed usage instructions for ralph.sh and ralph-once.sh
- Added sections for minimal invocation and parameters for both scripts. - Clarified the required positional argument and optional parameters. - Included notes on tool permission profiles and their implications. - Improved clarity on how prompts and PRD files are handled in the scripts.
1 parent 2c3f451 commit 6917275

1 file changed

Lines changed: 93 additions & 6 deletions

File tree

README.md

Lines changed: 93 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,35 @@ MODEL=claude-opus-4.5 ./ralph-once.sh
182182
./ralph.sh 10
183183
```
184184

185+
### No parameters / minimal invocation
186+
187+
`ralph.sh` requires exactly one positional argument: the number of iterations.
188+
189+
- Minimal run (default prompt + default PRD + default tool policy):
190+
```bash
191+
./ralph.sh 10
192+
```
193+
- Show help:
194+
```bash
195+
./ralph.sh --help
196+
```
197+
198+
### Parameters
199+
200+
`ralph.sh` accepts these options (all optional) plus the required `<iterations>` positional arg:
201+
202+
- `--prompt <file>`: Load prompt text from a file. If omitted, uses `prompts/default.txt`.
203+
- `--prd <file>` / `--prd=<file>`: Use a specific PRD JSON file. Default: `plans/prd.json`.
204+
- `--allow-profile <safe|dev|locked>`: Select a tool permission profile.
205+
- `--allow-tools <toolSpec>` (repeatable): Add an allowed tool.
206+
- If you provide any `--allow-tools`, they become the *full* allowlist (they replace the profile/default allowed tools).
207+
- `--deny-tools <toolSpec>` (repeatable): Deny a tool.
208+
- `MODEL=<model>` (env var): Select the model (default: `gpt-5.2`). Example: `MODEL=claude-opus-4.5 ./ralph.sh 10`.
209+
210+
Notes:
211+
- When you use `--prompt`, you must also pass `--allow-profile` or at least one `--allow-tools`.
212+
- The script always denies dangerous commands like `shell(rm)` and `shell(git push)`.
213+
185214
### Usage with a custom prompt
186215

187216
When using `--prompt`, you must also specify either `--allow-profile` or one or more `--allow-tools`.
@@ -195,7 +224,7 @@ If you provide any `--allow-tools`, they become the full allowlist (they replace
195224
Use a prompt-specific PRD file:
196225

197226
```bash
198-
./ralph.sh --prompt prompts/my-prompt.txt --prd plans/prd-wordpress.json --allow-profile safe 10
227+
./ralph.sh --prompt prompts/my-prompt.txt --prd plans/prd-wordpress-plugin-agent.json --allow-profile safe 10
199228
```
200229

201230
Example: WordPress-oriented prompt (from `ralph-wp`), with explicit shell tools:
@@ -228,11 +257,17 @@ Add extra denied tools (repeatable):
228257
```
229258

230259
### How it prompts Copilot
231-
The prompt includes:
232-
- `@<prd file>` (defaults to `@plans/prd.json`)
233-
- `@progress.txt`
260+
Copilot CLI versions observed during development can behave poorly when the prompt contains multiple `@file` attachments.
234261

235-
…plus instructions to implement **one** feature, run checks, update files, and commit.
262+
To avoid that, `ralph.sh` builds a *single temporary context file* per iteration that contains:
263+
- the PRD JSON (defaults to `plans/prd.json`)
264+
- `progress.txt`
265+
266+
Then it runs Copilot with:
267+
- `--add-dir "$PWD"` (so `@<file>` attachments are allowed)
268+
- a prompt that starts with `@<temp context file>` followed by the prompt text
269+
270+
The prompt instructs Copilot to implement **one** feature, run checks, update files, and commit.
236271

237272

238273

@@ -246,6 +281,36 @@ The prompt includes:
246281
./ralph-once.sh
247282
```
248283

284+
### No parameters / minimal invocation
285+
286+
With no parameters, `ralph-once.sh` uses:
287+
- prompt: `prompts/default.txt`
288+
- PRD: `plans/prd.json`
289+
- progress file: `progress.txt`
290+
- model: `gpt-5.2` (override via `MODEL=<model>`)
291+
292+
Show help:
293+
294+
```bash
295+
./ralph-once.sh --help
296+
```
297+
298+
### Parameters
299+
300+
`ralph-once.sh` accepts these options (all optional):
301+
302+
- `--prompt <file>`: Load prompt text from a file. If omitted, uses `prompts/default.txt`.
303+
- `--prd <file>`: Use a specific PRD JSON file. Default: `plans/prd.json`.
304+
- `--allow-profile <safe|dev|locked>`: Select a tool permission profile.
305+
- `--allow-tools <toolSpec>` (repeatable): Add an allowed tool.
306+
- If you provide any `--allow-tools`, they become the *full* allowlist (they replace the profile/default allowed tools).
307+
- `--deny-tools <toolSpec>` (repeatable): Deny a tool.
308+
- `MODEL=<model>` (env var): Select the model (default: `gpt-5.2`). Example: `MODEL=claude-opus-4.5 ./ralph-once.sh`.
309+
310+
Notes:
311+
- When you use `--prompt`, you must also pass `--allow-profile` or at least one `--allow-tools`.
312+
- The script always denies dangerous commands like `shell(rm)` and `shell(git push)`.
313+
249314
### Usage with a custom prompt
250315

251316
```bash
@@ -277,9 +342,31 @@ Copilot CLI supports tool permission flags like:
277342
- `--allow-tool 'shell(git)'` / `--deny-tool 'shell(git push)'`
278343
- `--allow-all-tools` (broad auto-approval; use with care)
279344

345+
### `--allow-profile` meanings
346+
347+
The scripts support three built-in tool permission profiles:
348+
349+
- `locked`: write-only.
350+
- Allows: `write`
351+
- Use this when you want Copilot to only edit files (no shell).
352+
353+
- `safe`: “common dev loop” tools.
354+
- Allows: `write`, `shell(pnpm)`, `shell(git)`
355+
- Use this for most repos where you want installs/tests (`pnpm`) and normal git operations.
356+
357+
- `dev`: broadest permissions.
358+
- Enables: `--allow-all-tools`
359+
- Still explicitly allows the common tools above.
360+
- Use this only when you expect the agent to need lots of shell commands.
361+
362+
Regardless of profile, the scripts always deny a small set of dangerous tools (e.g. `shell(rm)` and `shell(git push)`).
363+
364+
If you provide any `--allow-tools`, they become the full allowlist (they replace profile/default allowed tools).
365+
280366
The scripts in this bundle:
281-
- enable non-interactive execution with `--allow-all-tools`
282367
- explicitly deny dangerous commands like `rm` and `git push`
368+
- aim to run non-interactively by passing Copilot CLI tool permissions up-front
369+
- `ralph.sh` uses `--allow-all-tools` and may additionally pass `--available-tools ...` to restrict what’s actually usable
283370

284371
When using a custom prompt via `--prompt`, the scripts default to a conservative policy:
285372
- they require either `--allow-profile` or at least one `--allow-tools`

0 commit comments

Comments
 (0)