{"id":49284773,"url":"https://github.com/parcadei/tldr-code","last_synced_at":"2026-04-27T23:00:34.979Z","repository":{"id":353114771,"uuid":"1217013436","full_name":"parcadei/tldr-code","owner":"parcadei","description":"Token-efficient code analysis for LLMs","archived":false,"fork":false,"pushed_at":"2026-04-25T18:54:50.000Z","size":4380,"stargazers_count":12,"open_issues_count":18,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T22:03:12.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parcadei.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-21T13:08:38.000Z","updated_at":"2026-04-25T21:17:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"d54ed334-82e6-429c-9008-f2029a3c127c","html_url":"https://github.com/parcadei/tldr-code","commit_stats":null,"previous_names":["parcadei/tldr-code"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/parcadei/tldr-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcadei%2Ftldr-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcadei%2Ftldr-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcadei%2Ftldr-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcadei%2Ftldr-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parcadei","download_url":"https://codeload.github.com/parcadei/tldr-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcadei%2Ftldr-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32358509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-25T21:00:40.865Z","updated_at":"2026-04-27T23:00:34.960Z","avatar_url":"https://github.com/parcadei.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tldr\n\nToken-efficient code analysis for LLMs. 40+ commands across AST, call graph, data flow, security, and quality — output optimized for machine consumption.\n\n## Why\n\nLLMs waste context on raw source dumps. tldr extracts the signal: function signatures, call graphs, taint flows, complexity metrics, dead code — as structured JSON that fits in a fraction of the tokens.\n\n**18 languages**: Python, TypeScript, JavaScript, Go, Rust, Java, C, C++, Ruby, Kotlin, Swift, C#, Scala, PHP, Lua, Luau, Elixir, OCaml.\n\n## Installation\n\n### Standard install (recommended)\n\n```bash\ncargo install tldr-cli\n```\n\nThis gives you 60+ analysis commands — everything except natural-language semantic search.\n\n### With semantic search\n\n```bash\ncargo install tldr-cli --features semantic\n```\n\nAdds three commands:\n\n- `tldr semantic '\u003cquery\u003e' \u003cpath\u003e` — natural-language code search\n- `tldr embed \u003cpath\u003e` — build embedding index\n- `tldr similar \u003cfile\u003e` — find similar fragments\n\nThis pulls in `fastembed` + ONNX Runtime. On first run it downloads the arctic-embed-m model (~110MB, cached). Builds reliably on Mac. Other platforms are unverified — if it doesn't compile for you, a PR with the fix is very welcome.\n\n## Quick start\n\n```bash\n# What's in this codebase?\ntldr structure src/\n\n# Who calls this function?\ntldr impact parse_config src/\n\n# Find dead code\ntldr dead src/\n\n# Security scan\ntldr secure src/\n\n# Full health dashboard\ntldr health src/\n```\n\n## Commands\n\n### AST Analysis (L1)\n| Command | Description |\n|---------|-------------|\n| `tree` | File tree structure |\n| `structure` | Code structure — functions, classes, imports |\n| `extract` | Complete module info |\n| `imports` | Parse import statements |\n| `importers` | Find files importing a module |\n\n### Call Graph (L2)\n| Command | Description |\n|---------|-------------|\n| `calls` | Cross-file call graph |\n| `impact` | Reverse call graph — who calls this? |\n| `dead` | Dead code detection |\n| `hubs` | Hub functions (centrality analysis) |\n| `whatbreaks` | What breaks if target changes? |\n\n### Data Flow (L3-L4)\n| Command | Description |\n|---------|-------------|\n| `reaching-defs` | Reaching definitions |\n| `available` | Available expressions (CSE detection) |\n| `dead-stores` | Dead store detection (SSA-based) |\n\n### Program Dependence (L5)\n| Command | Description |\n|---------|-------------|\n| `slice` | Backward program slice |\n| `chop` | Chop slice (forward + backward intersection) |\n| `taint` | Taint flow analysis |\n\n### Security\n| Command | Description |\n|---------|-------------|\n| `secure` | Security dashboard |\n| `taint` | Taint flows (injection, XSS) |\n| `vuln` | Vulnerability scanning |\n| `api-check` | API misuse patterns |\n| `resources` | Resource leak detection |\n\n### Quality \u0026 Metrics\n| Command | Description |\n|---------|-------------|\n| `smells` | Code smells |\n| `complexity` | Cyclomatic complexity |\n| `cognitive` | Cognitive complexity |\n| `halstead` | Halstead metrics |\n| `loc` | Lines of code |\n| `churn` | Git churn analysis |\n| `debt` | Technical debt (SQALE) |\n| `health` | Health dashboard |\n| `hotspots` | Churn x complexity |\n| `clones` | Code clone detection |\n| `cohesion` | LCOM4 cohesion |\n| `coupling` | Afferent/efferent coupling |\n\n### Patterns \u0026 Architecture\n| Command | Description |\n|---------|-------------|\n| `patterns` | Design pattern detection |\n| `inheritance` | Class hierarchies |\n| `surface` | API surface extraction |\n\n### Contracts \u0026 Verification\n| Command | Description |\n|---------|-------------|\n| `contracts` | Pre/postcondition inference |\n| `specs` | Extract test specs |\n| `invariants` | Infer invariants from tests |\n| `verify` | Verification dashboard |\n| `interface` | Interface contracts |\n\n### Search \u0026 Context\n| Command | Description |\n|---------|-------------|\n| `search` | BM25 search with structural context |\n| `semantic` | Natural language code search * |\n| `similar` | Find similar code fragments * |\n| `context` | LLM-ready context from entry point |\n| `definition` | Go-to-definition |\n| `explain` | Comprehensive function analysis |\n\n\\* Requires the `semantic` feature: `cargo install tldr-cli --features semantic`\n\n### Aggregated\n| Command | Description |\n|---------|-------------|\n| `todo` | Improvement suggestions |\n| `diff` | AST-aware structural diff |\n| `fix` | Diagnose and auto-fix errors |\n| `bugbot` | Automated bug detection on changes |\n\n## Output formats\n\n```bash\n--format json      # Default — structured, machine-readable\n--format text      # Human-readable\n--format compact   # Minified JSON for piping\n--format sarif     # GitHub/VS Code integration\n--format dot       # Graphviz visualization\n```\n\n## Daemon mode\n\nFor repeated queries, the daemon caches results in memory:\n\n```bash\ntldr daemon start\ntldr warm src/          # Pre-warm cache\ntldr calls src/         # Fast — cache hit\ntldr daemon stop\n```\n\n## Documentation\n\nFor detailed documentation, see the [docs/](docs/) folder:\n- [Installation Guide](docs/INSTALL.md)\n- [Setup Guide](docs/SETUP.md)\n- [Troubleshooting](docs/TROUBLESHOOTING.md)\n- [MCP Integration](docs/MCP.md)\n- [Architecture](docs/ARCHITECTURE.md)\n- [Command Reference](docs/commands/)\n\n## License\n\nAGPL-3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcadei%2Ftldr-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparcadei%2Ftldr-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcadei%2Ftldr-code/lists"}