Skip to content

serve command

Arham-Qureshi edited this page Jul 21, 2026 · 1 revision

serve — Launch the Visualizer

Starts a local HTTP server to serve the interactive graph visualizer and opens it in your browser.

codebase-vis serve

interactive visualizer

Opens http://localhost:3000 in your default browser, showing graph.html from codebase-out/.

How It Works

  1. Starts a lightweight HTTP server serving codebase-out/ as static files
  2. Routes / to graph.html
  3. graph.html fetches graph.json via fetch() and renders it with vis-network
  4. Auto-opens your browser using:
    • open on macOS
    • xdg-open on Linux
    • start on Windows

Visualizer Features

  • ForceAtlas2 physics — nodes repel and settle into an organic, readable layout
  • Community legend — color-coded checkboxes to toggle entire modules
  • Fuzzy search — find any node by name with smooth pan-to-node animation
  • Click to inspect — shows module, language, connection count, and neighbor links
  • Dependency toggle — show/hide npm package nodes
  • Entity toggle — show/hide inline class/function nodes
  • Minimap — Press M to toggle a navigable minimap
  • Cycle overlay — after running detect, highlights cyclic edges in red

Flags

Flag Default Description
-p, --port 3000 Port to serve on

Examples

codebase-vis serve              # Default port 3000
codebase-vis serve -p 4000      # Custom port
codebase-vis serve --port 8080  # Custom port (long flag)

Notes

  • Run codebase-vis generate first — serve serves the existing output, it doesn't regenerate
  • If port 3000 is in use, an EADDRINUSE error is printed — use -p to pick a different port
  • The visualizer works purely client-side. You can also open codebase-out/graph.html directly in your browser without the server

Clone this wiki locally