Package: tldr
tldr-python-clientPython command-line client fortldr pages.Installationfrom PyPIpipinstalltldrfrom Arch Linux repositorysudopacman-Stldrfrom Fedora packages repositorysudodnfinstalltldrUsageusage: tldr [-u] [-p PLATFORM] [-s SOURCE] [-c] [-r] [-L LANGUAGE] command

Python command line client for tldr

positional arguments:
  command               command to lookup

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -u, --update_cache    Update the local cache of pages and exit
  -p PLATFORM, --platform PLATFORM
                        Override the operating system [linux, osx, sunos,
                        windows, common]
  -s SOURCE, --source SOURCE
                        Override the default page source
  -c, --color           Override color stripping
  -r, --render          Render local markdown files
  -l, --list            List all available commands for operating system    
  -L LANGUAGE, --language LANGUAGE
                        Override the default languageConfigurationYou can configure the behavior and output of thetldrclient by setting environment variables. For example, in the.bashrcfile:exportTLDR_COLOR_NAME="cyan"exportTLDR_COLOR_DESCRIPTION="white"exportTLDR_COLOR_EXAMPLE="green"exportTLDR_COLOR_COMMAND="red"exportTLDR_COLOR_PARAMETER="white"exportTLDR_LANGUAGE="es"exportTLDR_CACHE_ENABLED=1exportTLDR_CACHE_MAX_AGE=720exportTLDR_PAGES_SOURCE_LOCATION="https://raw.githubusercontent.com/tldr-pages/tldr/main/pages"exportTLDR_DOWNLOAD_CACHE_LOCATION="https://tldr-pages.github.io/assets/tldr.zip"CacheCache is downloaded fromTLDR_DOWNLOAD_CACHE_LOCATION(defaults to the one described inthe client specification), unzipped and extracted into thelocal cache directory. Pages are loaded directly fromTLDR_PAGES_SOURCE_LOCATIONiftldr <command>is used.TLDR_CACHE_ENABLED(default is1):If set to1, the client will first try to load from cache, and fall back to fetching from the internet if the cache doesn't exist or is too old.If set to0, the client will fetch from the internet, and fall back to the cache if the page cannot be fetched from the internet.TLDR_CACHE_MAX_AGE(default is168hours, which is equivalent to a week): maximum age of the cache in hours to be considered as valid whenTLDR_CACHE_ENABLEDis set to1.Cache locationIn order of precedence:$XDG_CACHE_HOME/tldr$HOME/.cache/tldr~/.cache/tldrIf you are experiencing issues withtldr, consider deleting the cache files before trying other measures.Autocompleteshtabis required for autocompletion using the--print-completionargument.# bashtldr--print-completionbash|sudotee"$BASH_COMPLETION_COMPAT_DIR"/tldr# zsh (it is recommended to check where zsh/site-functions directory is located)## for macOS:tldr--print-completionzsh|sudotee/usr/local/share/zsh/site-functions/_tldr## for Linux:tldr--print-completionzsh|sudotee/usr/share/zsh/site-functions/_tldrSee theshtabdocsfor other installation methods and
supported shells.For autocomplete infish, while it is not supported inshtabyet,
please see#183for manually adding
an autocomplete fortldrforfish.SSL InspectionFor networks that sit behind a proxy, it may be necessary to disable SSL verification for the client to function. Setting the following:TLDR_ALLOW_INSECURE=1will disable SSL certificate inspection. Thisshould be avoidedunless absolutely necessary.ColorsValues of theTLDR_COLOR_xvariables may consist of three parts:Font color:blue, green, yellow, cyan, magenta, white, grey, redBackground color:on_blue, on_cyan, on_magenta, on_white, on_grey, on_yellow, on_red, on_greenAdditional effects, which depends on platform:reverse, blink, dark, concealed, underline, boldYou may specify as many additional effects as you want, while only one of font and background color.Any of the values of above may be omitted. For example, you can do similar things as the following:TLDR_COLOR_NAME=""use default system font color with default background color without any effectsTLDR_COLOR_DESCRIPTION="white"for white text on default system background color without any effectsTLDR_COLOR_NAME="cyan dark"for dark cyan text on default system background colorTLDR_COLOR_NAME="on_red"for default system font color on red background colorTLDR_COLOR_PARAMETER="red on_yellow underline"for underlined red text on yellow backgroundTLDR_COLOR_NAME="bold underline"for default system font and background colors with underline and bolded effectsLanguageThe language that tldr will use is dependent on a number of factors. If you specify a language via the--languageflag, tldr will attempt to use that language and only that language. Otherwise, it will
try to use the language specified byTLDR_LANGUAGE. If it is not set, or the page does not exist in that language,
then tldr will use the
language set usingLANGUAGEandLANG(ignoring the valuesCandPOSIX).
If neither are set, then tldr will always attempt to get theenpage. Finally, ifLANGis set, it usesLANGUAGE, if set,
first as the priority list to try languages in, followed byLANGif not included inLANGUAGEandenas fallback (assuming it does not already appear somewhere inLANGUAGEorLANG).
All language values should be set to a value that followsRFC 1766,
with the special exceptions ofCandPOSIXwhich are ignored.Remote sourceIf you wish to use your own instance of the tldr pages instead of the default repository, you
can either use the--sourceflag when using tldr or by specifying the following environment variables:TLDR_PAGES_SOURCE_LOCATIONto control where to get individual pages fromdefaults tohttps://raw.githubusercontent.com/tldr-pages/tldr/main/pagesit can also point to local directory usingfile:///path/to/directoryTLDR_DOWNLOAD_CACHE_LOCATIONto control where to pull a zip of all pages fromdefaults tohttps://tldr-pages.github.io/assets/tldr.zip