Checklist and patterns for wiring new CLI commands into cli-entry.ts
65
78%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.copilot/skills/cli-wiring/SKILL.mdBug class: Commands implemented in packages/squad-cli/src/cli/commands/ but never routed in cli-entry.ts.
Create command file in packages/squad-cli/src/cli/commands/<name>.ts
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.
| 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 |
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).
e23dd92
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.