<< All versions
Skill v1.0.0
Trusted Publisher100/100microsoft/generative-ai-for-beginners-dotnet/cli-wiring
──Details
PublishedSeptember 28, 2026 at 04:01 AM
Content Hashsha256:a99d8806587bc53c...
Git SHA
──Files
Files (1 file, 1.8 KB)
SKILL.md1.8 KBactive
SKILL.md · 51 lines · 1.8 KB
version: "1.0.0"
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.tsinsidemain():
``ts 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 forCommands:):
``ts 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
| Type | Example | How to wire | |
|---|---|---|---|
| Standard command | export.ts, build.ts | run*() function, parse flags from args | |
| Placeholder command | loop, cast (alias: hire) | Inline in cli-entry.ts, prints pending message | |
| Utility/check module | rc-tunnel.ts, copilot-bridge.ts | Wire as diagnostic check (e.g., isDevtunnelAvailable()) | |
| Subcommand of another | init-remote.ts | Already used inside parent + standalone alias |
Common Import Pattern
ts
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.