Convert Figma logo to code with AI

dbrgn logotealdeer

A very fast implementation of tldr in Rust.

4,091
123
4,091
23

Top Related Projects

50,850

📚 Collaborative cheatsheets for console commands

14,818

An interactive cheatsheet tool for the command-line

12,273

cheat allows you to create and view interactive cheatsheets on the command-line. It was designed to help remind *nix system administrators of options for commands that they use frequently, but not frequently enough to remember.

38,282

the only cheat sheet you need

10,557

instant coding answers via the command line

🖥 📊 🕹 🛠 A curated list of command line apps

Quick Overview

Tealdeer is a fast and lightweight command-line utility that provides concise, practical examples for various command-line tools. It's an implementation of the tldr pages project in Rust, offering a more efficient alternative to the official client.

Pros

  • Fast performance due to Rust implementation
  • Lightweight and minimal dependencies
  • Supports offline caching of pages
  • Cross-platform compatibility (Linux, macOS, Windows)

Cons

  • Limited to tldr-pages content, which may not cover all commands
  • Requires separate installation from standard package managers
  • May not provide as detailed information as full man pages

Getting Started

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

  1. Using cargo (Rust package manager):
cargo install tealdeer
  1. On macOS using Homebrew:
brew install tealdeer
  1. 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
tldr git commit
tldr docker run

To update the cache of tldr pages:

tldr --update

For more options and usage information, run:

tldr --help

Competitor Comparisons

50,850

📚 Collaborative cheatsheets for console commands

Pros of tldr

  • Larger community and more contributors, resulting in a wider range of command examples
  • Supports multiple languages, making it accessible to a global audience
  • Offers a web interface for easy browsing of commands without installation

Cons of tldr

  • Written in Node.js, which may have slower startup times compared to Rust
  • Requires more disk space due to the inclusion of all pages in the package

Code Comparison

tldr (JavaScript):

const page = await client.get(command, options);
console.log(page);

tealdeer (Rust):

let page = cache.get_page(&command)?;
print_page(&page, &config);

Summary

tldr is a more established project with a larger community and broader language support. However, tealdeer, being written in Rust, offers faster performance and a smaller footprint. tldr provides a web interface, while tealdeer focuses on command-line efficiency. Both projects aim to simplify command-line usage by providing concise examples, but they cater to slightly different user preferences in terms of language support, performance, and interface options.

14,818

An interactive cheatsheet tool for the command-line

Pros of navi

  • Interactive and customizable command-line cheatsheet tool
  • Supports multiple languages and integrations with various shells
  • Allows for easy sharing and collaboration of cheatsheets

Cons of navi

  • More complex setup and usage compared to tealdeer
  • Requires additional dependencies and configuration
  • May have a steeper learning curve for new users

Code comparison

navi:

navi --query "git commit"
navi --tldr git
navi --cheatsh docker

tealdeer:

tldr git commit
tldr --update
tldr --platform=osx tar

Key differences

  • navi offers an interactive interface for browsing and searching cheatsheets, while tealdeer provides a simpler, static output of command examples
  • navi supports multiple sources for cheatsheets (custom, tldr, cheat.sh), whereas tealdeer focuses solely on tldr pages
  • tealdeer is written in Rust, which may offer performance benefits, while navi is written in Bash and utilizes external tools

Use cases

  • tealdeer: Quick reference for common command usage examples
  • navi: Comprehensive command exploration and customization of personal cheatsheets

Both tools aim to improve command-line productivity, but cater to different user preferences and needs. tealdeer offers simplicity and speed, while navi provides more flexibility and interactivity.

12,273

cheat allows you to create and view interactive cheatsheets on the command-line. It was designed to help remind *nix system administrators of options for commands that they use frequently, but not frequently enough to remember.

Pros of cheat

  • Supports creating and editing custom cheatsheets
  • Offers a more extensive collection of community-contributed cheatsheets
  • Provides a search functionality across all cheatsheets

Cons of cheat

  • Slower startup time compared to tealdeer
  • Requires Python installation and additional dependencies
  • More complex setup and configuration process

Code Comparison

tealdeer:

let page = cache.get_page(&name)?;
let mut printer = Printer::new(config, page);
printer.print()?;

cheat:

cheatsheet = cheatsheet_repository.get(cheatsheet)
if cheatsheet:
    print(cheatsheet.text)

Summary

tealdeer is a Rust implementation of tldr pages, focusing on speed and simplicity. It offers quick access to concise command-line tool examples. cheat, on the other hand, is a Python-based tool that provides more extensive cheatsheets and allows users to create and edit their own. While tealdeer excels in performance and ease of use, cheat offers more flexibility and a broader range of community-contributed content.

38,282

the only cheat sheet you need

Pros of cheat.sh

  • Offers a wider range of programming languages and tools
  • Provides a web interface for easy access without installation
  • Supports community-contributed cheatsheets

Cons of cheat.sh

  • Requires an internet connection for usage
  • May have slower response times compared to local alternatives
  • Less customizable for personal preferences

Code Comparison

cheat.sh:

curl cheat.sh/python/list

tealdeer:

tldr ls

Both tools aim to provide quick access to command-line cheatsheets, but they differ in their approach. cheat.sh offers a more extensive database accessible through various methods, including curl commands and a web interface. tealdeer, on the other hand, focuses on providing a fast, offline experience with a more limited set of commands.

cheat.sh excels in its breadth of coverage and ease of access, making it suitable for users who need information on a wide range of topics and don't mind relying on an internet connection. tealdeer is ideal for users who prioritize speed and offline availability, with a focus on common command-line tools.

The code examples demonstrate the simplicity of both tools, with cheat.sh using a curl command to fetch information and tealdeer using a dedicated command-line interface. While cheat.sh offers more flexibility in querying, tealdeer provides a more streamlined experience for quick lookups of common commands.

10,557

instant coding answers via the command line

Pros of howdoi

  • Provides answers from Stack Overflow, offering more detailed explanations
  • Supports multiple programming languages and technologies
  • Allows users to ask questions in natural language

Cons of howdoi

  • Requires an internet connection to fetch answers
  • May provide outdated or incorrect information if not carefully filtered
  • Can be slower to retrieve answers compared to local documentation

Code comparison

tealdeer:

let page = cache.get_page(&name)?;
let lines = page.lines();
for line in lines {
    println!("{}", line);
}

howdoi:

def get_answer(query):
    url = get_google_url(query)
    soup = get_soup(url)
    answer = find_best_answer(soup)
    return answer

tealdeer is a Rust-based command-line utility that provides quick access to concise command examples from tldr-pages. It focuses on offline usage and fast retrieval of pre-cached information.

howdoi is a Python-based tool that searches the internet for programming-related questions and provides answers from Stack Overflow. It offers more flexibility in terms of query types but requires an internet connection.

Both tools aim to provide quick answers to command-line and programming questions, but they differ in their approach and data sources. tealdeer is better suited for quick command reference, while howdoi is more versatile for general programming queries.

🖥 📊 🕹 🛠 A curated list of command line apps

Pros of awesome-cli-apps

  • Comprehensive collection of CLI apps across various categories
  • Community-driven with regular updates and contributions
  • Serves as a valuable resource for discovering new CLI tools

Cons of awesome-cli-apps

  • Not a standalone application, just a curated list
  • Requires manual exploration to find specific tools
  • May include outdated or deprecated projects

Code comparison

Not applicable, as awesome-cli-apps is a curated list and doesn't contain executable code. tealdeer, on the other hand, is a Rust implementation of tldr pages. Here's a sample of tealdeer's code:

fn main() {
    let config = Config::load();
    let args = parse_args();
    if let Err(e) = run(config, args) {
        eprintln!("Error: {}", e);
        process::exit(1);
    }
}

Summary

awesome-cli-apps is a comprehensive, community-driven list of CLI applications, serving as a valuable resource for discovering new tools. However, it's not a standalone application and requires manual exploration. tealdeer, in contrast, is a specific CLI tool for accessing tldr pages, offering a more focused functionality. While awesome-cli-apps provides a broad overview of available CLI tools, tealdeer offers a practical implementation for quick access to command 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://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 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"!