#command-line-arguments #facet #cli-parser

figue

Type-safe CLI arguments, config files, and environment variables powered by Facet reflection

12 stable releases (3 major)

Uses new Rust 2024

new 4.0.2 May 15, 2026
4.0.1 May 9, 2026
3.0.1 May 9, 2026
2.0.6 May 7, 2026
0.1.0 Jan 25, 2026

#70 in Command-line interface

Download history 39/week @ 2026-01-23 178/week @ 2026-02-27 113/week @ 2026-03-06 1246/week @ 2026-03-13 577/week @ 2026-03-20 749/week @ 2026-03-27 517/week @ 2026-04-03 1172/week @ 2026-04-10 1133/week @ 2026-04-17 800/week @ 2026-04-24 1038/week @ 2026-05-01 1105/week @ 2026-05-08

4,412 downloads per month
Used in 6 crates

MIT/Apache

1MB
22K SLoC

figue

crates.io documentation MIT/Apache-2.0 licensed

figue (pronounced 'fig', like the fruit) provides configuration parsing from CLI arguments, environment variables, and config files, a bit like figment but based on facet reflection:

use facet_pretty::FacetPretty;
use facet::Facet;
use figue as args;

#[derive(Facet)]
struct Args {
    #[facet(args::positional)]
    path: String,

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

    #[facet(args::named, args::short = 'j')]
    concurrency: usize,
}

# fn main() -> Result<(), Box<dyn std::error::Error>> {
let args: Args = figue::from_slice(&["--verbose", "-j", "14", "example.rs"])?;
eprintln!("args: {}", args.pretty());
Ok(())
# }

The entry point of figue is builder — let yourself be guided from there.

Color

Color is enabled by default if the terminal supports it. It is disabled when the NO_COLOR environment variable is set.

Sponsors

Thanks to all individual sponsors:

GitHub Sponsors Patreon

...along with corporate sponsors:

AWS Zed Depot

...without whom this work could not exist.

Special thanks

The facet logo was drawn by Misiasart.

License

Licensed under either of:

at your option.

Dependencies

~15–20MB
~276K SLoC