depwire-cli 0.7.1 โ†’ 0.9.0

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/LICENSE CHANGED
@@ -1,3 +1,5 @@
1
+ SPDX-License-Identifier: BUSL-1.1
2
+
1
3
  Business Source License 1.1
2
4
 
3
5
  Parameters
package/README.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Depwire
2
2
 
3
+ <p align="center">
4
+ <a href="https://glama.ai/mcp/servers/depwire/depwire">
5
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/depwire/depwire/badge" alt="Depwire MCP server" />
6
+ </a>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/depwire-cli">
11
+ <img src="https://img.shields.io/npm/v/depwire-cli.svg?style=flat-square" alt="npm version" />
12
+ </a>
13
+ <a href="https://www.npmjs.com/package/depwire-cli">
14
+ <img src="https://img.shields.io/npm/dm/depwire-cli.svg?style=flat-square" alt="npm downloads" />
15
+ </a>
16
+ <a href="LICENSE">
17
+ <img src="https://img.shields.io/badge/license-BUSL--1.1-blue.svg?style=flat-square" alt="License" />
18
+ </a>
19
+ <a href="https://github.com/depwire/depwire/stargazers">
20
+ <img src="https://img.shields.io/github/stars/depwire/depwire.svg?style=flat-square" alt="GitHub stars" />
21
+ </a>
22
+ <a href="https://github.com/depwire/depwire/network/members">
23
+ <img src="https://img.shields.io/github/forks/depwire/depwire.svg?style=flat-square" alt="GitHub forks" />
24
+ </a>
25
+ </p>
26
+
3
27
  ![Depwire - Arc diagram visualization of the Hono framework](./assets/depwire-hero.png)
4
28
 
5
29
  **See how your code connects. Give AI tools full codebase context.**
@@ -10,11 +34,12 @@ Depwire analyzes codebases to build a cross-reference graph showing how every fi
10
34
 
11
35
  - ๐ŸŽจ **Beautiful arc diagram visualization** โ€” Interactive Harrison Bible-style graphic
12
36
  - ๐Ÿค– **MCP server for AI tools** โ€” Cursor, Claude Desktop get full dependency context
13
- - ๐Ÿ“Š **Dependency health score** โ€” 0-100 score across 6 dimensions (coupling, cohesion, circular deps, god files, orphans, depth)
14
- - ๐Ÿ“„ **Auto-generated documentation** โ€” 12 comprehensive documents: architecture, conventions, dependencies, onboarding, file catalog, API surface, error patterns, test coverage, git history, full snapshot, TODO/FIXME inventory, and health report
37
+ - ๐Ÿ“Š **Dependency health score** โ€” 0-100 score across 6 dimensions (coupling, cohesion, circular deps, god files, orphans & dead code, depth)
38
+ - ๐Ÿ“„ **Auto-generated documentation** โ€” 13 comprehensive documents: architecture, conventions, dependencies, onboarding, file catalog, API surface, error patterns, test coverage, git history, full snapshot, TODO/FIXME inventory, health report, and dead code analysis
15
39
  - ๐Ÿ” **Impact analysis** โ€” "What breaks if I rename this function?" answered precisely
40
+ - ๐Ÿงน **Dead code detection** โ€” Find symbols that are defined but never referenced, categorized by confidence level
16
41
  - ๐Ÿ‘€ **Live updates** โ€” Graph stays current as you edit code
17
- - ๐ŸŒ **Multi-language** โ€” TypeScript, JavaScript, Python, and Go
42
+ - ๐ŸŒ **Multi-language** โ€” TypeScript, JavaScript, Python, Go, and Rust
18
43
 
19
44
  ## Why Depwire?
20
45
 
@@ -34,14 +59,14 @@ Depwire fixes this by giving AI tools a complete dependency graph of your codeba
34
59
  ### Ship Better Code
35
60
  - **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
36
61
  - **Refactor with confidence** โ€” see every downstream consumer, every transitive dependency, 2-3 levels deep
37
- - **Catch dead code** โ€” find symbols nobody references anymore
62
+ - **Catch dead code** โ€” find symbols nobody references anymore with confidence-based classification (high/medium/low)
38
63
 
39
64
  ### Stay in Flow
40
65
  - **Live graph, always current** โ€” edit a file and the dependency map updates in real-time. No re-indexing, no waiting.
41
66
  - **Works locally, stays private** โ€” zero cloud accounts, zero data leaving your machine. Just `npm install` and go.
42
67
 
43
- ### 14 MCP Tools, Not Just Visualization
44
- Depwire isn't just a pretty graph. It's a full context engine with 14 tools that AI assistants call autonomously โ€” architecture summaries, dependency tracing, symbol search, file context, health scores, temporal evolution, and more. The AI decides which tool to use based on your question.
68
+ ### 15 MCP Tools, Not Just Visualization
69
+ 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.
45
70
 
46
71
  ## Installation
47
72
 
@@ -66,11 +91,13 @@ depwire viz
66
91
  depwire parse
67
92
  depwire docs
68
93
  depwire health
94
+ depwire dead-code
69
95
  depwire temporal
70
96
 
71
97
  # Or specify a directory explicitly
72
98
  npx depwire-cli viz ./my-project
73
99
  npx depwire-cli parse ./my-project
100
+ npx depwire-cli dead-code ./my-project
74
101
  npx depwire-cli temporal ./my-project
75
102
 
76
103
  # Temporal visualization options
@@ -139,6 +166,7 @@ Settings โ†’ Features โ†’ Experimental โ†’ Enable MCP โ†’ Add Server:
139
166
  | `get_project_docs` | Retrieve auto-generated codebase documentation |
140
167
  | `update_project_docs` | Regenerate documentation on demand |
141
168
  | `get_health_score` | Get 0-100 dependency health score with recommendations |
169
+ | `find_dead_code` | Find dead code โ€” symbols defined but never referenced |
142
170
  | `get_temporal_graph` | Show how the graph evolved over git history |
143
171
 
144
172
  ## Supported Languages
@@ -149,6 +177,7 @@ Settings โ†’ Features โ†’ Experimental โ†’ Enable MCP โ†’ Add Server:
149
177
  | JavaScript | `.js`, `.jsx`, `.mjs`, `.cjs` | ES modules, CommonJS require(), JSX components |
150
178
  | Python | `.py` | Imports, classes, decorators, inheritance |
151
179
  | Go | `.go` | go.mod resolution, structs, interfaces, methods |
180
+ | Rust | `.rs` | Functions, structs, enums, traits, impl blocks, use declarations |
152
181
 
153
182
  ## Visualization
154
183
 
@@ -189,6 +218,8 @@ Opens an interactive arc diagram in your browser:
189
218
 
190
219
  Visualize how your codebase architecture evolved over git history. Scrub through time with an interactive timeline slider.
191
220
 
221
+ ![Depwire Temporal Graph](assets/depwire-temporal-hono.gif)
222
+
192
223
  ```bash
193
224
  # Auto-detects project root
194
225
  depwire temporal
@@ -220,6 +251,37 @@ Opens an interactive temporal visualization in your browser:
220
251
  - Auto-zoom to fit all arcs on snapshot change
221
252
  - Search to highlight specific files across time
222
253
 
254
+ ## ๐Ÿชฆ Dead Code Detection
255
+
256
+ Find unused symbols across your codebase before they become technical debt.
257
+
258
+ - Detects symbols with zero incoming references (never called, never imported)
259
+ - Confidence scoring: **high** (definitely dead), **medium** (probably dead), **low** (might be dead)
260
+ - Smart exclusion rules โ€” ignores entry points, test files, barrel files, and config files to reduce false positives
261
+ - Filter by confidence level, export as JSON for CI pipelines
262
+ - Integrated into the health score (orphans dimension)
263
+ - New MCP tool: `find_dead_code` โ€” AI assistants can query dead code directly
264
+ - New document generator: `DEAD_CODE.md` โ€” auto-generated dead code report
265
+
266
+ ```bash
267
+ depwire dead-code
268
+ depwire dead-code --confidence high
269
+ depwire dead-code --stats
270
+ depwire dead-code --json
271
+ ```
272
+
273
+ **Confidence Levels:**
274
+ - ๐Ÿ”ด **High confidence (definitely dead)**: Not exported with zero references, or exported but never used
275
+ - ๐ŸŸก **Medium confidence (probably dead)**: Exported from barrel files with zero dependents, or only used in test files
276
+ - โšช **Low confidence (might be dead)**: Exported from package entry points, types with zero dependents, or in dynamic-use directories (routes, middleware, etc.)
277
+
278
+ The dead code detector automatically excludes:
279
+ - Entry point files (index.ts, main.ts, server.ts, etc.)
280
+ - Test files (*.test.*, *.spec.*, __tests__/)
281
+ - Config files (*.config.*)
282
+ - Type declarations (*.d.ts)
283
+ - Framework auto-loaded directories (pages/, routes/, middleware/, commands/)
284
+
223
285
  ## How It Works
224
286
 
225
287
  1. **Parser** โ€” tree-sitter extracts every symbol and reference
@@ -357,6 +419,7 @@ depwire docs --update --only conventions
357
419
  | `CURRENT.md` | Complete codebase snapshot (every file, symbol, connection) |
358
420
  | `STATUS.md` | TODO/FIXME/HACK inventory with priority matrix |
359
421
  | `HEALTH.md` | Dependency health score (0-100) across 6 dimensions with recommendations |
422
+ | `DEAD_CODE.md` | Dead code analysis โ€” unused symbols by confidence level (high/medium/low) |
360
423
 
361
424
  Documents are stored in `.depwire/` with `metadata.json` tracking generation timestamps for staleness detection.
362
425
 
@@ -401,6 +464,56 @@ depwire health --json
401
464
 
402
465
  Health history is stored in `.depwire/health-history.json` (last 50 checks).
403
466
 
467
+ ### `depwire dead-code [directory]`
468
+
469
+ Detect unused symbols across your codebase with confidence-based classification.
470
+
471
+ **Directory argument is optional** โ€” Auto-detects project root.
472
+
473
+ **Options:**
474
+ - `--confidence <level>` โ€” Minimum confidence level to show: `high`, `medium`, `low` (default: `medium`)
475
+ - `--include-low` โ€” Shortcut for `--confidence low`
476
+ - `--verbose` โ€” Show detailed info for each dead symbol (file, line, kind, reason)
477
+ - `--stats` โ€” Show summary statistics
478
+ - `--include-tests` โ€” Include test files in analysis (excluded by default)
479
+ - `--json` โ€” Output as JSON for CI/automation
480
+
481
+ **Confidence Levels:**
482
+ - ๐Ÿ”ด **High confidence (definitely dead)**: Not exported with zero references, or exported but never used
483
+ - ๐ŸŸก **Medium confidence (probably dead)**: Exported from barrel files with zero dependents, or only used in test files
484
+ - โšช **Low confidence (might be dead)**: Exported from package entry points, types with zero dependents, or in dynamic-use directories (routes, middleware, etc.)
485
+
486
+ **Examples:**
487
+ ```bash
488
+ # Analyze dead code (default: medium confidence and above)
489
+ depwire dead-code
490
+
491
+ # Show only high-confidence dead code
492
+ depwire dead-code --confidence high
493
+
494
+ # Show all potential dead code (including low confidence)
495
+ depwire dead-code --confidence low
496
+ # Or use shortcut
497
+ depwire dead-code --include-low
498
+
499
+ # Detailed analysis with reasons and statistics
500
+ depwire dead-code --verbose --stats
501
+
502
+ # Include test files in analysis (excluded by default)
503
+ depwire dead-code --include-tests
504
+
505
+ # JSON output for CI/automation
506
+ depwire dead-code --json
507
+ ```
508
+
509
+ **Automatic Exclusions:**
510
+ The dead code detector automatically excludes:
511
+ - Entry point files (index.ts, main.ts, server.ts, etc.)
512
+ - Test files (*.test.*, *.spec.*, __tests__/)
513
+ - Config files (*.config.*)
514
+ - Type declarations (*.d.ts)
515
+ - Framework auto-loaded directories (pages/, routes/, middleware/, commands/)
516
+
404
517
  ### `depwire temporal [directory]`
405
518
 
406
519
  Visualize how the dependency graph evolved over git history.
@@ -500,10 +613,26 @@ See [SECURITY.md](SECURITY.md) for full details.
500
613
 
501
614
  ## Roadmap
502
615
 
503
- - [ ] PR Impact Visualization (GitHub Action)
504
- - [ ] Temporal Graph โ€” watch your architecture evolve over git history
616
+ ### โœ… Shipped
617
+ - [x] Arc diagram visualization
618
+ - [x] MCP server (15 tools)
619
+ - [x] Multi-language support (TypeScript, JavaScript, Python, Go, Rust)
620
+ - [x] File watching + live refresh
621
+ - [x] Auto-generated documentation (13 documents)
622
+ - [x] Dependency health score (0-100)
623
+ - [x] Dead code detection with confidence scoring
624
+ - [x] Temporal graph โ€” watch your architecture evolve over git history
625
+ - [x] PR Impact GitHub Action (depwire-action v1.0.0)
626
+ - [x] Auto-detect project root (no path needed)
627
+ - [x] WASM migration (Windows support)
628
+
629
+ ### ๐Ÿ”œ Coming Next
630
+ - [ ] New language support (C โ€” community requested)
631
+ - [ ] "What If" simulation โ€” simulate refactors before touching code
505
632
  - [ ] Cross-language edge detection (API routes โ†” frontend calls)
506
- - [ ] Dependency health scoring
633
+ - [ ] Cloud dashboard (first paid feature)
634
+ - [ ] AI-suggested refactors
635
+ - [ ] Natural language architecture queries
507
636
  - [ ] VSCode extension
508
637
 
509
638
  ## Contributing