figue

Type-safe CLI arguments, environment variables, and config files for Rust — one #[derive(Facet)], every layer, with diagnostics that actually point at the mistake.

rust
use facet::Facet;
use figue::{self as args, FigueBuiltins};

#[derive(Facet)]
struct Args {
    /// File to process
    #[facet(args::positional)]
    input: String,

    /// Enable verbose output
    #[facet(args::named, args::short = 'v', default)]
    verbose: bool,

    #[facet(flatten)]
    builtins: FigueBuiltins,
}

let args: Args = figue::from_slice(&["-v", "input.txt"]).unwrap();
assert!(args.verbose);
assert_eq!(args.input, "input.txt");

figue (pronounced fig, like the fruit) reads configuration from CLI arguments, environment variables, and config files, merges them with a predictable precedence, and deserializes the result into your own structs. It is built on facet reflection, so a single derive gives you parsing, help text, shell completions, and JSON Schema export — no macros to hand-write, no runtime reflection cost.

Choose your path

Why figue