How to Add a New CLI Command
Page Status
This page is a placeholder. Content coming soon.
Step-by-step recipe for adding a new subcommand to the porytiles2 CLI.
The Command pattern in
tools/driver/:command.hppbase class, onecommand_*.hpp/.cppper subcommandStep 1: Create a new
command_<name>.hppandcommand_<name>.cppintools/driver/Step 2: Implement the
Commandsubclass: register CLI11 options, implementRun()Step 3: If needed, create a use case in
app/use_cases/to hold the orchestration logicStep 4: Wire domain services in the command handler (or via DI when available)
Step 5: Register the command in the driver’s main setup
Step 6: Add option groups if the command shares options with other commands
Step 7: Add integration tests for the new command
Reference: existing commands as templates (
command_compile_tilesetis the most complete example)
Cross-references: Layered Architecture and DDD for where use cases vs commands live, Dependency Injection with Google Fruit for wiring services