A proc-macro & type-system CLI framework for building complex command-line programs with many subcommands.
use mingling::prelude::*;
dispatcher!("greet", CMDGreet => EntryGreet);
fn main() {
let mut program = ThisProgram::new();
program.with_dispatcher(CMDGreet);
program.exec_and_exit();
}
pack!(ResultGreeting = String);
#[chain]
fn handle_greet(args: EntryGreet) -> Next {
let name =
args.pick_or((), "World").unpack();
ResultGreeting::new(name)
}
#[renderer]
fn render_greeting(greeting: ResultGreeting) {
r_println!("Hello, {}!", *greeting);
}
gen_program!();
Decouple parsing, business logic, rendering, help text, and completion — each is just a function with the right attribute macro.
With the dispatch_tree feature, your
subcommand structure is hardened into a prefix tree
at compile time. O(len) lookup.
Enable comp and get smart,
context-aware shell completions for bash, zsh, fish,
and pwsh — no manual registration.
Minimal core dependencies. Pull in advanced features (REPL, structured output, Clap binding) only when you need them via feature flags.
Add general_renderer and your program
gains --json /
--yaml flags automatically. Great for
scripting and pipe workflows.
Call program.exec_repl() and your CLI
becomes an interactive shell — perfect for debugging
and exploration.