CLI Command Wiring

Wire new CLI commands into a TypeScript dispatcher with lazy loading.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/jperezdelreal/GymBro --skill cli-command-wiring-jperezdelreal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: CLI Command Wiring
Source: https://github.com/jperezdelreal/GymBro/tree/main/.copilot/skills/cli-wiring
Command: npx skills add https://github.com/jperezdelreal/GymBro --skill cli-command-wiring-jperezdelreal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams wire and route new CLI commands into a modular, lazily-loaded CLI runner, reducing startup cost and avoiding routing gaps.

Core Features & Use Cases

  • Direct command wiring: Create a new command file in packages/squad-cli/src/cli/commands/<name>.ts and export a run<Name> function.
  • Runtime routing: Add a routing block in packages/squad-cli/src/cli-entry.ts to lazy-load and execute the command.
  • Unified help and usage: Update the help section to reflect the new command with proper usage guidance.

Quick Start

Tell me how to add a new <name> command and wire it into the router.

Frequently Asked Questions about CLI Command Wiring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new command to a TypeScript CLI with lazy loading?

To add a new command to a TypeScript CLI with lazy loading, create a command file exporting a run<Name> function, add a routing block in cli-entry.ts for dynamic imports, and update the help text to reflect the new command usage.

What is dynamic import-based routing for CLI commands?

Dynamic import-based routing for CLI commands is a dispatcher pattern that lazy-loads command modules at runtime. This reduces startup cost by only loading the specific command file requested when the CLI is executed.

How do I wire a new command into cli-entry.ts for runtime dispatch?

To wire a new command into cli-entry.ts for runtime dispatch, add a routing block that matches the command name and triggers a dynamic import of the corresponding command file, executing its run<Name> export.

Does this command wiring approach require any specific CLI framework dependencies?

This command wiring approach requires no external CLI framework dependencies. It relies entirely on native TypeScript dynamic imports to route and lazily load commands within a modular CLI tool structure.

Why use dynamic imports for CLI command routing instead of static imports?

Using dynamic imports for CLI command routing instead of static imports avoids loading every command module at startup. This lazy loading approach significantly reduces CLI startup cost and prevents routing gaps in modular architectures.