Convert Figma logo to code with AI

tealdeer-rs logotealdeer

A very fast implementation of tldr in Rust.

4,559
130
4,559
31

Top Related Projects

A very fast implementation of tldr in Rust.

1,382

fast and interactive tldr client written with go

A curated list of awesome command-line frameworks, toolkits, guides and gizmos. Inspired by awesome-php.

Quick Overview

Tealdeer is a fast and concise command-line utility that provides simplified "tldr" pages for various command-line tools. It's written in Rust and aims to be a faster alternative to the original tldr client, offering quick access to practical examples for common commands.

Pros

  • Fast performance due to Rust implementation
  • Supports caching for offline use
  • Cross-platform compatibility (Linux, macOS, Windows)
  • Customizable through configuration files

Cons

  • Limited to command-line interface, no GUI option
  • Depends on community-contributed content, which may vary in quality or completeness
  • Requires separate installation from package managers for some systems
  • May not cover all possible use cases for complex commands

Getting Started

To install Tealdeer, you can use one of the following methods:

  1. Using Cargo (Rust's package manager):

    cargo install tealdeer
    
  2. On macOS using Homebrew:

    brew install tealdeer
    
  3. On Arch Linux using pacman:

    pacman -S tealdeer
    

After installation, you can use Tealdeer by running the tldr command followed by the name of the command you want to look up:

tldr tar

This will display a concise set of practical examples for using the tar command.

To update the local cache of pages:

tldr --update

For more options and customization, refer to the project's GitHub repository and documentation.

Competitor Comparisons

A very fast implementation of tldr in Rust.

Pros of tealdeer

  • More active development and frequent updates
  • Larger community and contributor base
  • Better documentation and user guides

Cons of tealdeer

  • Slightly larger binary size
  • May have more dependencies

Code Comparison

tealdeer:

fn main() {
    let config = Config::load();
    let cache = Cache::new(&config);
    let tldr = Tldr::new(config, cache);
    tldr.run();
}

tealdeer>:

fn main() {
    let args = Args::parse();
    let config = Config::load();
    let cache = Cache::new(&config);
    let tldr = Tldr::new(config, cache, args);
    tldr.run();
}

The main difference in the code snippets is that tealdeer> explicitly parses command-line arguments using an Args struct, while tealdeer likely handles this internally within the Tldr::new() function or elsewhere in the codebase.

Both projects appear to be implementations of the tldr pages client in Rust, with tealdeer being the more established and actively maintained version. tealdeer> seems to be a fork or alternative implementation, potentially with some different design choices or features. However, without more context, it's challenging to determine the exact relationship between these two repositories or the specific differences in their implementations.

1,382

fast and interactive tldr client written with go

Pros of tldr

  • Written in Go, which may offer better performance and easier deployment on some systems
  • Provides a more interactive interface with features like fuzzy search and pagination
  • Supports custom pages and local page editing

Cons of tldr

  • Less actively maintained compared to tealdeer
  • Fewer installation options and package manager support
  • May have a steeper learning curve due to additional features

Code Comparison

tealdeer:

let config = Config::load()?;
let cache = Cache::new(config.cache_dir())?;
let page = cache.get_page(&args.page, args.os.as_deref())?;
print_page(&page, &config);

tldr:

config := config.NewConfig()
pages := source.NewSource(config)
page, err := pages.Read(os.Args[1])
if err != nil {
    log.Fatal(err)
}

Both projects aim to provide a command-line client for the tldr pages, but they differ in implementation language and feature set. tealdeer focuses on simplicity and speed, while tldr offers more advanced features at the cost of complexity. The choice between them depends on user preferences and system requirements.

A curated list of awesome command-line frameworks, toolkits, guides and gizmos. Inspired by awesome-php.

Pros of awesome-shell

  • Comprehensive collection of shell-related tools and resources
  • Community-driven with regular updates and contributions
  • Covers a wide range of shell topics, not limited to command-line usage

Cons of awesome-shell

  • Not a standalone tool, requires manual exploration and installation of listed resources
  • May include outdated or less maintained projects due to its broad scope

Code comparison

Not applicable, as awesome-shell is a curated list and doesn't contain executable code. tealdeer, on the other hand, is a Rust implementation of the tldr command-line client. Here's a sample of tealdeer usage:

tldr tar

This command would display a concise, example-based manual page for the tar command.

Summary

awesome-shell serves as an extensive resource for shell enthusiasts, offering a curated list of tools, frameworks, and guides. It's ideal for discovering new shell-related projects and learning resources. tealdeer, in contrast, is a specific tool focused on providing quick, example-based command-line help. While awesome-shell offers breadth, tealdeer provides depth in its specific use case of simplifying command-line documentation.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

tealdeer

teal deer

CrateCI (Linux/macOS/Windows)
Crates.ioGitHub 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://tealdeer-rs.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 LanguageMean in msDeviation in msComments
outfieldrZig9.10.5no user configuration
tealdeerRust13.20.5
fast-tldrHaskell17.00.6no example highlighting
tldr-hsHaskell25.10.5no example highlighting
tldr-bashBash30.00.8
tldr-cC38.41.0
tldr-python-clientPython87.02.4
tldr-node-clientJavaScript / NodeJS407.112.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"!