@zoldia/omnigraph 1.1.0 → 1.3.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/README.md +99 -19
- package/dist/cli.js +98996 -57643
- package/package.json +20 -3
- package/ui/assets/{index-CLCEDDVO.css → index-B5F7Gzza.css} +1 -1
- package/ui/assets/index-DtnabKtd.js +28 -0
- package/ui/index.html +2 -2
- package/ui/assets/index-B4R9LC7F.js +0 -23
package/README.md
CHANGED
|
@@ -12,6 +12,11 @@ OmniGraph is a free, local developer tool that statically analyzes full-stack mo
|
|
|
12
12
|
| **JavaScript** | `.js`, `.jsx` | CommonJS and ES module imports |
|
|
13
13
|
| **Python** | `.py` | FastAPI (`@router.get`, `@app.post`), Flask (`@app.route`), Django (Views, Models) |
|
|
14
14
|
| **PHP** | `.php` | Laravel (Controllers, Models, Middleware, Route definitions) |
|
|
15
|
+
| **Go** | `.go` | net/http, Gin, Echo, Fiber, Chi, Gorilla Mux handlers |
|
|
16
|
+
| **Rust** | `.rs` | Actix-web, Axum, Rocket route handlers |
|
|
17
|
+
| **Java** | `.java` | Spring Boot (`@RestController`, `@Service`, `@Repository`, `@GetMapping`) |
|
|
18
|
+
| **OpenAPI** | `.json`, `.yaml` | Swagger/OpenAPI path endpoints and schema models |
|
|
19
|
+
| **GraphQL** | `.graphql`, `.gql` | Type definitions, Query/Mutation/Subscription fields |
|
|
15
20
|
| **Markdown** | `.md`, `.mdx` | Obsidian wiki-links (`[[Page]]`), embeds (`![[Page]]`), frontmatter tags/aliases |
|
|
16
21
|
|
|
17
22
|
## Quick Start
|
|
@@ -33,19 +38,52 @@ npm run build
|
|
|
33
38
|
npm run dev -- --path ../my-project
|
|
34
39
|
```
|
|
35
40
|
|
|
36
|
-
Then open `http://localhost:
|
|
41
|
+
Then open `http://localhost:4000` in your browser.
|
|
37
42
|
|
|
38
|
-
### CLI
|
|
43
|
+
### CLI Commands
|
|
39
44
|
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
omnigraph --path <repo-path>
|
|
45
|
+
```bash
|
|
46
|
+
# Start the visualization server (default action)
|
|
47
|
+
omnigraph --path <repo-path> # Starts server on port 4000
|
|
48
|
+
omnigraph --path <repo-path> serve --port 8080 # Custom port
|
|
49
|
+
omnigraph --path <repo-path> --watch # Live watch mode (auto-refresh on file changes)
|
|
50
|
+
|
|
51
|
+
# Query the dependency graph
|
|
52
|
+
omnigraph --path <repo-path> graph --stats # Summary statistics
|
|
53
|
+
omnigraph --path <repo-path> graph --node src/index.ts # Inspect a node
|
|
54
|
+
omnigraph --path <repo-path> graph --deps src/index.ts # Transitive dependencies
|
|
55
|
+
omnigraph --path <repo-path> graph --filter nextjs-api-route # Filter by type
|
|
56
|
+
|
|
57
|
+
# Trace data flow
|
|
58
|
+
omnigraph --path <repo-path> trace --from src/app/api/users/route.ts
|
|
59
|
+
|
|
60
|
+
# List methods in a file
|
|
61
|
+
omnigraph --path <repo-path> methods --file src/lib/auth.ts --exported
|
|
62
|
+
|
|
63
|
+
# Make HTTP requests (like curl/Postman)
|
|
64
|
+
omnigraph --path <repo-path> fetch --url http://localhost:3000/api/users \
|
|
65
|
+
--method POST --body '{"email":"test@test.com"}' --env-token AUTH_TOKEN
|
|
66
|
+
|
|
67
|
+
# Inspect database schema from graph
|
|
68
|
+
omnigraph --path <repo-path> schema --fk
|
|
69
|
+
omnigraph --path <repo-path> schema --table users
|
|
70
|
+
|
|
71
|
+
# Diff / blast radius analysis
|
|
72
|
+
omnigraph --path <repo-path> diff # Changed files vs main branch
|
|
73
|
+
omnigraph --path <repo-path> diff --uncommitted # Uncommitted changes only
|
|
74
|
+
omnigraph --path <repo-path> diff --base develop --depth 3 # Custom base, BFS depth
|
|
75
|
+
omnigraph --path <repo-path> diff --blast-only # Only show affected dependents
|
|
76
|
+
|
|
77
|
+
# Machine-readable JSON output (for AI coding agents)
|
|
78
|
+
omnigraph --path <repo-path> --json graph --stats
|
|
79
|
+
omnigraph --path <repo-path> --json trace --from src/index.ts
|
|
80
|
+
omnigraph --path <repo-path> --json diff --uncommitted
|
|
43
81
|
```
|
|
44
82
|
|
|
45
83
|
## Features
|
|
46
84
|
|
|
47
85
|
### Multi-Language Dependency Graph
|
|
48
|
-
Point OmniGraph at any project containing TypeScript, JavaScript, Python, PHP, or Markdown files. It recursively walks the directory, respects `.gitignore`, and builds a dependency graph from import/require statements and wiki-links.
|
|
86
|
+
Point OmniGraph at any project containing TypeScript, JavaScript, Python, PHP, Go, Rust, Java, OpenAPI, GraphQL, or Markdown files. It recursively walks the directory, respects `.gitignore`, and builds a dependency graph from import/require statements and wiki-links.
|
|
49
87
|
|
|
50
88
|
### Framework-Aware Parsing
|
|
51
89
|
OmniGraph doesn't just find imports — it understands framework patterns:
|
|
@@ -54,17 +92,51 @@ OmniGraph doesn't just find imports — it understands framework patterns:
|
|
|
54
92
|
- **FastAPI/Flask**: Detects route decorators (`@router.get("/users")`) with HTTP methods and paths
|
|
55
93
|
- **Django**: Detects class-based views (`APIView`, `ViewSet`) and models
|
|
56
94
|
- **Laravel**: Detects controllers, models, middleware, and `Route::get()` definitions
|
|
95
|
+
- **Go**: Detects HTTP handlers for net/http, Gin, Echo, Fiber, Chi, and Gorilla Mux
|
|
96
|
+
- **Rust**: Detects route attributes for Actix-web, Axum, and Rocket (`#[get("/path")]`)
|
|
97
|
+
- **Java/Spring**: Detects `@RestController`, `@Service`, `@Repository` stereotypes and `@GetMapping`/`@PostMapping` routes
|
|
98
|
+
- **OpenAPI/Swagger**: Extracts path endpoints and schema models from `.json`/`.yaml` specs
|
|
99
|
+
- **GraphQL**: Extracts type definitions and Query/Mutation/Subscription fields
|
|
57
100
|
- **Obsidian/Markdown**: Detects wiki-links (`[[Page]]`), embeds (`![[Page]]`), YAML frontmatter (tags, aliases), and classifies MOC/daily/readme note types
|
|
58
101
|
|
|
59
102
|
### Interactive Visualization
|
|
60
|
-
- **
|
|
103
|
+
- **6 Layout Presets**: Directory (grouped by folder), Hierarchical, Column Flow (Frontend/API/Services/Database), Force-Directed, Grid, Mind Map (LR/RL)
|
|
104
|
+
- **Column Flow Layout**: Top-to-bottom layout with 4 columns. Nodes are auto-classified by type and file path. Column-aware compaction preserves columns while collapsing vertical gaps.
|
|
61
105
|
- **Live Force Simulation**: In force-directed mode, dragging a node causes nearby nodes to push and pull reactively via d3-force physics
|
|
62
106
|
- **Search & Filter with BFS Expansion**: Search nodes by name, filter by type with color-coded toggle chips. Hide or dim non-matching nodes. Connected nodes expand via BFS depth slider to reveal full data flow paths.
|
|
63
107
|
- **Hub-Centric Compaction**: After filtering, compact visible nodes around the most-connected hub node(s) using d3-force. Single hub stays pinned; multiple hubs meet at their average position.
|
|
64
|
-
- **Node Inspector**: Click any node to see its file path, type, route metadata, and ID in the sidebar
|
|
65
|
-
- **
|
|
108
|
+
- **Node Inspector**: Click any node to see its file path, type, route metadata, and ID in the sidebar. Expand file nodes into individual method-level nodes.
|
|
109
|
+
- **Database ERD**: DB tables connected via foreign key edges (ERD-style). Click an API route to highlight all connected DB tables.
|
|
110
|
+
- **Dark/Light Theme**: System-aware theme toggle with dark (default) and light modes. Persisted in localStorage.
|
|
111
|
+
- **Color-Coded Types**: Each node type has a distinct color — controllers (red), injectables (blue), modules (orange), Python files (blue), FastAPI routes (teal), Laravel controllers (red), Go files (cyan), Rust files (sandy), Java/Spring (green), OpenAPI (lime), GraphQL (pink), markdown (purple), DB tables (steel-blue), and more
|
|
66
112
|
- **Clickable Minimap**: Zoom and pan directly on the minimap for faster navigation
|
|
67
113
|
|
|
114
|
+
### Live Watch Mode
|
|
115
|
+
Start with `--watch` to enable live file watching. OmniGraph monitors your project for changes and automatically re-parses and pushes updates to the UI via Server-Sent Events (SSE). No manual refresh needed.
|
|
116
|
+
|
|
117
|
+
### Keyboard Shortcuts
|
|
118
|
+
- `Ctrl+K` / `⌘K` — Focus search
|
|
119
|
+
- `1`–`6` — Switch layout presets
|
|
120
|
+
- `C` — Compact visible nodes
|
|
121
|
+
- `?` — Show shortcut help overlay
|
|
122
|
+
- `Esc` — Close panels and overlays
|
|
123
|
+
|
|
124
|
+
### Bookmarks & Annotations
|
|
125
|
+
- **Bookmarks** — Save named graph views (layout, search query, active filters, depth) and restore them instantly. Export/import as JSON.
|
|
126
|
+
- **Annotations** — Attach text notes to any node. Annotations persist in localStorage and can be exported/imported.
|
|
127
|
+
|
|
128
|
+
### Diff & Blast Radius
|
|
129
|
+
The `diff` command analyzes which files changed between git refs (or uncommitted changes) and computes a blast radius — the set of files transitively affected by those changes via the dependency graph. Useful for estimating the impact of a PR.
|
|
130
|
+
|
|
131
|
+
### CLI for Humans and AI Agents
|
|
132
|
+
All CLI commands support `--json` for machine-readable output, designed for AI coding agents (Claude Code, Cursor, etc.):
|
|
133
|
+
- **`graph`** — Query nodes, edges, dependencies, reverse dependencies, stats
|
|
134
|
+
- **`trace`** — Trace data flow from a file through HTTP calls to database queries
|
|
135
|
+
- **`fetch`** — HTTP client with `.env` token resolution (like curl/Postman)
|
|
136
|
+
- **`methods`** — List functions/methods in a file with filters
|
|
137
|
+
- **`schema`** — Inspect database tables, foreign keys, code references
|
|
138
|
+
- **`diff`** — Git diff analysis with blast radius computation
|
|
139
|
+
|
|
68
140
|
### Export
|
|
69
141
|
- **PNG** — 2x resolution raster image
|
|
70
142
|
- **SVG** — Scalable vector graphic
|
|
@@ -73,10 +145,10 @@ OmniGraph doesn't just find imports — it understands framework patterns:
|
|
|
73
145
|
|
|
74
146
|
### Sidebar Tabs
|
|
75
147
|
The right sidebar has four tabs:
|
|
76
|
-
- **Graph** — Layout selector, search/filter with depth slider, type chips, node inspector, export dropdown, compact button
|
|
77
|
-
- **API** — Postman-style API debugger (auto-fills from cross-network edges)
|
|
78
|
-
- **Trace** — Step-through flow tracer with Back/Next navigation and
|
|
79
|
-
- **Settings** —
|
|
148
|
+
- **Graph** — Layout selector (6 presets), search/filter with depth slider, type chips, node inspector with method expansion, bookmarks, export dropdown, compact button
|
|
149
|
+
- **API** — Postman-style API debugger with configurable base URL (auto-fills from cross-network edges)
|
|
150
|
+
- **Trace** — Step-through flow tracer with Back/Next navigation, animated highlighting, and database query/join/result steps
|
|
151
|
+
- **Settings** — Theme toggle (system/dark/light), configurable edge labels (show/hide per type, color, font size), graph options (minimap, edge animation, FK labels), search defaults, with per-category reset and localStorage persistence
|
|
80
152
|
|
|
81
153
|
## Technology Stack
|
|
82
154
|
|
|
@@ -84,14 +156,20 @@ The right sidebar has four tabs:
|
|
|
84
156
|
|-----------|-----------|
|
|
85
157
|
| Monorepo | npm workspaces (5 packages) |
|
|
86
158
|
| CLI | Node.js + TypeScript + Commander.js |
|
|
87
|
-
| Server | Express.js with rate limiting |
|
|
159
|
+
| Server | Express.js with rate limiting + SSE watch mode |
|
|
88
160
|
| TypeScript/JS Parser | `@typescript-eslint/typescript-estree` |
|
|
89
161
|
| Python Parser | Regex-based AST extraction |
|
|
90
162
|
| PHP Parser | Regex-based AST extraction |
|
|
163
|
+
| Go Parser | Regex-based (imports, structs, HTTP handlers) |
|
|
164
|
+
| Rust Parser | Regex-based (mod/use, structs, route attributes) |
|
|
165
|
+
| Java Parser | Regex-based (imports, Spring annotations) |
|
|
166
|
+
| OpenAPI Parser | JSON.parse + line-based YAML extraction |
|
|
167
|
+
| GraphQL Parser | Regex-based type/field extraction |
|
|
91
168
|
| Markdown Parser | Regex-based wiki-link/embed/frontmatter extraction |
|
|
92
169
|
| Frontend | React 18 + Vite |
|
|
93
170
|
| Graph Engine | React Flow |
|
|
94
|
-
| Layout Engines | dagre (hierarchical/mind map), d3-force (force-directed, compaction) |
|
|
171
|
+
| Layout Engines | dagre (hierarchical/mind map), d3-force (force-directed, compaction), custom column flow |
|
|
172
|
+
| Theming | CSS custom properties with system/dark/light modes |
|
|
95
173
|
| GIF Export | gif.js (web worker encoding) |
|
|
96
174
|
| Testing | Vitest |
|
|
97
175
|
|
|
@@ -165,7 +243,7 @@ All parsers produce a standardized graph format regardless of source language:
|
|
|
165
243
|
## Running Tests
|
|
166
244
|
|
|
167
245
|
```bash
|
|
168
|
-
npx vitest run # Run all tests
|
|
246
|
+
npx vitest run # Run all tests
|
|
169
247
|
npx vitest --watch # Watch mode
|
|
170
248
|
```
|
|
171
249
|
|
|
@@ -181,10 +259,10 @@ Contributions are welcome! Here's how to get started:
|
|
|
181
259
|
|
|
182
260
|
### Good First Issues
|
|
183
261
|
|
|
184
|
-
- Add a new language parser (
|
|
262
|
+
- Add a new language parser (C#, Ruby, Swift, Kotlin)
|
|
185
263
|
- Improve import resolution for edge cases (barrel exports, dynamic imports)
|
|
186
|
-
- Add
|
|
187
|
-
-
|
|
264
|
+
- Add Dockerfile / docker-compose parsing
|
|
265
|
+
- Terraform / infrastructure-as-code graph support
|
|
188
266
|
|
|
189
267
|
## Project Documentation
|
|
190
268
|
|
|
@@ -195,7 +273,9 @@ Contributions are welcome! Here's how to get started:
|
|
|
195
273
|
| [ADR-001](docs/adr/ADR-001-parsing-engine.md) | Why typescript-estree for Phase 1 |
|
|
196
274
|
| [ADR-002](docs/adr/ADR-002-phase2-multi-language-parsing.md) | Why regex-based parsing for Phase 2 Python/PHP |
|
|
197
275
|
| [ADR-003](docs/adr/ADR-003-markdown-obsidian-parser.md) | Markdown/Obsidian wiki-link parser design |
|
|
276
|
+
| [ADR-004](docs/adr/ADR-004-database-integration.md) | Database integration architecture |
|
|
198
277
|
| [API Spec](docs/API-SPEC.md) | HTTP endpoint and CLI interface documentation |
|
|
278
|
+
| [Changelog](CHANGELOG.md) | Detailed release changelog |
|
|
199
279
|
|
|
200
280
|
## License
|
|
201
281
|
|