tealdeer Documentation

repository·main·Indexed 25 days ago

https://github.com/tealdeer-rs/tealdeer

A high-performance Rust implementation of tldr pages, providing simplified, example-based man pages. Tealdeer is a full-featured offline client with caching support that complies with the tldr client specification. Documentation covers installation via package managers or cargo, configuration of display styles, cache management, automatic updates, and search preferences.

Tokens
8.6K
Snippets
40
Records
75
Agent score
91%

What's inside tealdeer

  1. Show a random tldr page on shell start

    main

    You can display a randomly selected tldr page by combining tldr with shuf (from GNU coreutils). To make this happen every time you open a new terminal, add the command to your shell configuration file (e.g., .bashrc, .zshrc).

    tldr --quiet $(tldr --quiet --list | shuf -n1)
  2. Manage the tealdeer cache

    main

    Tealdeer uses a local cache of TLDR pages. You can manage this cache using the following commands:

    • Update the cache: Use -u, --update to download the latest pages.
    • Clear the cache: Use -c, --clear-cache to remove all cached pages.
    • List cached commands: Use -l, --list to see all commands currently available in your local cache.
    tldr -u
    tldr -c
    tldr -l
  3. Install shell autocompletions for tealdeer

    main

    If you are not using a system package manager, you can manually install shell completion scripts by copying them from the completion directory to your system's designated location:

    • Bash: cp completion/bash_tealdeer /usr/share/bash-completion/completions/tldr
    • Fish: cp completion/fish_tealdeer ~/.config/fish/completions/tldr.fish
    • Zsh: cp completion/zsh_tealdeer /usr/share/zsh/site-functions/_tldr
  4. Install tealdeer via package managers

    main

    Tealdeer is available in several package managers. You can install it using your system's package manager by searching for the tealdeer package.

    Supported package managers include:

    • Arch Linux: tealdeer
    • Debian: tealdeer
    • Fedora: tealdeer
    • FreeBSD: sysutils/tealdeer
    • Funtoo: app-misc/tealdeer
    • Homebrew: tealdeer
    • MacPorts: tealdeer
    • NetBSD: sysutils/tealdeer
    • Nix: tealdeer
    • openSUSE: tealdeer
    • Scoop: tealdeer
    • Solus: tealdeer
    • Void Linux: tealdeer
  5. Build tealdeer from source

    main

    You can build tealdeer from the source code using cargo build. Depending on your requirements, use one of the following commands:

    • Standard release build:
      $ cargo build --release
    • Release build with native TLS support:
      $ cargo build --release --features native-tls
    • Debug build with logging support:
      $ cargo build --features logging

    To enable logging at runtime for a debug build, export the RUST_LOG=tldr=debug environment variable.

    $ cargo build --release
  6. Locate and create the Tealdeer config file

    main

    Tealdeer uses a config.toml file for customization. The configuration file path follows OS conventions (e.g., $XDG_CONFIG_HOME/tealdeer/config.toml on Linux).

    You can find your specific configuration paths by running:

    tldr --show-paths

    To automatically generate a new configuration file, run:

    tldr --seed-config

    On Linux, this typically creates the file at ~/.config/tealdeer/config.toml.

    tldr --show-paths
    tldr --seed-config
  7. Create custom patches to extend existing tldr pages

    main

    To append your own examples to an existing upstream tldr page without replacing it entirely, create a file named <command>.patch.md in your custom pages directory. Tealdeer will append the content of this file to the end of the existing page.

    Note: Since version 1.7.0, the file extension must be .patch.md (previously .patch).

    $CUSTOM_PAGES_DIR/<command>.patch.md
    
    Example:
    ~/.local/share/tealdeer/pages/ufw.patch.md