#clap #cli #clientele

no-std clientele

Clientele packages clap, camino, dotenvy, wild, argfile, and getenv into one dependency

19 releases

new 0.3.4 May 9, 2025
0.3.2 Apr 25, 2025
0.2.5 Jan 13, 2025
0.2.4 Oct 15, 2024

#277 in Command-line interface

Download history 42/week @ 2025-01-17 7/week @ 2025-01-31 5/week @ 2025-02-07 221/week @ 2025-02-14 170/week @ 2025-02-21 143/week @ 2025-02-28 67/week @ 2025-03-07 19/week @ 2025-03-14 34/week @ 2025-03-21 93/week @ 2025-03-28 52/week @ 2025-04-04 596/week @ 2025-04-11 422/week @ 2025-04-18 283/week @ 2025-04-25 160/week @ 2025-05-02

1,483 downloads per month
Used in 13 crates (11 directly)

Unlicense

27KB
408 lines

Clientele.rs

License Compatibility Package Documentation

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.

✨ Features

  • Showcases how to structure a CLI program in Rust (see the examples).
  • Loads environment variables from .env files (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 javac or Python (using the argfile crate).
  • Defines a standard set of essential CLI options (using the clap crate).
  • Provides the Utf8Path and Utf8PathBuf types (using the camino crate).
  • Recommends use of the sysexits.h(3) exit codes (see sysexits.rs).
  • 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.

🛠️ Prerequisites

⬇️ Installation

Installation via Cargo

cargo add clientele

Installation in Cargo.toml (with all features enabled)

[dependencies]
clientele = "0.3"

Installation in Cargo.toml (with only specific features enabled)

[dependencies]
clientele = { version = "0.3", default-features = false, features = ["dotenv"] }

👉 Examples

See lib/clientele/examples/skeleton/main.rs for a complete example.

Importing the library

use clientele::*;

Running the example

cargo run --example skeleton

📚 Reference

Options

StandardOptions

Options:
      --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

👨‍💻 Development

git clone https://github.com/dryrust/clientele.rs.git

Share on X Share on Reddit Share on Hacker News Share on Facebook Share on LinkedIn

Dependencies

~1–12MB
~153K SLoC