new-cli-command

Scaffold and register a new CLI command in Forge Starter with clap-based arguments.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/weiloon1234/Forge-Starter --skill new-cli-command
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-cli-command
Source: https://github.com/weiloon1234/Forge-Starter/tree/main/.claude/skills/new-cli-command
Command: npx skills add https://github.com/weiloon1234/Forge-Starter --skill new-cli-command

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a standardized approach to scaffold and wire up a new CLI command inside Forge Starter, ensuring consistent entry points, registration, and argument parsing.

Core Features & Use Cases

  • CLI scaffolding: generates a new command file and module wiring with a consistent id and clap-based args.
  • AppContext integration: ensures the command runs within Forge's AppContext (database, email, jobs, services) and registers in the command registry.
  • Standardized workflow: enforces a thin handler pattern that delegates work to services and follows the recommended error handling.

Quick Start

Run the scaffolder to create a new CLI command and wire it into the registry by executing PROCESS=cli cargo run -- make:command --name ImportUsers

Frequently Asked Questions about new-cli-command

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

FAQPage Schema
How do I add a new CLI command to Forge Starter?

To add a new CLI command to Forge Starter, run the scaffolder with PROCESS=cli cargo run -- make:command --name <YourCommand>. This generates the command file, wires it into the registry, and ensures AppContext availability for the handler.

How does CLI scaffolding handle clap argument definitions and registry wiring?

CLI scaffolding enforces a standard CommandId, generates clap-based argument definitions, creates a thin handle function, and registers the module in src/commands/mod.rs with proper error handling for consistent command wiring.

Does the generated CLI command have access to the Forge AppContext?

Yes, the generated CLI command runs within Forge's AppContext. This integration ensures the handler can access database, email, jobs, and services to perform operations and delegate work effectively.

Can I use this scaffolder to enforce a thin handler pattern for my Rust commands?

Yes, the scaffolder enforces a standardized thin handler pattern. This approach delegates work to services and follows recommended error handling practices, ensuring your Rust CLI commands remain maintainable.

What's the best way to ensure consistent entry points when creating multiple CLI commands?

Using this CLI scaffolder ensures consistent entry points by automating command file generation, enforcing a standard CommandId, and handling registry registration in src/commands/mod.rs, eliminating manual wiring inconsistencies.