tldr-overview
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTLDR Project Overview
TLDR 项目概览
Get a token-efficient overview of any project using the TLDR stack.
使用TLDR stack以节省Token的方式快速获取任意项目的概览。
Trigger
触发方式
- or
/overview/tldr-overview - "give me an overview of this project"
- "what's in this codebase"
- Starting work on an unfamiliar project
- 或
/overview/tldr-overview - “给我这个项目的概览”
- “这个代码库包含什么内容”
- 开始接手不熟悉的项目时
Execution
执行步骤
1. File Tree (Navigation Map)
1. 文件树(导航地图)
bash
tldr tree . --ext .py # or .ts, .go, .rsbash
tldr tree . --ext .py # or .ts, .go, .rs2. Code Structure (What Exists)
2. 代码结构(现有内容)
bash
tldr structure src/ --lang python --max 50Returns: functions, classes, imports per file
bash
tldr structure src/ --lang python --max 50返回结果:每个文件的函数、类、导入内容
3. Call Graph Entry Points (Architecture)
3. 调用图入口点(架构)
bash
tldr calls src/Returns: cross-file relationships, main entry points
bash
tldr calls src/返回结果:跨文件关系、主要入口点
4. Key Function Complexity (Hot Spots)
4. 关键函数复杂度(热点)
For each entry point found:
bash
tldr cfg src/main.py main # Get complexity针对找到的每个入口点:
bash
tldr cfg src/main.py main # Get complexityOutput Format
输出格式
undefinedundefinedProject Overview: {project_name}
项目概览: {project_name}
Structure
结构
{tree output - files and directories}
{tree output - files and directories}
Key Components
核心组件
{structure output - functions, classes per file}
{structure output - functions, classes per file}
Architecture (Call Graph)
架构(调用图)
{calls output - how components connect}
{calls output - how components connect}
Complexity Hot Spots
复杂度热点
{cfg output - functions with high cyclomatic complexity}
Token cost: ~{N} tokens (vs ~{M} raw = {savings}% savings)
undefined{cfg output - functions with high cyclomatic complexity}
Token消耗: {N} tokens (对比{M}原始内容 = 节省{savings}%)
undefinedWhen NOT to Use
不适用场景
- Already familiar with the project
- Working on a specific file (use targeted tldr commands instead)
- Test files (need full context)
- 已经熟悉该项目
- 处理单个特定文件(改用针对性的tldr命令)
- 测试文件(需要完整上下文)
Programmatic Usage
程序化调用
python
from tldr.api import get_file_tree, get_code_structure, build_project_call_graphpython
from tldr.api import get_file_tree, get_code_structure, build_project_call_graph1. Tree
1. 文件树
tree = get_file_tree("src/", extensions={".py"})
tree = get_file_tree("src/", extensions={".py"})
2. Structure
2. 结构
structure = get_code_structure("src/", language="python", max_results=50)
structure = get_code_structure("src/", language="python", max_results=50)
3. Call graph
3. 调用图
calls = build_project_call_graph("src/", language="python")
calls = build_project_call_graph("src/", language="python")
4. Complexity for hot functions
4. 热点函数的复杂度
for edge in calls.edges[:10]:
cfg = get_cfg_context("src/" + edge[0], edge[1])
undefinedfor edge in calls.edges[:10]:
cfg = get_cfg_context("src/" + edge[0], edge[1])
undefined