How kanukuntla-r/forge works
forge is a project-scaffolding and codebase-understanding CLI. Users select a blueprint, supply variables, and generate a project; they can extend an existing project, then analyze and visualize its wiring in a live dashboard. The graph preserves the documented multi-language, cross-language, and database-analysis capabilities, plus batch rendering. Some subsystem links are documented in the README rather than shown in sampled implementation excerpts; those links cite the README, and unsampled internals are represented at their exact enclosing directory paths.
Main entry points: pipeline.go Analysis pipeline · main.go CLI entry · server.go Dashboard server · new.go Create project
Components 31
CLI workflows
- CLI entry
cmd/forge/main.go - Create project
internal/cli/new.go - Add extension
internal/cli/add.go - Analyze command
internal/cli/analyze.go - Visualize command
internal/cli/visualize.go - List blueprints
internal/cli/list.go - Install blueprint
internal/cli/install.go
Blueprint scaffolding
- Blueprint registry
internal/blueprint/registry.go - Blueprint catalog
internal/blueprint/embedded.go - Manifest parsing
internal/manifest - Variable resolution
internal/render/values.go - Template rendering
internal/render/walk.go - Knowledge graphs
internal/graph/emit.go - Post-create hooks
internal/hooks/runner.go - Project detection
internal/project/detect.go
Project analysis
- Analysis pipeline
internal/analyzer/pipeline.go - TypeScript parsing
internal/analyzer/parser/typescript - Python parsing
internal/analyzer/parser/python - Framework analysis
internal/analyzer - Route matching
internal/analyzer/cross_framework.go - Database detection
internal/analyzer/database.go
Dashboard and rendering
- Dashboard server
internal/dashboard/server.go - Live file watcher
internal/dashboard/watcher.go - Update channel
internal/dashboard/websocket.go - Dashboard UI
internal/dashboard/static/app.js - Batch rendering
internal/renderer/batch.go - Page rendering
internal/renderer/pages.go
Other components
- Developer
- Project source
- Browser
- Git blueprint
Connections 40
- Developer → CLI entry: runs command
- CLI entry → Create project: dispatches
- CLI entry → Add extension: dispatches
- CLI entry → Analyze command: dispatches
- CLI entry → Visualize command: dispatches
- CLI entry → List blueprints: dispatches
- CLI entry → Install blueprint: dispatches
- Create project → Blueprint registry: looks up
internal/cli/new.go - Create project → Variable resolution: resolves inputs
internal/cli/new.go - Create project → Template rendering: writes project
internal/cli/new.go - Create project → Knowledge graphs: emits graph
internal/cli/new.go - Create project → Post-create hooks: runs hooks
internal/cli/new.go - Add extension → Project detection: detects project
internal/cli/add.go - Add extension → Blueprint registry: looks up
internal/cli/add.go - Add extension → Variable resolution: resolves inputs
internal/cli/add.go - Add extension → Template rendering: writes extension
internal/cli/add.go - Add extension → Knowledge graphs: merges graph
internal/cli/add.go - Blueprint registry → Blueprint catalog: loads embedded
internal/blueprint/registry.go - Blueprint catalog → Manifest parsing: parses manifests
internal/blueprint/embedded.go - Blueprint registry → Manifest parsing: parses installed
internal/blueprint/registry.go - Variable resolution → Manifest parsing: reads definitions
internal/render/values.go - Install blueprint → Git blueprint: installs from Git
- Analyze command → Analysis pipeline: analyzes project
- Visualize command → Analysis pipeline: analyzes project
- Project source → Analysis pipeline: supplies source
- Analysis pipeline → TypeScript parsing: parses TypeScript
- Analysis pipeline → Python parsing: parses Python
- Analysis pipeline → Framework analysis: detects frameworks
- Analysis pipeline → Route matching: matches routes
- Analysis pipeline → Database detection: detects schema use
- Visualize command → Dashboard server: opens dashboard
- Dashboard server → Analysis pipeline: reanalyzes changes
internal/dashboard/server.go - Dashboard server → Live file watcher: starts watcher
internal/dashboard/server.go - Live file watcher → Dashboard server: triggers analysis
internal/dashboard/server.go - Dashboard server → Update channel: serves updates
internal/dashboard/server.go - Dashboard server → Dashboard UI: serves interface
internal/dashboard/server.go - Browser → Dashboard server: opens dashboard
internal/dashboard/server.go - Batch rendering → Analysis pipeline: loads analysis
internal/renderer/batch.go - Visualize command → Batch rendering: renders previews
- Batch rendering → Page rendering: uses page renderer