CLI Command Wiring

Adds CLI commands to .NET projects, enabling them to be run with 'dotnet run'.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams reliably wire new CLI commands into a modular CLI app, ensuring proper routing and consistent user UX.

Core Features & Use Cases

  • Create command file in packages/squad-cli/src/cli/commands/<name>.ts and export a run<Name>(cwd, options) async function.
  • Add routing block in packages/squad-cli/src/cli-entry.ts inside main() to dynamically import and execute the command.
  • Update help text in cli-entry.ts to list the new command and its usage.
  • Validate wiring by ensuring both the command file and routing block exist and are wired correctly.

Quick Start

Add a new command file for <name>, wire it in cli-entry.ts, and verify the command appears in the help output.

Frequently Asked Questions about CLI Command Wiring

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

FAQPage Schema
How do I wire new commands into a modular TypeScript CLI application?

To wire new CLI commands into a modular TypeScript application, you create a command file exporting an async run function, add a dynamic import and execution routing block in your entry point, and update the help text to ensure consistent user UX.

Does adding a new CLI command require updating both the routing logic and help text?

Yes, adding a CLI command requires updating both the routing logic and help text. Consistent command wiring enforces adding a routing block in cli-entry.ts for execution and corresponding help text changes so the command appears in help output.

What is the best way to structure command files for a pluggable CLI architecture in TypeScript?

The best way to structure command files for a pluggable CLI architecture is to place each command in a dedicated TypeScript file under a commands directory, exporting a single async run function that accepts the current working directory and options.

How do I validate that a new CLI command is correctly wired into the routing entry point?

You validate command wiring by ensuring both the command file and the routing block exist and are connected correctly. Proper wiring requires the command file to be dynamically imported and executed within the main entry point function.

Can I use dynamic imports to route commands in a Node.js CLI tool?

Yes, you can use dynamic imports to route commands in a Node.js CLI tool. The routing block inside the main entry function dynamically imports the command file and executes its exported async run function to process user input.

Why does my newly added CLI command not show up in the help output?

Your newly added CLI command does not show up in the help output because the help text in the entry point was not updated. Consistent command wiring requires corresponding help text changes to list the new command and its usage alongside the routing block.