Skip to content
Back to skills

Cli Wiring

ASecurity

**Bug class:** Commands implemented in `packages/squad-cli/src/cli/commands/` but never routed in `cli-entry.ts`.

  • 17 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 30, 2026
tools

Works with

  • cli

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill cli-wiring --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cli Wiring?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cli Wiring
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-cli-wiring/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-cli-wiring)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# 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()`:
   ```ts
   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:`):
   ```ts
   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

| 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

```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, hire were already present.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…