adding-a-command

Scaffold Commander.js command files, register them in the CLI, and add tests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Buckeyes22/weather-app --skill adding-a-command-buckeyes22
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-a-command
Source: https://github.com/Buckeyes22/weather-app/tree/main/docs/corpora/caliber/skills/adding-a-command
Command: npx skills add https://github.com/Buckeyes22/weather-app --skill adding-a-command-buckeyes22

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates a standardized approach to scaffold new Commander.js commands, ensuring proper registration, option parsing, and telemetry instrumentation.

Core Features & Use Cases

  • Enforces wrapping every command with tracked() to enable telemetry.
  • Registers commands in src/cli.ts and uses explicit imports with ES module extensions.
  • Provides a clear, testable scaffold including a src/commands/{{command-name}}.ts file and corresponding tests.

Quick Start

Create the new command file and wire it into the CLI, then wrap the handler with tracked.

Frequently Asked Questions about adding-a-command

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

FAQPage Schema
How do I add a new CLI command with telemetry in TypeScript?

To add a CLI command with telemetry, scaffold a file in the commands directory, wire it into the CLI using explicit imports, and wrap the handler with tracked() to enable telemetry tracking. This standardizes command registration and option parsing.

What is the best way to scaffold a Commander.js command with tests?

The best way to scaffold a Commander.js command is to create a command file and a corresponding test scaffold under the tests folder. This ensures the command is testable and includes a defined OptionType interface for safe option parsing.

Does adding a Commander.js command require explicit imports with ES module extensions?

Yes, adding a Commander.js command requires explicit imports with ES module extensions. Commands are registered in the CLI using these explicit imports to ensure proper module resolution and discoverability within the TypeScript environment.

Why do I need to wrap my CLI command handler with tracked()?

You need to wrap your CLI command handler with tracked() to enable telemetry instrumentation. This enforced pattern ensures every command automatically captures usage data, providing consistent telemetry-ready tracking across the CLI application.

Can I use this CLI command scaffolding without defining an OptionType interface?

No, you cannot use this scaffolding without a defined OptionType interface. The Skill requires a defined OptionType interface and frontmatter name and description to ensure option parsing safety and command discoverability within the CLI.