| Crates.io | xacli-core |
| lib.rs | xacli-core |
| version | 0.2.0 |
| created_at | 2025-11-27 10:44:02.409834+00 |
| updated_at | 2026-01-15 18:31:00.437846+00 |
| description | Core library for XaCLI - command parsing, execution engine, and shell completion |
| homepage | |
| repository | https://github.com/yufeiminds/xacli |
| max_upload_size | |
| id | 1953503 |
| size | 138,841 |
Core CLI framework for Rust with command parsing, execution engine, and shell completion.
use xacli_core::prelude::*;
fn main() -> Result<()> {
let cmd = Command::new("myapp")
.version("1.0.0")
.short_help("My CLI application")
.arg(Arg::new("name").required(true).build())
.run(|ctx| {
let name = ctx.get_arg_string("name")?;
println!("Hello, {}!", name);
Ok(())
})
.build();
Runner::new(cmd).run()
}
cargo run --example demo -- --help
cargo run --example demo -- greet Alice
cargo run --example completion -- complete bash
cargo run --example validator -- single --age 25 --name John --level info
Apache-2.0