Clientele makes it easy to write superb command-line utilities in Rust that follow consistent best practices on all target platforms including Linux, macOS, and Windows. It packages and re-exports clap, camino, dotenvy, wild, argfile, and getenv into a single easy dependency.
- Showcases how to structure a CLI program in Rust (see the examples).
- Loads environment variables from
.envfiles (using the dotenvy crate). - Provides convenience getters for common variables (using the getenv crate).
- Expands wildcard arguments (globs) on Windows (using the wild crate).
- Expands @argfiles similarly to
javacor Python (using the argfile crate). - Defines a standard set of essential CLI options (using the clap crate).
- Provides the
Utf8PathandUtf8PathBuftypes (using the camino crate). - Recommends use of the
sysexits.h(3)exit codes (see known-errors). - Supports opting out of any feature using comprehensive feature flags.
- Adheres to the Rust API Guidelines in its naming conventions.
- 100% free and unencumbered public domain software.
- Rust 1.81+
cargo add clientele[dependencies]
clientele = "0.3"[dependencies]
clientele = { version = "0.3", default-features = false, features = ["dotenv"] }See examples/skeleton/main.rs for a complete example.
use clientele::*;cargo run --example skeletonOptions:
--color <COLOR> Set the color output mode [default: auto] [possible values: auto, always, never]
-d, --debug Enable debugging output
--license Show license information
-v, --verbose... Enable verbose output (may be repeated for more verbosity)
-V, --version Print version information
-h, --help Print help
| Crate (Feature) | Version | Usage | Summary |
|---|---|---|---|
argfile ย ("argfile") |
0.2 | Enhances args_os() to expand @argfiles |
|
camino ย ("camino") |
1.1 | Prerequisite for paths::* |
|
clap ย ("clap") |
4.5 | Provides StandardOptions |
|
dotenvy ย ("dotenvy") |
0.15 | Provides dotenv() |
|
getenv ย ("getenv") |
0.1 | Provides envs::*, prerequisite for paths::* |
|
tracing-core ย ("tracing") |
0.1 | Implements Into<tracing_core::Level> for StandardOptions |
|
wild ย ("wild") |
2 | Enhances args_os() to support globs on Windows |
|
| ย |
git clone https://github.com/dryrust/clientele.rs.git