| Crates.io | dimpact |
| lib.rs | dimpact |
| version | 0.1.1 |
| created_at | 2025-10-02 03:19:11.638217+00 |
| updated_at | 2025-10-02 06:22:07.347003+00 |
| description | impact analysis from diff |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1863830 |
| size | 526,484 |
Fast, language-aware impact analysis for changed code. Feed it a git diff or seed it with specific symbols; get back changed symbols, impacted symbols, and optional reference edges.
Highlights
Quick Start
cargo build --releasegit diff --no-ext-diff | dimpact diff -f jsongit diff --no-ext-diff | dimpact changed --lang auto --engine auto -f jsongit diff --no-ext-diff | dimpact impact --direction callers --with-edges -f jsondimpact impact --seed-symbol 'rust:src/lib.rs:fn:foo:12' --direction callers -f jsondimpact impact --seed-json '["typescript:src/a.ts:fn:run:10"]' -f jsongit diff --no-ext-diff | dimpact impact --per-seed --direction both --with-edges -f jsonSymbol ID generator
dimpact id --path src/lib.rs --rawdimpact id --path src/lib.rs --line 120 -f jsondimpact id --path src/lib.rs --name foo --kind fn --rawdimpact id --name foo -f jsonCLI Overview
Subcommands:
diff: parse unified diff from stdinchanged: compute changed symbols from stdin diffimpact: compute impact from stdin diff or seeds (supports diff- and seed-based analyses)id: generate Symbol IDs from file/line/namecache: build/stats/clear the incremental cacheSeeds:
--seed-symbol LANG:PATH:KIND:NAME:LINE (repeatable)--seed-json <json|string|path|-> accepts array of strings or objectsOutput formats: -f json|yaml|dot|html
Impact Options (subcommand impact):
--direction callers|callees|both : traversal direction (default: callers)--max-depth N : max traversal depth (default: 100)--with-edges : include reference edges in output--ignore-dir DIR : ignore directories by relative prefix (repeatable)--with-pdg : use PDG-based dependence analysis (Rust/Ruby for DFG)--with-propagation : enable symbolic propagation across variables and functions (implies PDG)--engine auto|ts|lsp : analysis engine (default: auto)--engine-lsp-strict : strict mode for LSP engine--engine-dump-capabilities: dump engine capabilities to stderr--seed-symbol LANG:PATH:KIND:NAME:LINE : seed symbols by ID (repeatable)--seed-json PATH|'-'|JSON : seed symbols via JSON array or file or stdin--per-seed : group impact per changed/seed symbol; direction=both時はcaller/calley別出力dot format with --with-pdg and -f dot:
git diff --no-ext-diff | dimpact impact --with-pdg -f dot
Path highlighting in DOT/HTML
--with-edges, the DOT and HTML outputs highlight edges that are on a shortest path from any changed symbol to any impacted symbol.Engine Selection
--engine lsp
--engine-lsp-strict: don’t fall back to TS on LSP issues--engine-dump-capabilities: emit LSP capabilities JSON to stderrLogging
env_logger. Set RUST_LOG=info (or debug|trace) to see diagnostics.Usage Examples
git diff --no-ext-diff | dimpact impact --direction callers --with-edges -f jsongit diff --no-ext-diff | dimpact impact --direction callees --max-depth 2 -f yamlgit diff --no-ext-diff | dimpact impact --engine ts -f jsongit diff --no-ext-diff | dimpact impact --engine lsp --engine-lsp-strict --engine-dump-capabilities -f jsonRUST_LOG=info to see more diagnosticsdimpact impact --seed-symbol 'rust:src/lib.rs:fn:foo:12' --direction callers -f jsonecho '["typescript:src/a.ts:fn:run:10","typescript:src/b.ts:method:App::start:5"]' > seeds.jsondimpact impact --seed-json seeds.json --direction both -f json-):
printf '[{"lang":"rust","path":"src/lib.rs","kind":"fn","name":"foo","line":12}]' | dimpact impact --seed-json - --direction callers -f jsondimpact id --path src/lib.rs --name foo --kind fn --raw | dimpact impact --seed-json - --direction callers -f jsondimpact id --name initialize --rawLicense
index.db stored in either location:
<repo_root>/.dimpact/cache/v1/index.db$XDG_CONFIG_HOME/dimpact/cache/v1/<repo_key>/index.dbdimpact cache build --scope local|global [--dir PATH]dimpact cache stats --scope local|global [--dir PATH]dimpact cache clear --scope local|global [--dir PATH]DIMPACT_CACHE_SCOPE=local|global, DIMPACT_CACHE_DIR=/custom/dir.