|
| 1 | +# Setup Command |
| 2 | + |
| 3 | +Initializes or updates `chorale.yaml` by scanning your repository for packages and applying sensible defaults. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```bash |
| 8 | +chorale setup [options] |
| 9 | +``` |
| 10 | + |
| 11 | +## Options |
| 12 | + |
| 13 | +- `--project-root=PATH`: Override project root (defaults to current directory) |
| 14 | +- `--paths=DIR ...`: Limit discovery to specific paths (relative to root) |
| 15 | +- `--discover-only`: Only scan and print results; do not write |
| 16 | +- `--write`: Write without confirmation (pair with `--non-interactive` in CI) |
| 17 | +- `--non-interactive`: Never prompt for confirmation |
| 18 | +- `--accept-all`: Accept suggested adds/renames during interactive runs |
| 19 | +- `--strict`: Treat warnings as errors (non‑zero exit) |
| 20 | +- `--json`: Emit a machine‑readable JSON report |
| 21 | + |
| 22 | +## Examples |
| 23 | + |
| 24 | +```bash |
| 25 | +# Interactive scan and write |
| 26 | +chorale setup |
| 27 | + |
| 28 | +# Discover only; do not write any changes |
| 29 | +chorale setup --discover-only |
| 30 | + |
| 31 | +# CI‑style non‑interactive write |
| 32 | +chorale setup --write --non-interactive |
| 33 | + |
| 34 | +# Limit discovery to a subset of paths |
| 35 | +chorale setup --paths src/SonsOfPHP/Component/Cache src/SonsOfPHP/Component/Clock |
| 36 | + |
| 37 | +# Strict mode with JSON report |
| 38 | +chorale setup --json --strict > setup-report.json |
| 39 | +``` |
| 40 | + |
| 41 | +## JSON Report (pretty‑printed) |
| 42 | + |
| 43 | +Example shape of the JSON emitted by `--json` (fields omitted for brevity): |
| 44 | + |
| 45 | +```json |
| 46 | +{ |
| 47 | + "defaults": { |
| 48 | + "repo_host": "github.com", |
| 49 | + "repo_vendor": "sonsofphp", |
| 50 | + "repo_name_template": "{name:kebab}", |
| 51 | + "default_repo_template": "git@{repo_host}:{repo_vendor}/{name:kebab}.git" |
| 52 | + }, |
| 53 | + "groups": { |
| 54 | + "ok": ["src/SonsOfPHP/Component/Cache"], |
| 55 | + "new": ["src/SonsOfPHP/Component/Clock"], |
| 56 | + "renamed": [], |
| 57 | + "drift": [], |
| 58 | + "issues": [], |
| 59 | + "conflicts": [] |
| 60 | + }, |
| 61 | + "actions": [ |
| 62 | + { "type": "add", "path": "src/SonsOfPHP/Component/Clock" } |
| 63 | + ] |
| 64 | +} |
| 65 | +``` |
0 commit comments