Clawless is a batteries-included framework that provides everything you need for production CLIs: structured output, environment context, graceful cancellation, and scaffolding tools. You write command functions; Clawless provides the infrastructure.
use clawless::prelude::*;
#[derive(Debug, Args)]
pub struct GreetArgs {
/// The name to greet
#[arg(default_value = "World")]
name: String,
}
/// Greet the user
#[command]
pub async fn greet(args: GreetArgs, context: Context) -> CommandResult {
message!("Hello, {}!", args.name);
Ok(())
}That's it. The function name becomes your command name, and doc comments become
help text. The message! macro sends output through the Clawless output
system. Users can pass --quiet, --verbose, or --json to control the
output of any command, without changes to the command itself.
Install the scaffolding tool:
cargo install cargo-clawlessCreate a new project:
cargo clawless new my-cli
cd my-cli
cargo run -- greetRead the Quick Start guide for a complete walkthrough.
- Convention over configuration - File hierarchy maps to command hierarchy
- Type-safe arguments - Full compiler guarantees via Clap's derive API
- Async by default - Tokio runtime managed automatically
- Structured output -
message!,detail!, andartifact!render as text or JSON, controlled by the--quiet,--verbose, and--jsonflags - Graceful cancellation - Cooperative shutdown with
Cancellationtokens - Scaffolding tools - Generate projects and commands with
cargo clawless newandcargo clawless generate command - Doc-driven help - Doc comments become help text
- clawless.rs - Full documentation and guides
- docs.rs/clawless - API reference
- crates.io/crates/clawless - Published crate
Clawless is actively used in our internal projects and continues to evolve based on real-world needs. The core concepts are stable, but we will add new features and refine APIs as we expand its capabilities.
Check out the roadmap to see what we're working on and share your ideas.
If you're building internal tools or prototyping, Clawless is a great choice. For production applications, review the open issues to understand current limitations and upcoming features.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.