| 14 | |
| 15 | Examples: |
| 16 | node scripts/install.js --runtime claude --install --scope local |
| 17 | node scripts/install.js --runtime codex --install |
| 18 | node scripts/install.js --runtime opencode --dry-run |
| 19 | |
| 20 | Run the runtime-specific helper for all options: |
| 21 | node scripts/claude-install.js --help |
| 22 | node scripts/codex-install.js --help |
| 23 | `; |
| 24 | |
| 25 | function arg(argv, name, fallback = null) { |
| 26 | const prefix = `${name}=`; |
| 27 | const inline = argv.find((value) => value.startsWith(prefix)); |
| 28 | if (inline) return inline.slice(prefix.length); |
| 29 | const idx = argv.indexOf(name); |
| 30 | return idx >= 0 ? argv[idx + 1] : fallback; |
| 31 | } |