Useful crates

There is always new crates being released that can be useful in the development of command line applications.

Crates referenced in this book

  • anyhow - provides anyhow::Error for easy error handling
  • assert_cmd - simplifies integration testing of CLIs
  • atty - detected whether application is running in a tty
  • clap-verbosity-flag - adds a --verbose flag to structopt CLIs
  • clap - command line argument parser
  • confy - boilerplate-free configuration management
  • convey - easy output for machines and humans
  • crossbeam-channel - provides multi-producer multi-consumer channels for message passing
  • ctrlc - easy ctrl-c handler
  • env_logger - implements a logger configurable via environment variables
  • exitcode - system exit code constants
  • human-panic - panic message handler
  • indicatif - progress bars and spinners
  • log - provides logging abstracted over implementation
  • predicates - implements boolean-valued predicate functions
  • proptest - property testing framework
  • serde_json - serialize/deserialize to JSON
  • signal-hook - handles UNIX signals
  • structopt - parses command line arguments into a struct
  • tokio - asynchronous runtime
  • wasm-pack - tool for building WebAssembly

Other crates

Due to the constantly-changing landscape of Rust crates, a good place to find crates is the lib.rs crate index. Here are a few specific categories that might be useful for building CLI’s: