This guide helps AI assistants contribute to tldr-pages effectively. For detailed rules, see contributing-guides/style-guide.md.
User asks about command X
โ
โผ
Does page exist? (find pages* -name "X.md")
โ
โโโโโโดโโโโโ
YES NO
โ โ
โผ โผ
Edit Which platform?
โ
โโโโโโผโโโโโ
2+ same 1 platform Windows
โ โ โ
โผ โผ โผ
common/ linux/ windows/
osx/ etc.
tldr-pages - Community-maintained simplified help pages for command-line tools.
- License: CC BY 4.0 (pages), MIT (scripts)
- Website: https://tldr.sh/
- Languages: 30+ translations in
pages.<locale>/
pages/ # English pages
โโโ common/ # 2+ platforms
โโโ linux/ # Linux-only
โโโ osx/ # macOS-only
โโโ windows/ # Windows-only
โโโ ... # android, freebsd, openbsd, netbsd, sunos, cisco-ios, dos
pages.<locale>/ # Translations (fr, es, zh, etc.)
scripts/ # Python utilities
# command-name
> Short, snappy description (1-2 lines max).
> More information: <https://url-to-upstream.tld>.
- Description of example:
`command --option {{path/to/file}}`
- Another example:
`command {{[-f|--flag]}} {{arg}}`
- Display help:
`command {{[-h|--help]}}`
- Display version:
`command {{[-V|--version]}}`- Title: Match filename exactly (lowercase in filename, case-insensitive in content)
- Description: Start with
>, 1-2 lines preferred - More Information: Required, wrapped in
< > - Examples: 5 preferred, 8 maximum
- Descriptions: Start with
-, use imperative mood ("List" not "Lists") - Commands: Wrapped in backticks, separate line after description
- Blank Lines: Required between examples
- Trailing Newline: File must end with newline
- Imperative mood: "List all files" NOT "Lists all files"
- Concise: Focus on practical examples
- No formatting: No italics, bold, or other markdown styling
- Avoid general concepts: Don't explain UNIX basics
| Pattern | Usage |
|---|---|
{{path/to/file}} |
File paths |
{{path/to/directory}} |
Directory paths |
{{filename}} |
Filename only |
{{file1 file2 ...}} |
Multiple arguments |
{{option1|option2}} |
Alternatives |
{{[-v|--verbose]}} |
Verbose output flag |
{{[-it|--interactive --tty]}} |
Grouped flags |
{{1..5}} |
Numeric range |
{{*.ext}} |
Wildcard pattern |
- When both forms exist, use both:
{{[-h|--help]}} - Verify flags exist: Check
man <command>or<command> --helpbefore documenting - Note: Version flag varies by command (
-V,--version, or no short option) - check documentation - Space before args:
--option argNOT--option=arg - Short option hints:
[c]reate,[v]erbose
- Single:
<a>,<Enter>,<Space> - Special:
<Ctrl>,<Alt>,<Shift>(PascalCase) - Combinations:
<Ctrl c>,<Alt F4> - Sequence:
<Esc><u>,<Ctrl k><Ctrl s>
- Verify URL is reachable and returns HTTP 200 (follows redirects):
# Check URL and status code
curl -sL -o /dev/null -w "%{http_code}" https://example.com/command
# Should return: 200- Use official sources (man pages, docs, project sites)
- Preferred: https://manned.org/[command], https://www.gnu.org/software/[command]/manual/
Place as last two examples (in this order) to highlight practical commands first. Use wording: "Display help", "Display version". These are low-priority filler examplesโif better practical examples exist, prefer those instead.
- Filename: lowercase (e.g.,
invoke-webrequest.md) - Title: as-is (
# Invoke-WebRequest) - Command: as-is (
Invoke-WebRequest) - Paths: backslashes
{{path\to\file}} - Environment vars:
%VARIABLE%(cmd),$Env:VARIABLE(PowerShell) - PowerShell compatibility: Must work on 5.1 and latest
- pages/common/: Command works on 2+ platforms with same syntax
- pages//: Command works on only ONE platform
Use scripts/set-alias-page.py -p <platform>/<command> -l <locale> for translations.
# alias
> This command is an alias of `original`.
> More information: <https://example.com>.
- View documentation for the original command:
`tldr original`Commands with subcommands (like git) should mention them in the description:
# command
> Brief description.
> Some subcommands such as `sub1`, `sub2`, etc. have their own usage documentation.
> More information: <https://example.com>.
- Common usage:
`command {{arg}}`
- View documentation for subcommand:
`tldr command-sub1`Note: Each subcommand gets its own page: git-commit.md, git-push.md, etc.
- Check existing:
find pages* -name "<command>.md" - Determine platform โ
pages/common/(2+ platforms) orpages/<platform>/ - Research:
man <command>,<command> --help, official docs - Create file:
pages/<platform>/<command>.md - Write content: 5-8 practical examples (help/version last)
- Test:
tldr-lint path/to/page.md - Commit:
git add pages/<platform>/<command>.md && git commit -m "<command>: add page"
Commit format: <command>: <description> (e.g., ls: fix typo, git-push: add --force example)
- Ensure English page exists
- For alias pages: Use
scripts/set-alias-page.py -p <platform>/<command> -l <locale> - Create file:
pages.<locale>/<platform>/<command>.md - Translate:
- Maintain same example structure
- Keep placeholders in English
- Don't translate
example.com - Follow language-specific rules below
- Commit:
<command>: add <language> translation
- Space around English/numbers:
docker ๅฎนๅจ - Full-width punctuation
- Third person: "Extrait" not "Extraire"
- Space before punctuation:
informations :
- Third person: "Crea" not "Crear"
- Use
identificadornotid
- Third person: "Lista" not "Listar"
- No
ber-/me-prefixes: "Unduh" not "Mengunduh"
# Install linter
npm install -g tldr-lint
# Lint single page or all
tldr-lint pages/common/tar.md
tldr-lint ./pages
# Via npm
npm run lint-tldr-pagesIn scripts/ directory:
| Script | Purpose |
|---|---|
set-alias-page.py |
Create/update alias pages |
set-more-info-link.py |
Update documentation links |
set-page-title.py |
Update page titles |
set-see-also.py |
Update "See also" references |
update-command.py |
Update command examples |
wrong-filename.py |
Find naming issues |
Flags: -p platform/command, -l locale, -s (stage), -n (dry-run), -S (sync)
Example: python scripts/set-alias-page.py -p common/vi -s
When reviewing PRs, verify:
- Correct format (title, description, examples)
- Imperative mood in descriptions
- Proper placeholder syntax
{{}} - Both option forms used when available:
{{[-h|--help]}} - Appropriate platform directory
- Max 8 examples
- "More information" link present
- Help/version examples present with wording "Display help" and "Display version"
- No bold/italics/styling
- Blank lines between examples
- Language-specific rules (translations)
- Style Guide:
contributing-guides/style-guide.md - CONTRIBUTING.md: General contribution guidelines
- Translation Dashboard: https://lukwebsforge.github.io/tldri18n/
- Linter: https://github.com/tldr-pages/tldr-lint
- https://manned.org/[command] - General man pages
- https://www.gnu.org/software/[command]/manual/ - GNU tools
- https://learn.microsoft.com/powershell/module/... - PowerShell
- https://keith.github.io/xcode-man-pages/ - macOS
- https://git-scm.com/docs/[command] - Git
- Simple:
pages/common/pwd.md - With placeholders:
pages/common/tar.md - With subcommands:
pages/common/git.md - With aliases:
pages/common/vi.md - Windows:
pages/windows/Invoke-WebRequest.md
Wrong:
- Lists all files:
`ls -la`
- **Delete** a file:
`rm -rf {file}`Correct:
- List all files:
`ls -la`
- Delete a file:
`rm -rf {{path/to/file}}`Other issues:
- Non-imperative mood: "Lists" instead of "List"
- Wrong placeholders:
{file}or[file]instead of{{file}} - Nested placeholders:
{{path/to/{{file}}}} - Missing "More information" link
- No blank lines between examples
When using AI assistants to create tldr pages:
-
Check for existing pages first: Always run
find pages* -name "<command>.md"before creating new pages to avoid redundant work -
Reuse patterns from similar commands: Look at 2-3 existing pages (e.g.,
pages/common/tar.md,pages/common/curl.md) before generating new content instead of asking the AI to invent examples -
Provide command help output: When asking for a new page, include the output of
<command> --helporman <command>to reduce the AI's need to research -
Batch similar requests: Group multiple related page creation requests together rather than making separate API calls
-
Use the templates: Reference the templates in this file directly instead of asking the AI to recall them from memory
-
Verify with linter first: Run
tldr-lintbefore asking for human review to catch simple formatting errors -
Limit examples to 5-6: Use the minimum viable number of examples (5 preferred) rather than maxing out at 8
Remember: These tips reduce API costs while maintaining output quality - the key is providing better context upfront so the AI generates correct content in fewer attempts.