Skip to content

Latest commit

 

History

539 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clawless logo

🦦 Clawless

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.

Quick Start

Install the scaffolding tool:

cargo install cargo-clawless

Create a new project:

cargo clawless new my-cli
cd my-cli
cargo run -- greet

Read the Quick Start guide for a complete walkthrough.

Features

  • 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!, and artifact! render as text or JSON, controlled by the --quiet, --verbose, and --json flags
  • Graceful cancellation - Cooperative shutdown with Cancellation tokens
  • Scaffolding tools - Generate projects and commands with cargo clawless new and cargo clawless generate command
  • Doc-driven help - Doc comments become help text

Documentation

Project Status

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.

License

Licensed under either of

at your option.

Contribution

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.

About

A framework to build command-line applications in Rust

Topics

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages