cli-operations
Operate LEANN safely through its CLI: build, search, ask, watch, rebuild, migrate, manage daemons and registries, route source indexers, and plan commands without execution.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- cli-operations
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Operate LEANN safely through its CLI: build, search, ask, watch, rebuild, migrate, manage daemons and registries, route source indexers, and plan commands without execution.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/cli-reference.md10.3 KB
- 参考文档references/daemon-watch-and-registry.md7.5 KB
- 参考文档references/index-lifecycle-operations.md8.0 KB
- 参考文档references/troubleshooting.md9.7 KB
- 脚本scripts/build_leann_command.py15.5 KB
03 SKILL.md 正文
LEANN CLI Operations
Use this sub-skill when the task is expressed as a leann command or involves
CLI index resolution, idempotent builds, watch/rebuild recovery, passage-ID
migration, embedding daemons, local/global index discovery, removal, or one of
the seven personal-data indexers.
Route by task
- Look up all 19 groups, exact flags, defaults, positional queries, prompt and metadata-filter syntax, and the deliberate absence of grep/hybrid flags in CLI reference.
- Plan build/update/rebuild, back up before mutation, migrate IDs, resolve duplicate names, or remove an index with index lifecycle operations.
- Manage daemon TTL/ports, recover stale processes, understand watch scope and project registration, or preflight source indexers with daemon, watch, registry, and indexers.
- Diagnose parser errors, bad filter JSON, missing sources/indexes, ambiguity, unsafe mutation assumptions, stale daemons, watch surprises, and platform prerequisites with troubleshooting.
- Construct a shell-quoted command without running LEANN using the bundled command planner.
Operating rules
- Run from the project that owns the index. CLI indexes live under that
project's
.leann/indexes/; the same name can exist in registered projects. - Use
leann listbefore mutation. Stop the index daemon and copy the complete index directory beforemigrate-ids, risky rebuild work, or irreplaceable removal. - Prefer idempotent
build/rebuild. Use--forceonly for an intentional full replacement; do not use deletion as recovery. - Start migration with
--dry-run. Content-hash collisions deduplicate identical passage text, and the operation has no built-in backup. - In automation use unique names and
search --non-interactive; duplicate resolution differs across search, ask, react, watch, and mutation commands. - Treat the query as positional for
searchandreact; it is optional and positional forask. Quote queries, prompt templates, and JSON filters. - Use only parser-backed flags. The CLI has metadata filtering but no grep/hybrid switches; route those retrieval modes to the Python API.
- Keep one watch loop per index. Dry-run watch does not advance the checkpoint; a successful rebuild does.
- Never place credentials in generated command text. A remote embedding key
resolved during
buildcan be persisted in index metadata; treat those artifacts as sensitive and follow the provider sub-skill's guidance.
Boundaries
- For Python builders/searchers, metadata schemas, BM25, hybrid, and grep, use API and indexing.
- For backend choice, compact/recompute storage, and tuning, use backends and storage.
- For embedding/LLM providers, model behavior, credentials, and chat semantics, use embeddings and chat.
- For reader internals, chunking, and extraction workflows, use RAG applications.
- For HTTP endpoints, MCP, and service deployment, use MCP and services.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).