lmg
Use the lmg CLI to answer focused questions about a local codebase while keeping iterative search output out of the calling agent's context. Use for repository discovery, tracing implementations, locating symbols or configuration, and gathering file:line evidence.
来源信息
- 仓库
- losfair/lmg
- 最近来源活动
- 2026年8月29日 16:16
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 0
- Forks
- 0
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- lmg
- description
- Use the lmg CLI to answer focused questions about a local codebase while keeping iterative search output out of the calling agent's context. Use for repository discovery, tracing implementations, locating symbols or configuration, and gathering file:line evidence.
# Use lmg for codebase research
Use `lmg` when answering a focused repository question would otherwise require
several searches or produce noisy output. It runs its own search loop and
returns only a concise JSON codemap with file and line evidence.
Run it from the repository root:
```sh
lmg "Where is session expiry enforced?"
```
Or identify the repository explicitly:
```sh
lmg -C /path/to/repo "Trace how requests become authenticated users"
```
Ask one concrete investigative question at a time. Include the behavior,
symbol, configuration, or execution path you need to understand. Prefer direct
shell inspection when the exact file and location are already known.
On success, parse the JSON codemap on stdout:
```json
{
"summary": "direct answer",
"nodes": [
{
"id": "unique-id",
"location": "relative/path:line-line",
"symbol": "optional symbol",
"description": "fact established by this location"
}
],
"edges": [
{"from": "node-id", "to": "node-id", "relation": "calls or data flow"}
],
"usage": {"input": 100, "output": 20, "cache_read": 80, "cache_create": 0}
}
```
Every edge references node IDs. `symbol` is optional, and `edges` is empty when
the answer does not need a relationship graph. `usage` is added by `lmg` and
aggregates provider token counts across every agent round.
`lmg` automatically supplies repository-root instructions from `AGENTS.md`,
falling back to `CLAUDE.md` only when `AGENTS.md` is absent. Callers do not need
to include those instructions in the question.
Treat the answer as research evidence, not authorization to modify anything.
Before editing or making a high-impact decision, inspect the cited locations
directly and reconcile any ambiguity or missing context.
The default sandbox is read-only, has no network access, and hides the user's
home and parent environment. Keep it enabled for ordinary research. Use
`--yolo` only when the task is authorized to grant the model the invoking
process's filesystem and network access; environment scrubbing and other limits
still remain active.
Use `--verbose` to put tool activity and per-round input, output, cache-read,
and cache-create token counts on stderr. Do not substitute `--yolo` for missing
endpoint, API-key, model, or sandbox setup.
Network failures and retryable HTTP responses are retried indefinitely with
bounded exponential backoff, so an invocation may keep waiting during a
provider outage until it succeeds or the caller terminates it.
Parallel tool calling is enabled by default, allowing the model to request
multiple repository inspections in one turn.
Run `lmg --skill` to print this skill from the installed binary.
在 GitHub 查看