depwire-cli 0.9.19 → 0.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -33
- package/dist/{chunk-S3NZMIIU.js → chunk-QHVWDUSX.js} +382 -1874
- package/dist/chunk-XBCQPU63.js +2002 -0
- package/dist/index.js +172 -28
- package/dist/mcpb-entry.js +5 -3
- package/dist/sdk.d.ts +237 -0
- package/dist/sdk.js +32 -0
- package/package.json +16 -4
package/README.md
CHANGED
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|

|
|
11
11
|
|
|
12
|
-
**
|
|
12
|
+
**The missing context layer for AI coding assistants.**
|
|
13
|
+
|
|
14
|
+
Deterministic dependency graph. 16 MCP tools. Architecture health. What If simulation.
|
|
15
|
+
|
|
16
|
+
The context layer that turns vibe coding into software engineering.
|
|
13
17
|
|
|
14
18
|
⭐ **If Depwire helps you, please [star the repo](https://github.com/depwire/depwire)** — it helps this open-source project grow into an enterprise tool.
|
|
15
19
|
|
|
@@ -24,33 +28,6 @@ Depwire analyzes codebases to build a cross-reference graph showing how every fi
|
|
|
24
28
|
- 👀 **Live updates** — Graph stays current as you edit code
|
|
25
29
|
- 🌍 **Multi-language** — TypeScript, JavaScript, Python, Go, Rust, and C
|
|
26
30
|
|
|
27
|
-
## Why Depwire?
|
|
28
|
-
|
|
29
|
-
AI coding tools are flying blind. Every time Claude, Cursor, or Copilot touches your code, it's guessing about dependencies, imports, and impact. The result: broken refactors, hallucinated imports, and wasted tokens re-scanning files it already saw.
|
|
30
|
-
|
|
31
|
-
**Lost context = lost money + lost time + bad code.**
|
|
32
|
-
|
|
33
|
-
**Depwire parsed the entire Hono framework — 352 files, 5,971 symbols, 1,565 dependency edges — in ~3 seconds.** 40% fewer tool calls, 56% fewer file reads vs. no context layer.
|
|
34
|
-
|
|
35
|
-
Depwire fixes this by giving AI tools a complete dependency graph of your codebase — not a fuzzy embedding, not a keyword search, but a deterministic, tree-sitter-parsed map of every symbol and connection.
|
|
36
|
-
|
|
37
|
-
### Stop Losing Context
|
|
38
|
-
- **No more "start from scratch" chats** — Depwire is the shared knowledge layer that every AI session inherits. New chat? Your AI already knows the architecture.
|
|
39
|
-
- **Stop burning tokens** — AI tools query the graph instead of scanning hundreds of files blindly
|
|
40
|
-
- **One command, every AI tool** — Claude Desktop, Cursor, VS Code, any MCP-compatible tool gets the same complete picture
|
|
41
|
-
|
|
42
|
-
### Ship Better Code
|
|
43
|
-
- **Impact analysis for any change** — renaming a function, moving a file, upgrading a dependency, deleting a module — know the full blast radius before you touch anything
|
|
44
|
-
- **Refactor with confidence** — see every downstream consumer, every transitive dependency, 2-3 levels deep
|
|
45
|
-
- **Catch dead code** — find symbols nobody references anymore with confidence-based classification (high/medium/low)
|
|
46
|
-
|
|
47
|
-
### Stay in Flow
|
|
48
|
-
- **Live graph, always current** — edit a file and the dependency map updates in real-time. No re-indexing, no waiting.
|
|
49
|
-
- **Works locally, stays private** — zero cloud accounts, zero data leaving your machine. Just `npm install` and go.
|
|
50
|
-
|
|
51
|
-
### 15 MCP Tools, Not Just Visualization
|
|
52
|
-
Depwire isn't just a pretty graph. It's a full context engine with 15 tools that AI assistants call autonomously — architecture summaries, dependency tracing, symbol search, file context, health scores, dead code detection, temporal evolution, and more. The AI decides which tool to use based on your question.
|
|
53
|
-
|
|
54
31
|
## Installation
|
|
55
32
|
|
|
56
33
|

|
|
@@ -91,6 +68,7 @@ depwire docs
|
|
|
91
68
|
depwire health
|
|
92
69
|
depwire dead-code
|
|
93
70
|
depwire temporal
|
|
71
|
+
depwire whatif
|
|
94
72
|
|
|
95
73
|
# Or specify a directory explicitly
|
|
96
74
|
npx depwire-cli viz ./my-project
|
|
@@ -166,6 +144,60 @@ Settings → Features → Experimental → Enable MCP → Add Server:
|
|
|
166
144
|
| `get_health_score` | Get 0-100 dependency health score with recommendations |
|
|
167
145
|
| `find_dead_code` | Find dead code — symbols defined but never referenced |
|
|
168
146
|
| `get_temporal_graph` | Show how the graph evolved over git history |
|
|
147
|
+
| `simulate_change` | Simulate a move/delete/rename/split/merge before touching code. Returns health score delta, broken imports, and affected nodes. Zero file I/O. |
|
|
148
|
+
|
|
149
|
+
## SDK
|
|
150
|
+
|
|
151
|
+
depwire-cli exposes a public SDK for programmatic use:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npm install depwire-cli
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
import {
|
|
159
|
+
parseProject,
|
|
160
|
+
buildGraph,
|
|
161
|
+
calculateHealthScore,
|
|
162
|
+
analyzeDeadCode,
|
|
163
|
+
generateDocs,
|
|
164
|
+
SimulationEngine,
|
|
165
|
+
searchSymbols,
|
|
166
|
+
getImpact,
|
|
167
|
+
getArchitectureSummary,
|
|
168
|
+
DepwireSDKVersion
|
|
169
|
+
} from 'depwire-cli/sdk';
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The SDK is the stable public API surface. All cloud and tooling integrations
|
|
173
|
+
should import from `depwire-cli/sdk` — never from internal paths.
|
|
174
|
+
|
|
175
|
+
## What If Simulation
|
|
176
|
+
|
|
177
|
+
Simulate architectural changes before touching any code:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
depwire whatif . --simulate delete --target src/utils/encode.ts
|
|
181
|
+
depwire whatif . --simulate move --target src/utils/encode.ts --destination src/core/encode.ts
|
|
182
|
+
depwire whatif . --simulate rename --target src/utils/encode.ts --destination src/utils/encoder.ts
|
|
183
|
+
depwire whatif . --simulate split --target src/services/auth.ts --symbols "validateToken,refreshToken"
|
|
184
|
+
depwire whatif . --simulate merge --target src/utils/helpers.ts --merge-target src/utils/formatters.ts
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Returns: health score delta, broken imports, affected nodes, circular deps introduced/resolved.
|
|
188
|
+
Also available as MCP tool `simulate_change` for AI coding assistants.
|
|
189
|
+
|
|
190
|
+
## Why Depwire
|
|
191
|
+
|
|
192
|
+
| Feature | Depwire | Standard RAG (Fuzzy Search) | LLM Native Scanning |
|
|
193
|
+
|---------|---------|----------------------------|---------------------|
|
|
194
|
+
| Logic | Deterministic Graph | Probabilistic Match | Brute Force Reading |
|
|
195
|
+
| Precision | 100% (Tree-sitter AST) | ~70% (Embedding match) | Varies — hallucination prone |
|
|
196
|
+
| Refactor Safety | High — traces full call chains | Low — misses indirect refs | Zero — blind edits |
|
|
197
|
+
| Token Cost | Ultra-low — surgical reads | High — context stuffing | Extreme — scans everything |
|
|
198
|
+
| Circular Detection | Built-in | Not possible | Occasional |
|
|
199
|
+
| What If Simulation | Before touching code | Not possible | Not possible |
|
|
200
|
+
| Architecture Health Score | 0-100 with dimensions | Not possible | Not possible |
|
|
169
201
|
|
|
170
202
|
## GitHub Action — PR Impact Analysis
|
|
171
203
|
|
|
@@ -586,6 +618,46 @@ depwire temporal --output ./temp-snapshots
|
|
|
586
618
|
|
|
587
619
|
Snapshots are cached in `.depwire/temporal/` for fast re-rendering.
|
|
588
620
|
|
|
621
|
+
### `depwire whatif [directory]`
|
|
622
|
+
|
|
623
|
+
Simulate architectural changes before touching code.
|
|
624
|
+
|
|
625
|
+
**Directory argument is optional** — Auto-detects project root.
|
|
626
|
+
|
|
627
|
+
**Options:**
|
|
628
|
+
- `--simulate <action>` — Action to simulate: `move`, `delete`, `rename`, `split`, `merge`
|
|
629
|
+
- `--target <file>` — File to apply the action to
|
|
630
|
+
- `--destination <file>` — Destination path (for move action)
|
|
631
|
+
- `--new-name <name>` — New name (for rename action)
|
|
632
|
+
- `--source <file>` — Source file (for merge action)
|
|
633
|
+
- `--new-file <file>` — New file path (for split action)
|
|
634
|
+
- `--symbols <symbols>` — Comma-separated symbol names (for split action)
|
|
635
|
+
|
|
636
|
+
**Examples:**
|
|
637
|
+
```bash
|
|
638
|
+
# What breaks if I delete this file?
|
|
639
|
+
depwire whatif --simulate delete --target src/auth/service.ts
|
|
640
|
+
|
|
641
|
+
# What happens if I move this module?
|
|
642
|
+
depwire whatif --simulate move --target src/utils.ts --destination src/core/utils.ts
|
|
643
|
+
|
|
644
|
+
# Rename a file
|
|
645
|
+
depwire whatif --simulate rename --target src/router.ts --new-name routes.ts
|
|
646
|
+
|
|
647
|
+
# Split symbols into a new file
|
|
648
|
+
depwire whatif --simulate split --target src/utils.ts --new-file src/helpers.ts --symbols "formatDate,parseUrl"
|
|
649
|
+
|
|
650
|
+
# Merge two files
|
|
651
|
+
depwire whatif --simulate merge --target src/auth.ts --source src/login.ts
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
**Output:**
|
|
655
|
+
- Health score delta (before/after with improvement indicator)
|
|
656
|
+
- Broken imports with file and symbol details
|
|
657
|
+
- Affected nodes count
|
|
658
|
+
- Circular dependencies introduced or resolved
|
|
659
|
+
- Added and removed edge counts
|
|
660
|
+
|
|
589
661
|
### Error Handling
|
|
590
662
|
|
|
591
663
|
Depwire gracefully handles parse errors:
|
|
@@ -649,7 +721,7 @@ See [SECURITY.md](SECURITY.md) for full details.
|
|
|
649
721
|
|
|
650
722
|
### ✅ Shipped
|
|
651
723
|
- [x] Arc diagram visualization
|
|
652
|
-
- [x] MCP server (
|
|
724
|
+
- [x] MCP server (16 tools)
|
|
653
725
|
- [x] Multi-language support (TypeScript, JavaScript, Python, Go, Rust, C)
|
|
654
726
|
- [x] File watching + live refresh
|
|
655
727
|
- [x] Auto-generated documentation (13 documents)
|
|
@@ -660,18 +732,18 @@ See [SECURITY.md](SECURITY.md) for full details.
|
|
|
660
732
|
- [x] Auto-detect project root (no path needed)
|
|
661
733
|
- [x] WASM migration (Windows support)
|
|
662
734
|
- [x] Cloud dashboard — [app.depwire.dev](https://app.depwire.dev)
|
|
735
|
+
- [x] What If simulation — simulate refactors before touching code
|
|
663
736
|
|
|
664
|
-
###
|
|
737
|
+
### Coming Next
|
|
665
738
|
- [ ] New language support (Java, C++, Ruby — community requested)
|
|
666
|
-
- [ ] "What If" simulation — simulate refactors before touching code
|
|
667
739
|
- [ ] Cross-language edge detection (API routes ↔ frontend calls)
|
|
668
740
|
- [ ] AI-suggested refactors
|
|
669
741
|
- [ ] Natural language architecture queries
|
|
670
742
|
- [ ] VSCode extension
|
|
671
743
|
|
|
672
|
-
##
|
|
744
|
+
## Cloud Dashboard
|
|
673
745
|
|
|
674
|
-
|
|
746
|
+
Prefer a browser interface? [app.depwire.dev](https://app.depwire.dev) gives you the full dependency graph, health score, dead code report, and AI codebase chat — without any local setup. Free tier available.
|
|
675
747
|
|
|
676
748
|
- **Free** for public repos
|
|
677
749
|
- **Pro** ($19/month) — unlimited repos + private repo support
|