Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Scaffolds a new Commander.js CLI command in src/commands/, registering it in src/cli.ts with tracked() telemetry and option parsing.
18% 95%+77 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 4 of 22 without it.
3 of 3 safety checks passed
Not used yet
export async function myCommand(options?: OptionType). Never use default exports..command() chain in src/cli.ts, wrapped with tracked() for telemetry.throw new Error('__exit__') to exit gracefully without printing the error message. Use chalk for user-facing messages.Create the command file at src/commands/{commandName}.ts with named async export.
export async function {commandName}Command(options?: { optionName?: optionType }) { ... }Handle errors consistently: Wrap error-prone operations in try/catch. Distinguish between user errors and system errors:
console.error(chalk.red('message')); throw new Error('__exit__');throw new Error('Detailed error message'); — this will print and exit with code 1..fail() before throwing.Import and register in src/cli.ts in the correct location:
import { {commandName}Command } from './commands/{commandName}.js';sources)..command('{kebab-name}').description('...').option(...).action(tracked('{kebab-name}', {commandName}Command))sources add): sources.command('add').description(...).action(tracked('sources:add', sourcesAddCommand))tracked('{command-name}', handler) for automatic telemetry.Define options (if needed):
.option() chains before .action(): .option('--flag', 'Description') or .option('--opt <value>', 'Description').option('--opt <value>', 'Description', parseFunction).action(tracked('name', (opts) => command(opts)))Verify before proceeding:
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.