|
| 1 | +# Run Repos Shortcuts (`f r`, `f ri`, `f rp`, `f rip`) |
| 2 | + |
| 3 | +This workflow lets you run Flow tasks in `~/code/run` and `~/code/run/i` from anywhere, |
| 4 | +without manual `cd`. |
| 5 | + |
| 6 | +## Standard Layout |
| 7 | + |
| 8 | +```text |
| 9 | +~/code/run/ # public run repo (has flow.toml) |
| 10 | +~/code/run/i/ # internal run repo (has flow.toml) |
| 11 | +~/code/run/i/linsa/ # nested internal project example |
| 12 | +``` |
| 13 | + |
| 14 | +`f health` now ensures `~/code/run` and `~/code/run/i` directories exist. |
| 15 | + |
| 16 | +## Primary Commands |
| 17 | + |
| 18 | +| Command | Meaning | |
| 19 | +|---|---| |
| 20 | +| `f r <task> [args...]` | Run task in `~/code/run` | |
| 21 | +| `f ri <task> [args...]` | Run task in `~/code/run/i` | |
| 22 | +| `f rp <project> <task> [args...]` | Run task in project under run tree | |
| 23 | +| `f rip <project> <task> [args...]` | Run task in `~/code/run/i/<project>` | |
| 24 | + |
| 25 | +## Resolution Rules |
| 26 | + |
| 27 | +`f rp <project> ...` resolves in this order: |
| 28 | + |
| 29 | +1. `~/code/run/<project>` |
| 30 | +2. `~/code/run/i/<project>` (fallback) |
| 31 | + |
| 32 | +If both exist, Flow fails with an ambiguity error and asks for explicit path: |
| 33 | + |
| 34 | +- `f rp <project> ...` for public path |
| 35 | +- `f rp i/<project> ...` or `f rip <project> ...` for internal path |
| 36 | + |
| 37 | +## Nested Project Support |
| 38 | + |
| 39 | +Nested `flow.toml` projects are supported. Example: |
| 40 | + |
| 41 | +```bash |
| 42 | +f rip linsa bootstrap |
| 43 | +f rp linsa opencode-codex-login |
| 44 | +``` |
| 45 | + |
| 46 | +Both target `~/code/run/i/linsa` (unless `~/code/run/linsa` also exists). |
| 47 | + |
| 48 | +## Why This Is Robust |
| 49 | + |
| 50 | +- Uses explicit `f run --config <dir>/flow.toml <task>` internally. |
| 51 | +- Avoids task-lookup ambiguity when nested `flow.toml` files exist. |
| 52 | +- Blocks unsafe paths (`/absolute`, `..` traversal) for run repo/project selectors. |
| 53 | + |
| 54 | +## Discovery and Maintenance |
| 55 | + |
| 56 | +```bash |
| 57 | +f run-list # list all flow.toml repos/projects under ~/code/run (recursive) |
| 58 | +f run-sync # sync all git repos under ~/code/run (recursive) |
| 59 | +f run-sync i # sync only ~/code/run/i |
| 60 | +``` |
| 61 | + |
| 62 | +## Script Interface |
| 63 | + |
| 64 | +Task shortcuts are powered by: |
| 65 | + |
| 66 | +```bash |
| 67 | +scripts/run-repos.sh |
| 68 | +``` |
| 69 | + |
| 70 | +Direct script commands: |
| 71 | + |
| 72 | +```bash |
| 73 | +bash ./scripts/run-repos.sh r <task> [args...] |
| 74 | +bash ./scripts/run-repos.sh ri <task> [args...] |
| 75 | +bash ./scripts/run-repos.sh rp <project> <task> [args...] |
| 76 | +bash ./scripts/run-repos.sh rip <project> <task> [args...] |
| 77 | +``` |
| 78 | + |
| 79 | +`RUN_ROOT` can be overridden for testing: |
| 80 | + |
| 81 | +```bash |
| 82 | +RUN_ROOT=/tmp/my-run-layout f rp linsa whoami |
| 83 | +``` |
0 commit comments