Skip to main content

How-To Guides

Practical guides for accomplishing specific tasks with Clawless.

Command Generation​

Generate Commands​

Use the Clawless CLI to quickly create new commands and nested command structures without manually writing boilerplate.

Command Attributes​

Add Command Aliases​

Create short aliases for frequently used commands to improve user experience.

Require Subcommands​

Prevent command execution without a subcommand, automatically showing help instead.

Project Organization​

Organize Large CLI Applications​

Structure your Clawless project as it grows, separating CLI interface from business logic.

Testing​

Test with trycmd​

Write snapshot tests for your CLI using trycmd, with test cases defined as simple TOML files.

Runtime behavior​

Handle cancellation​

Respond to Ctrl+C gracefully using cancellation tokens, with patterns for async waiting, loop polling, tokio::select!, and scoped child tokens.

About How-To Guides​

These guides are task-oriented and assume you already understand Clawless basics. If you're new to Clawless, start with the Quick Start or Concepts section first.

Each guide focuses on a specific task and shows you how to accomplish it step-by-step.