xacli 0.2.0

A modern, developer-friendly CLI framework for Rust
Documentation

XaCLI

A powerful, type-safe CLI framework for Rust.

Features

  • Derive Macros: #[derive(App)], #[derive(Subcommand)], #[derive(ValueEnum)]
  • Type-safe Parsing: Define CLI structure using structs and enums
  • Interactive Components: Prompts, spinners, progress bars, and more
  • Shell Completion: Auto-generation for Bash, Zsh, Fish, PowerShell
  • Validation: Built-in validators for arguments

Installation

[dependencies]
xacli = "0.1"

Quick Start

use xacli::App;

#[derive(App)]
#[command(name = "myapp", about = "My CLI app")]
struct Cli {
    /// The name to greet
    #[arg(short = 'n', long = "name", default_value = "World")]
    name: String,

    /// Enable verbose output
    #[arg(short = 'v', long = "verbose")]
    verbose: bool,
}

fn main() {
    let cli = Cli::parse();
    println!("Hello, {}!", cli.name);
}

Crates

Crate Description
xacli Umbrella crate (re-exports all)
xacli-core Core framework
xacli-derive Procedural macros
xacli-components Interactive components

Documentation

License

Apache-2.0