@dotdotgod/cli

中文文档
0.8.1发布于 2026/11/11Elastic-2.0ES Module近 30 天下载 2108

CLI for dotdotgod validation, hybrid document/code-outline search, and graph indexing.

原始使用文档
文档目录11 节
  1. What Changes
  2. Start Here
  3. What It Does
  4. Commands
  5. Which Command Should I Use?
  6. Changed-File Impact
  7. Local Impact Graph Explorer
  8. Validation and Verification Boundaries
  9. Memory, Specs, and Config
  10. Indexing Scope
  11. Learn More

@dotdotgod/cli

Without an explicit project or global embedding profile, search uses keywords without loading/downloading models or creating vector indexes. Configured profiles enable hybrid retrieval; --search keyword always skips embeddings and unconfigured --search vector fails with setup guidance. Graph impact follows the same opt-in.

npm version GitHub License: Elastic 2.0

Command-line tools for dotdotgod project memory.

Use this package when you want to initialize a docs-first project scaffold, validate project-memory docs, build a local graph/cache, search full documentation and code outlines locally, expand project references, or ask what should be checked after a file changes.

These commands support dotdotgod's project-memory loop with initialization, documentation query, validation, and impact analysis for shells, scripts, CI, and agents that use the CLI directly.

What Changes

  • Repository knowledge becomes navigable memory. Hybrid query finds full-document and code-outline/comment evidence and keeps the cache under .dotdotgod/.
  • Project references become actionable context. resolve and expand connect explicit [[...]] references and high-signal natural-language requests to maintained files; --with-impact adds related evidence.
  • Changes carry their verification neighborhood. Multi-file graph impact combines structural, traceability, package, and optional semantic evidence while preserving a per-file explanation.
  • Large repositories reveal natural domains. graph communities groups the maintained project graph to help teams inspect documentation and source boundaries.
  • Different knowledge shapes can share one workflow. Editable config templates initialize software or research-oriented memory policies.

Start Here

Run one command without installing globally:

npx @dotdotgod/cli validate .

Install only if you want a persistent dotdotgod command:

npm install -g @dotdotgod/cli

Common first commands:

dotdotgod init .
dotdotgod validate .
dotdotgod query . "project documentation"
dotdotgod graph impact . --changed <path> --compact
dotdotgod graph serve .

What It Does

  • init creates AGENTS.md, thin agent entrypoints, docs indexes, active-plan space, archive map, local cache ignores, and the complete editable default config.
  • validate checks docs/project-memory rules; --check-index also checks graph and outline freshness without parsing, embedding or repair.
  • index builds graph shards and .dotdotgod/outlines.json with source hashes, declarations, comments and exact ranges.
  • query defaults to hybrid vector/keyword search over full Markdown and code outlines/comments, not implementation bodies. Use --scope docs|code|all, --search hybrid|keyword|vector and --limit 30. Keyword mode works without embeddings; hybrid reports vector failures and retains keyword results. Selecting a remote embedding provider authorizes sending documentation and code metadata (names, signatures, and comments), without implementation bodies or an additional consent flag. Local E5 remains the default when its optional runtime is installed. Tree-sitter coverage and boundaries: CODE_OUTLINES.md.
  • resolve and expand map explicit or high-signal prompt references to project files and can include related impact evidence.
  • graph impact ranks likely related specs, tests, docs, commands, and source files for one or more changed paths, with a combined ranking and per-file top five. Non-seed scores use fixed weighted PPR connection 80 plus memory policy 20. A bounded request-local multilingual vector overlay participates in PPR when the query cache is available; vector preparation failures degrade to structural-only results.
  • graph serve starts a standalone read-only traceability graph without Obsidian. It uses resolved project configuration, relation filters, document-group colors, and optional weighted line widths.
  • graph export writes .dotdotgod/traceability.json for the desktop Obsidian plugin. Run it in the project/vault, then reload traceability in Obsidian. Exported paths are relative; referenced files must exist in the vault. See plugin setup.
  • traceability links checks or repairs generated Markdown traceability-link sections.

Commands

dotdotgod --help
dotdotgod --version
dotdotgod init .
dotdotgod validate .
dotdotgod validate . --check-index
dotdotgod config .
dotdotgod config init .
dotdotgod config init . --template research
dotdotgod status .
dotdotgod index .
dotdotgod query . "plan mode tools"
dotdotgod resolve . PLAN_MODE
dotdotgod expand . "Update [[PLAN_MODE]] and [[HOOKS]]"
dotdotgod expand . "PLAN_MODE 수정하자" --fuzzy
dotdotgod expand . "Update [[PLAN_MODE]]" --with-impact
dotdotgod traceability links . --check
dotdotgod traceability links . --write
dotdotgod graph impact . --changed <path>
dotdotgod graph impact . --changed <path> --changed <another-path> --compact
dotdotgod graph impact . --changed <path> --changed <another-path> --yml
dotdotgod graph serve .
dotdotgod graph serve . --port 4313
dotdotgod graph communities .

Which Command Should I Use?

NeedCommand
Add the dotdotgod scaffold to a repositorydotdotgod init .
Check docs, links, config, traceability, and optional index freshnessdotdotgod validate . --check-index
Refresh the local graph/cachedotdotgod index .
Search shared project documentation locallydotdotgod query . "project documentation"
Resolve [[...]] references from a promptdotdotgod expand . "Update [[PLAN_MODE]]"
Repair generated traceability-link sectionsdotdotgod traceability links . --write
See what else to inspect after a changedotdotgod graph impact . --changed <path> --compact
Explore project traceability visuallydotdotgod graph serve .

Changed-File Impact

$ dotdotgod graph impact . --changed packages/cli/src/core.mjs --compact
docs:
- docs/spec/CONFIG_COMMAND.md (56.8; incoming:links_to, incoming:implemented_by)
- docs/spec/cli/TRACEABILITY_LINKS.md (26.3; vector_similarity)

tests:
- packages/cli/test/core.test.mjs (6.5; verified_by)

files:
- packages/cli/src/core.mjs (100; changed-file)

graph impact needs at least one --changed <path> and accepts repeated options. Multi-file output preserves input order, deduplicates repeated paths, returns a bounded combined ranking, and includes the top five non-seed results for each changed file. Use --compact for short text, --yml or --yaml for compact structured agent-facing output, and --json for machine-readable detail.

The indexed graph is built from maintained project files: Markdown links, README routes, headings, configured traceability relations, package metadata, scripts and packaged resources, dependencies, and memory-area membership. Impact analysis can add request-local vector edges for candidate discovery and PPR without mutating that indexed graph.

Local Impact Graph Explorer

dotdotgod graph serve .

graph serve prints a local URL and binds to 127.0.0.1 by default. Set --port 4313 for a fixed port. Only loopback hosts are accepted. Use graph impact --changed <path> for changed-file ranking; the web command no longer accepts --changed. Reload refreshes project config and index data.

The explorer includes only shared indexed nodes structurally connected to a retained changed-file root. Connectivity treats stored structural edges as undirected so incoming evidence remains discoverable, while rendered arrows preserve each relation's original direction. Local-memory nodes, disconnected nodes, and request-local vector edges are excluded from the canvas and search.

Use Node reveal to choose:

  • Instant — place the complete connected graph immediately.
  • By hop layer — reveal the root first and then each minimum-hop layer.
  • One by one — reveal nodes in deterministic breadth-first order with an automatically bounded total delay.

The browser remembers the selected mode. Skip reveal completes an active sequence immediately. Re-rooting and relation filters morph surviving nodes toward their new positions, while prefers-reduced-motion resolves every mode to immediate placement. Graph distance is layout-only and never represents impact score.

Validation and Verification Boundaries

CommandResponsibility
dotdotgod validate <root>Checks dotdotgod docs/project-memory structure, local links, traceability blocks, generated traceability-link drift, config validity, and optional index freshness.
dotdotgod traceability links <root> --checkRuns only the generated traceability-link and compact JSON drift check.
dotdotgod traceability links <root> --writeRepairs generated traceability-link sections and rewrites canonical json dotdotgod blocks as compact JSON.
pnpm run verifyRuns this repository's quality gate: generated-resource checks, package verify contracts, tests, typecheck, and docs validation where each package defines it.

Most users start with validate. Use traceability links --write only when generated traceability output needs repair, and use verify before release-style handoff in this repository.

Memory, Specs, and Config

The default scaffold gives docs explicit roles:

  • docs/spec/**: product behavior and requirements. This path is traceability-enforced by default.
  • docs/arch/**: architecture rationale, boundaries, conventions, and decisions.
  • docs/test/**: verification strategy, regression coverage, fixtures, and commands.
  • docs/plan/**: local active-task intent.
  • docs/archive/README.md: local archive map included by default.
  • docs/archive/**: local archive bodies excluded by default unless targeted.

Use memory.areas to customize memory classification and retrieval priority. Use traceability.required and traceability.exclude to select which Markdown paths need json dotdotgod blocks, and use ordered traceability.keys definitions to configure string-array labels, path or command targets, graph relations, and PPR weights. Use validation.markdown for size budgets and referenceExpansion for fuzzy prompt matching. The complete impactRanking namespace is non-blocking compatibility input: valid semantic candidate controls apply, malformed values fall back to defaults, and retired or unknown fields are ignored without changing fixed scoring. Legacy load.pinnedPaths and load.pinnedBodies values are also ignored.

Indexing Scope

dotdotgod index is gitignore-aware by default. It uses git ls-files --cached --others --exclude-standard when possible, then filters to supported text, source, script, config, web, and infrastructure files.

Default exclusions include dependency, generated, cache, and secret-like paths such as .git/, .dotdotgod/, node_modules/, dist/, build/, coverage/, .next/, target/, vendor/, .venv/, and .env. Example env templates such as .env.example remain indexable.

Learn More

See the root README, Context curation, Context mechanics, Memory area config, and Traceability config.

版本与发布记录

@dotdotgod/cli 共发布 98 个版本,首次发布于 2026/05/15;过去 12 个月发布了 98 个版本。

版本发布日期距今
0.8.1latest2026/11/113 天前
0.8.02026/11/103 天前
0.7.32026/11/058 天前
0.7.12026/10/2915 天前
0.7.02026/10/2916 天前
0.6.72026/10/2718 天前

其他发布通道:next → 0.6.6。

关于 @dotdotgod/cli 的常见问题

@dotdotgod/cli 是什么?

CLI for dotdotgod validation, hybrid document/code-outline search, and graph indexing.

如何安装 @dotdotgod/cli?

在项目目录运行 npm install @dotdotgod/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 dotdotgod,可以用 npx dotdotgod 直接运行。

@dotdotgod/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/dotdotgod__cli 是否存在。

@dotdotgod/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dotdotgod/cli 可以商用吗?

@dotdotgod/cli 使用 Elastic-2.0 许可。声明的许可为 Elastic-2.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@dotdotgod/cli 的下载量有多少?

根据 npm 官方下载统计,@dotdotgod/cli 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,108 次,日均约 70 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dotdotgod/cli 还在维护吗?

最新版本 0.8.1 发布于 2026/11/11(3 天前);至今共发布 98 个版本,其中过去 12 个月发布了 98 个;首次发布于 2026/05/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。