| name | tldr-cli |
| description | TLDR CLI komut referansi. tree, structure, search, extract, context, cfg, dfg, slice, calls, impact, dead, arch, imports, importers, diagnostics, change-impact komutlari. |
TLDR CLI - Code Analysis Tool
You have tldr available on PATH for token-efficient code analysis.
Commands
tldr tree [path]
tldr structure [path] --lang <lang>
tldr search <pattern> [path]
tldr extract <file>
tldr context <entry> --project .
tldr cfg <file> <function>
tldr dfg <file> <function>
tldr slice <file> <func> <line>
tldr calls [path]
tldr impact <func> [path]
tldr dead [path]
tldr arch [path]
tldr imports <file>
tldr importers <module> [path]
tldr diagnostics <file|path>
tldr change-impact [files...]
When to Use
- Before reading files: Run
tldr structure . to see what exists
- Finding code: Use
tldr search "pattern" instead of grep for structured results
- Understanding functions: Use
tldr cfg for complexity, tldr dfg for data flow
- Debugging: Use
tldr slice file.py func 42 to find what affects line 42
- Context for tasks: Use
tldr context entry_point to get relevant code
- Impact analysis: Use
tldr impact func_name before refactoring to see what would break
- Dead code: Use
tldr dead src/ to find unused functions for cleanup
- Architecture: Use
tldr arch src/ to understand layer structure
- Import tracking: Use
tldr imports file.py to see what a file imports
- Reverse imports: Use
tldr importers module_name src/ to find who imports a module
- Before tests: Use
tldr diagnostics . to catch type errors before running tests
- Selective testing: Use
tldr change-impact to run only affected tests
Languages
Supports: python, typescript, go, rust
Example Workflow
tldr tree src/ --ext .py
tldr search "process_data" src/
tldr context process_data --project src/ --depth 2
tldr cfg src/processor.py process_data
tldr impact process_data src/ --depth 3
tldr dead src/ --entry main cli
Codebase Analysis Commands
Impact Analysis
tldr impact <function> [path] --depth N --file <filter>
Shows reverse call graph - all functions that call the target. Useful before refactoring.
Dead Code Detection
tldr dead [path] --entry <patterns>
Finds functions never called (excluding entry points like main, test_, etc.)
Architecture Detection
tldr arch [path]
Analyzes call patterns to detect:
- Entry layer (controllers/handlers)
- Middle layer (services)
- Leaf layer (utilities)
- Circular dependencies
Import Analysis
tldr imports <file> [--lang python]
Parses all import statements from a file. Returns JSON with module names, imported names, aliases.
Reverse Import Lookup
tldr importers <module> [path] [--lang python]
Finds all files that import a given module. Complements tldr impact which tracks function calls - this tracks imports.
Diagnostics (Type Check + Lint)
tldr diagnostics <file>
tldr diagnostics . --project
tldr diagnostics src/ --format text
tldr diagnostics src/ --no-lint
Runs pyright (types) + ruff (lint) and returns structured errors. Use before tests to catch type errors early.
Change Impact (Selective Testing)
tldr change-impact
tldr change-impact src/foo.py
tldr change-impact --session
tldr change-impact --git
tldr change-impact --run
Finds which tests to run based on changed code. Uses call graph + import analysis.
Output
All commands output JSON (except context which outputs LLM-ready text, diagnostics --format text for human output).