Clients that provide a command-line interface must implement a specific set of arguments to be considered compliant with the tldr-pages specification. When a client adds support for any option in the table below, it MUST implement all variants of that option — for example, bothDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tldr-pages/tldr/llms.txt
Use this file to discover all available pages before exploring further.
-v and --version must be supported together.
Required arguments
These arguments MUST be implemented by every client that exposes a CLI:Prints the current version of the client and the version of the tldr-pages
specification that it implements.
Specifies the platform (including
common) to use when listing or searching
for pages. When this option is set, the selected platform MUST be checked
first instead of the host platform detected automatically. See Page
Resolution for details on platform fallback order.Conditional arguments
This argument is conditional on whether the client implements offline caching:Updates the offline cache of pages. This argument MUST be implemented if
the client supports caching. See Caching for download URLs
and cache requirements.
Optional arguments
These arguments are not required but are strongly recommended for a complete client experience:Lists all pages available for the current platform to standard output. When
stdout is not a TTY (e.g. piped to another command), output MUST be formatted
with one page name per line.
Overrides all other language detection mechanisms and forces the client to
display pages in the specified locale. When this option is set, the client
MUST strictly adhere to its value and MUST NOT show pages in a different
language — it should fail with an appropriate error message if no page is
available in that language. See Language Handling for more
information.
Filters page examples to show the shortform option variant when available
(e.g.
-A instead of --all). Option placeholders MUST NOT be highlighted
when only one form is shown, since there is no longer user choice involved.
The surrounding square brackets MUST also be removed from option placeholders.Filters page examples to show the longform option variant when available
(e.g.
--all instead of -A). The same placeholder rendering rules as
--short-options apply.Default option format
When neither--short-options nor --long-options is set by the user, clients SHOULD display only the longform option by default.
If both --short-options and --long-options are provided at the same time, both forms MUST be displayed together (e.g. [-A|--all]).
Page name handling
Before performing any page lookup, clients MUST apply two transformations to the page name provided by the user:-
Space-to-dash concatenation — Page names may contain spaces (e.g.
git checkout). These spaces MUST be transparently replaced with dashes (-). -
Lowercasing — Page names may contain mixed capitalization (e.g.
eyeD3). These names MUST be transparently lowercased.
-) MUST be treated as the page name.
TTY behavior
- When standard output is a TTY, clients MAY add decorative formatting (colors, borders, etc.) to the output.
- When standard output is not a TTY (e.g. output is piped to
grepor another tool), the output MUST NOT contain any additional decorations. - In particular,
--listoutput MUST always be formatted as one page name per line when stdout is not a TTY, to enable easy manipulation with standard CLI tools.
Example invocations
The following examples illustrate correct usage of the flags and name transformations described above:Clients MAY support additional custom arguments and syntax beyond what is
defined in this specification, as long as the required and conditional
arguments above are fully implemented.