跳到正文
FunCoding

cli-wiring

官方

Checklist for wiring a new Squad CLI command: route it in cli-entry.ts, add help text, and test that it is reachable

Star
3,457
许可证
MIT
最近提交
2026年11月30日

templates/skills/cli-wiring/SKILL.md

在 GitHub 上查看

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

  1. 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)
  2. 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;
    }
    
  3. 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]`);
    
  4. Verify both exist — the recurring bug is doing step 1 but missing steps 2-3.

Wiring Patterns by Command Type

TypeExampleHow to wire
Standard commandexport.ts, build.tsrun*() function, parse flags from args
Placeholder commandloop, cast (alias: hire)Inline in cli-entry.ts, prints pending message
Utility/check modulerc-tunnel.ts, copilot-bridge.tsWire as diagnostic check (e.g., isDevtunnelAvailable())
Subcommand of anotherinit-remote.tsAlready used inside parent + standalone alias

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.

相似的 Skill

reverse-engineer-anything

MOmorluto/rea485k近 7 天新增 9,215 个 star

reverse-engineer-anything

MOmorluto/rea485k近 7 天新增 9,215 个 star

test-driven-development

OBobra/superpowers331k近 7 天新增 5,757 个 star

agent-runtime-gateway-smoke-test

AFaffaan-m/ECC314k近 7 天新增 4,125 个 star

ai-regression-testing

AFaffaan-m/ECC314k近 7 天新增 4,125 个 star

精选

accessibility

审计 Web、iOS、Android 的无障碍合规,支持键盘导航与屏幕阅读器。

AFaffaan-m/ECC314k近 7 天新增 4,125 个 star