Cli wiring

From olivomarco/vbd-copilot · View interactive version

Cli wiring is an AI agent skill from the GitHub repository olivomarco/vbd-copilot. **Bug class:** Commands implemented in `packages/squad-cli/src/cli/commands/` but never routed in `cli-entry.ts`.

How to use this skill

Skill file

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
  1. Add routing block in packages/squad-cli/src/cli-entry.ts inside main():

```ts

if (cmd === '<name>') {

const { run<Name> } = await import('./cli/commands/<name>.js');

// parse args, call function

await run<Name>(process.cwd(), options);

return;

}

```

  1. Add help text in the help section of cli-entry.ts (search for Commands:):

```ts

console.log( ${BOLD}<name>${RESET} <description>);

console.log( Usage: <name> [flags]);

```

  1. 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, 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

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.