tldr-router

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TLDR Smart Router

TLDR 智能路由

Maps questions to the optimal tldr command. Use this to pick the right layer.
将问题映射到最优的tldr命令,用于选择合适的层级。

Question → Command Mapping

问题→命令映射

"What files/functions exist?"

"有哪些文件/函数?"

bash
tldr tree . --ext .py          # File overview
tldr structure src/ --lang python  # Function/class overview
Use: Starting exploration, orientation
bash
tldr tree . --ext .py          # File overview
tldr structure src/ --lang python  # Function/class overview
用途: 初始探索、定位

"What does X call / who calls X?"

"X调用了什么/谁调用了X?"

bash
tldr context <function> --project . --depth 2
tldr calls src/
Use: Understanding architecture, finding entry points
bash
tldr context <function> --project . --depth 2
tldr calls src/
用途: 理解架构、查找入口点

"How complex is X?"

"X的复杂度如何?"

bash
tldr cfg <file> <function>
Use: Identifying refactoring candidates, understanding difficulty
bash
tldr cfg <file> <function>
用途: 识别重构候选对象、理解难度

"Where does variable Y come from?"

"变量Y来自哪里?"

bash
tldr dfg <file> <function>
Use: Debugging, understanding data flow
bash
tldr dfg <file> <function>
用途: 调试、理解数据流

"What affects line Z?"

"哪些内容影响第Z行?"

bash
tldr slice <file> <function> <line>
Use: Impact analysis, safe refactoring
bash
tldr slice <file> <function> <line>
用途: 影响分析、安全重构

"Search for pattern P"

"搜索模式P"

bash
tldr search "pattern" src/
Use: Finding code, structural search
bash
tldr search "pattern" src/
用途: 查找代码、结构化搜索

Decision Tree

决策树

START
  ├─► "What exists?" ──► tree / structure
  ├─► "How does X connect?" ──► context / calls
  ├─► "Why is X complex?" ──► cfg
  ├─► "Where does Y flow?" ──► dfg
  ├─► "What depends on Z?" ──► slice
  └─► "Find something" ──► search
START
  ├─► "What exists?" ──► tree / structure
  ├─► "How does X connect?" ──► context / calls
  ├─► "Why is X complex?" ──► cfg
  ├─► "Where does Y flow?" ──► dfg
  ├─► "What depends on Z?" ──► slice
  └─► "Find something" ──► search

Intent Detection Keywords

意图检测关键词

IntentKeywordsLayer
Navigation"what", "where", "find", "exists"tree, structure, search
Architecture"calls", "uses", "connects", "depends"context, calls
Complexity"complex", "refactor", "branches", "paths"cfg
Data Flow"variable", "value", "assigned", "comes from"dfg
Impact"affects", "changes", "slice", "dependencies"slice/pdg
Debug"bug", "error", "investigate", "broken"cfg + dfg + context
意图关键词层级
导航"what", "where", "find", "exists"tree, structure, search
架构"calls", "uses", "connects", "depends"context, calls
复杂度"complex", "refactor", "branches", "paths"cfg
数据流"variable", "value", "assigned", "comes from"dfg
影响"affects", "changes", "slice", "dependencies"slice/pdg
调试"bug", "error", "investigate", "broken"cfg + dfg + context

Automatic Hook Integration

自动钩子集成

The
tldr-read-enforcer
and
tldr-context-inject
hooks automatically:
  1. Detect intent from your messages
  2. Route to appropriate layers
  3. Inject context into tool calls
You don't need to manually run these commands - the hooks do it for you.
tldr-read-enforcer
tldr-context-inject
钩子会自动:
  1. 从你的消息中检测意图
  2. 路由到合适的层级
  3. 将上下文注入工具调用
你无需手动运行这些命令——钩子会自动完成。

Manual Override

手动覆盖

If you need a specific layer the hooks didn't provide:
bash
undefined
如果钩子没有提供你需要的特定层级:
bash
undefined

Force specific analysis

Force specific analysis

tldr cfg path/to/file.py function_name tldr dfg path/to/file.py function_name tldr slice path/to/file.py function_name 42
undefined
tldr cfg path/to/file.py function_name tldr dfg path/to/file.py function_name tldr slice path/to/file.py function_name 42
undefined