cli-wiring
Skill file .squad/templates/skills/cli-wiring/SKILL.md in github/gh-aw. Read the publisher’s upstream source.
Description is absent from the checked source metadata.
Published by github ↗github/gh-awTry your first task
A source-grounded starter task has not been verified for this skill yet.
Skill: CLI Command Wiring
Bug class: Commands implemented in packages/squad-cli/src/cli/commands/ but never routed in cli-entry.ts.
Checklist — Adding a New CLI Command
-
Create command file in packages/squad-cli/src/cli/commands/<name>.ts
- Export a
run<Name>(cwd, options) async function (or class with static methods for utility modules)
-
Add routing block in packages/squad-cli/src/cli-entry.ts inside main():
if (cmd === '<name>') {
const { run<Name> } = await import('./cli/commands/<name>.js');
// parse args, call function
await run<Name>(process.cwd(), options);
return;
}
-
Add help text in the help section of cli-entry.ts (search for Commands:):
console.log(` ${BOLD}<name>${RESET} <description>`);
console.log(` Usage: <name> [flags]`);
-
Verify both exist — the recurring bug is doing step 1 but missing steps 2-3.
Wiring Patterns by Command Type
Common Import Pattern
import { BOLD, RESET, DIM, RED, GREEN, YELLOW } from './cli/core/output.js';
Use dynamic await import() for command modules to keep startup fast (lazy loading).
History
- #237 / PR #244: 4 commands wired (rc, copilot-bridge, init-remote, rc-tunnel). aspire, link, loop, cast (née hire) were already present.