#tldr #cli #fetch #client #offline

app tealdeer

Fetch and show tldr help pages for many CLI commands. Full featured offline client with caching support.

11 releases (stable)

Uses new Rust 2021

new 1.6.0 Oct 2, 2022
1.5.0 Dec 31, 2021
1.4.1 Sep 4, 2020
1.3.0 Feb 28, 2020
0.2.0 Apr 16, 2016

#11 in Command line utilities

Download history 177/week @ 2022-06-16 173/week @ 2022-06-23 199/week @ 2022-06-30 267/week @ 2022-07-07 211/week @ 2022-07-14 216/week @ 2022-07-21 227/week @ 2022-07-28 204/week @ 2022-08-04 171/week @ 2022-08-11 163/week @ 2022-08-18 146/week @ 2022-08-25 179/week @ 2022-09-01 185/week @ 2022-09-08 151/week @ 2022-09-15 136/week @ 2022-09-22 484/week @ 2022-09-29

977 downloads per month

MIT/Apache

77KB
1.5K SLoC

tealdeer

teal deer

Crate CI (Linux/macOS/Windows)
Crates.io GitHub CI

A very fast implementation of tldr in Rust: Simplified, example based and community-driven man pages.

Screenshot of tldr command

If you pronounce "tldr" in English, it sounds somewhat like "tealdeer". Hence the project name :)

In case you're in a hurry and just want to quickly try tealdeer, you can find static binaries on the GitHub releases page!

Docs (Installing, Usage, Configuration)

User documentation is available at https://dbrgn.github.io/tealdeer/!

The docs are generated using mdbook. They can be edited through the markdown files in the docs/src/ directory.

Goals

High level project goals:

  • Download and cache pages
  • Don't require a network connection for anything besides updating the cache
  • Command line interface similar or equivalent to the NodeJS client
  • Comply with the tldr client specification
  • Advanced highlighting and configuration
  • Be fast

A tool like tldr should be as frictionless as possible to use and show the output as fast as possible.

We think that tealdeer reaches these goals. We put together a (more or less) reproducible benchmark that compiles a handful of clients from source and measures the execution times on a cold disk cache. The benchmarking is run in a Docker container using sharkdp's hyperfine (Dockerfile).

Client (50 runs, 17.10.2021) Programming Language Mean in ms Deviation in ms Comments
outfieldr Zig 9.1 0.5 no user configuration
tealdeer Rust 13.2 0.5
fast-tldr Haskell 17.0 0.6 no example highlighting
tldr-hs Haskell 25.1 0.5 no example highlighting
tldr-bash Bash 30.0 0.8
tldr-c C 38.4 1.0
tldr-python-client Python 87.0 2.4
tldr-node-client JavaScript / NodeJS 407.1 12.9

As you can see, tealdeer is one of the fastest of the tested clients. However, we strive for useful features and code quality over raw performance, even if that means that we don't come out on top in this friendly competition. That said, we are still optimizing the code, for example when the outfieldr developers suggested to switch to a native TLS implementation instead of the native libraries.

Development

Creating a debug build with logging enabled:

$ cargo build --features logging

Release build without logging:

$ cargo build --release

To enable the log output, set the RUST_LOG env variable:

$ export RUST_LOG=tldr=debug

To run tests:

$ cargo test

To run lints:

$ rustup component add clippy
$ cargo clean && cargo clippy

MSRV (Minimally Supported Rust Version)

When publishing a Tealdeer release, the Rust version required to build it should be stable for at least a month.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Thanks to @severen for coming up with the name "tealdeer"!

Dependencies

~6–16MB
~325K SLoC