depwire-cli 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CodeGraph
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,178 @@
1
+ # Depwire
2
+
3
+ **See how your code connects. Give AI tools full codebase context.**
4
+
5
+ Depwire analyzes codebases to build a cross-reference graph showing how every file, function, and import connects. It provides:
6
+
7
+ - 🎨 **Beautiful arc diagram visualization** — Interactive Harrison Bible-style graphic
8
+ - 🤖 **MCP server for AI tools** — Cursor, Claude Desktop get full dependency context
9
+ - 🔍 **Impact analysis** — "What breaks if I rename this function?" answered precisely
10
+ - 👀 **Live updates** — Graph stays current as you edit code
11
+ - 🌍 **Multi-language** — TypeScript, JavaScript, Python, and Go
12
+
13
+ ## Quick Start
14
+
15
+ ### CLI Usage
16
+
17
+ ```bash
18
+ npx depwire viz ./my-project # Open visualization
19
+ npx depwire parse ./my-project # Export graph as JSON
20
+ ```
21
+
22
+ ### Claude Desktop
23
+
24
+ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "depwire": {
30
+ "command": "npx",
31
+ "args": ["-y", "depwire", "mcp"]
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ Then in chat:
38
+ ```
39
+ Connect to /path/to/my/project and show me the architecture.
40
+ ```
41
+
42
+ ### Cursor
43
+
44
+ Settings → Features → Experimental → Enable MCP → Add Server:
45
+ - Command: `npx`
46
+ - Args: `-y depwire mcp /path/to/project`
47
+
48
+ ## Available MCP Tools
49
+
50
+ | Tool | What It Does |
51
+ |------|-------------|
52
+ | `connect_repo` | Connect to any local project or GitHub repo |
53
+ | `impact_analysis` | What breaks if you change a symbol? |
54
+ | `get_file_context` | Full context — imports, exports, dependents |
55
+ | `get_dependencies` | What does a symbol depend on? |
56
+ | `get_dependents` | What depends on this symbol? |
57
+ | `search_symbols` | Find symbols by name |
58
+ | `get_architecture_summary` | High-level project overview |
59
+ | `list_files` | List all files with stats |
60
+ | `get_symbol_info` | Look up any symbol's details |
61
+
62
+ ## Supported Languages
63
+
64
+ | Language | Extensions | Features |
65
+ |----------|-----------|----------|
66
+ | TypeScript | `.ts`, `.tsx` | Full support — imports, classes, interfaces, types |
67
+ | JavaScript | `.js`, `.jsx`, `.mjs`, `.cjs` | ES modules, CommonJS require(), JSX components |
68
+ | Python | `.py` | Imports, classes, decorators, inheritance |
69
+ | Go | `.go` | go.mod resolution, structs, interfaces, methods |
70
+
71
+ ## Visualization
72
+
73
+ ```bash
74
+ depwire viz ./my-project
75
+ ```
76
+
77
+ Opens an interactive arc diagram in your browser:
78
+ - Rainbow-colored arcs showing cross-file dependencies
79
+ - Hover to explore connections
80
+ - Click to filter by file
81
+ - Search by filename
82
+ - Live refresh when files change
83
+ - Export as SVG or PNG
84
+
85
+ ## How It Works
86
+
87
+ 1. **Parser** — tree-sitter extracts every symbol and reference
88
+ 2. **Graph** — graphology builds an in-memory dependency graph
89
+ 3. **MCP** — AI tools query the graph for context-aware answers
90
+ 4. **Viz** — D3.js renders the graph as an interactive arc diagram
91
+
92
+ ## Installation
93
+
94
+ ```bash
95
+ npm install -g depwire
96
+ ```
97
+
98
+ Or use directly with `npx`:
99
+ ```bash
100
+ npx depwire --help
101
+ ```
102
+
103
+ ## Example Workflows
104
+
105
+ ### Refactoring with AI
106
+
107
+ ```
108
+ # In Claude Desktop or Cursor with Depwire MCP:
109
+
110
+ "Connect to /Users/me/my-app and analyze the impact of renaming UserService to UserRepository"
111
+
112
+ # Depwire responds with:
113
+ # - All files that import UserService
114
+ # - All call sites
115
+ # - All type references
116
+ # - Suggested find-and-replace strategy
117
+ ```
118
+
119
+ ### Understanding a New Codebase
120
+
121
+ ```
122
+ "Connect to https://github.com/t3-oss/create-t3-app and give me an architecture summary"
123
+
124
+ # Depwire responds with:
125
+ # - Language breakdown
126
+ # - Module/package structure
127
+ # - Most-connected files (architectural hubs)
128
+ # - Entry points
129
+ ```
130
+
131
+ ### Pre-Commit Impact Check
132
+
133
+ ```bash
134
+ # Check what your changes affect before committing
135
+ depwire viz . --open
136
+ # Review the arc diagram — red arcs show files you touched
137
+ ```
138
+
139
+ ## Security
140
+
141
+ Depwire is **read-only** — it never writes to, modifies, or executes your code.
142
+
143
+ - Parses source files with tree-sitter (the same parser used by VS Code and Zed)
144
+ - Visualization server binds to localhost only
145
+ - No data leaves your machine — everything runs locally
146
+ - Blocks access to sensitive system directories (.ssh, .aws, /etc)
147
+ - npm packages published with provenance verification
148
+
149
+ See [SECURITY.md](SECURITY.md) for full details.
150
+
151
+ ## Roadmap
152
+
153
+ - [ ] PR Impact Visualization (GitHub Action)
154
+ - [ ] Temporal Graph — watch your architecture evolve over git history
155
+ - [ ] Cross-language edge detection (API routes ↔ frontend calls)
156
+ - [ ] Dependency health scoring
157
+ - [ ] VSCode extension
158
+
159
+ ## Contributing
160
+
161
+ Contributions welcome! Depwire is open source and community-driven.
162
+
163
+ 1. Fork the repository
164
+ 2. Create a feature branch
165
+ 3. Add tests for new functionality
166
+ 4. Submit a pull request
167
+
168
+ ## License
169
+
170
+ MIT — Copyright (c) 2026 ATEF ATAYA LLC
171
+
172
+ ## Credits
173
+
174
+ Built with:
175
+ - [tree-sitter](https://tree-sitter.github.io/tree-sitter/) — Fast, reliable parsing
176
+ - [graphology](https://graphology.github.io/) — Powerful graph data structure
177
+ - [D3.js](https://d3js.org/) — Data visualization
178
+ - [Model Context Protocol](https://modelcontextprotocol.io/) — AI tool integration