Interactive Text User Interface for generating UML city visualizations from any codebase!
Standalone UML generator for SwarmDesk 3D code visualization - analyze any JavaScript/TypeScript codebase with TypeScript AST parsing, dependency graph analysis, and external library detection.
npm install -g @madnessengineering/uml-generatorThen run anywhere:
swarmdesk-uml
# or
swarmdesk-uml /path/to/project
# or
swarmdesk-uml https://github.com/user/reponpm install --save-dev @madnessengineering/uml-generatorAdd to your package.json scripts:
{
"scripts": {
"visualize": "swarmdesk-uml . --output uml-data.json"
}
}Upload your UML data directly to your SwarmDesk account and visualize in the 3D dashboard!
swarmdesk-uml loginThis will:
- Open your browser to authorize the CLI
- Display a device code to enter
- Store your credentials securely in
~/.config/
# Analyze and upload in one command
swarmdesk-uml . --upload
# Analyze GitHub repo and upload
swarmdesk-uml https://github.com/facebook/react --uploadswarmdesk-uml upload my-project-uml.jsonswarmdesk-uml whoamiswarmdesk-uml logoutAfter upload, visit https://madnessinteractive.cc/dashboard
Navigate to: Projects โ [Your Project] โ 3D Code Lab
- Tokens stored securely in user's home directory with encryption
- Auto-refresh prevents session expiration
- HTTPS-only API communication
- OAuth Device Flow for secure CLI authentication
Now featuring a beautiful interactive TUI mode alongside the classic CLI for maximum flexibility.
Launch an interactive terminal UI with menus, progress bars, and live previews:
- ๐จ Beautiful ASCII art interface with colored output
- ๐ Smart project discovery - automatically suggests projects from common locations
- โ๏ธ Interactive configuration - customize patterns with visual prompts
- ๐ Live progress indicators - watch your analysis happen in real-time
- ๐๏ธ ASCII city preview - see building heights before loading in 3D
- ๐ Batch analysis - analyze multiple projects in one session
Simply run without arguments to launch the TUI:
cd uml-generator-cli
npm install
node uml-generator.js
# or
npm startYou'll see:
- A beautiful SWARMDESK banner
- Menu to select from suggested projects
- Options to browse local directories or clone GitHub repos
- Interactive configuration wizard
- Real-time analysis progress with spinners
- Results table with top complexity components
- ASCII art city preview!
For scripts and automation, use with arguments:
# Analyze local directory
node uml-generator.js /path/to/project
# Analyze GitHub repo
node uml-generator.js https://github.com/facebook/react
# Custom output with options
node uml-generator.js . --output my-project.json --include "src,lib"
# Show help
node uml-generator.js --helpcd uml-generator-cli
npm installDependencies include:
inquirer- Interactive promptsora- Elegant terminal spinnerschalk- Colorful outputcli-table3- Beautiful ASCII tablesboxen- Fancy boxesgradient-string- Rainbow gradientsfiglet- ASCII art text
Best for: Interactive exploration, learning, one-off analyses
node uml-generator.jsFeatures:
- Project suggestions from common locations
- Visual menus and prompts
- Real-time progress feedback
- Results preview with complexity metrics
- ASCII art city visualization
- Multi-project batch processing
Best for: Automation, CI/CD, scripting
node uml-generator.js [path|url] [options]See UML-GENERATOR-README.md for full CLI documentation.
If you see output like this:
๐ Found 0 source files
โจ UML Generation Complete!
๐ Classes analyzed: 0
Your project likely uses a non-standard directory structure that doesn't match the default search patterns.
The generator looks for .js, .jsx, .ts, .tsx, .mjs files in these directories:
- โ
src/,lib/,components/,pages/,utils/,hooks/,services/ - โ
client/,server/,packages/,apps/,modules/(not included by default)
Excluded by default: node_modules/, dist/, build/, .git/, coverage/, test/, __tests__/
Use --include to specify your project's actual directory structure:
node uml-generator.js /path/to/project \
--output output.json \
--include "client,server,shared,servers,packages"# Structure:
# Abzena/
# โโโ client/src/ (React frontend - 170 files)
# โโโ server/ (Express backend - 6 files)
# โโโ shared/ (Utilities - 4 files)
# โโโ servers/ (MCP servers - 7 files)
# โโโ packages/ (npm packages - 1 file)
node uml-generator.js /Users/d.edens/lab/Faros/Abzena \
--output public/data/Abzena-uml.json \
--include "client,server,shared,servers,packages"Result: โ 187 TypeScript files analyzed instead of 0!
# Structure: apps/, libs/, packages/
node uml-generator.js . \
--include "apps,libs,packages"# Structure: packages/package-a, packages/package-b
node uml-generator.js . \
--include "packages"# Most Python projects won't work - this generator only supports JS/TS
# But if you have TypeScript tooling:
node uml-generator.js . \
--include "src,scripts,tools"# Empty include = scan all files (except excludes)
node uml-generator.js . \
--include "" \
--output everything.jsonOverride default excludes:
node uml-generator.js . \
--include "src,lib" \
--exclude "node_modules,dist,build,.git,coverage,test,__tests__,tmp,cache"Add to your package.json for easy reuse:
{
"scripts": {
"visualize": "node path/to/uml-generator.js . --output uml-data.json",
"visualize:custom": "node path/to/uml-generator.js . --output uml-data.json --include \"client,server,shared\""
}
}Then run: npm run visualize:custom
Still getting 0 files?
- Check your directory names match the
--includepatterns - Ensure you're using supported file extensions (
.js,.jsx,.ts,.tsx,.mjs) - Verify files aren't in excluded directories (
node_modules/,dist/, etc.) - Try
--include ""to see what files would be detected without restrictions
Getting too many files?
- Use more specific include patterns:
--include "src/components,src/services" - Add more exclude patterns:
--exclude "node_modules,test,*.spec.ts"
Smart Project Discovery:
- Scans
~/lab,~/projects,~/devfor projects - Filters for directories with
package.json - Shows suggested projects in menu
Live Analysis Progress:
- ๐ Scanning project files...
- ๐ Analyzing code structure... (23/150 files)
- ๐ Reading project metadata...
- โ Analysis complete!
Results Dashboard:
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Metric โ Value โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Project Name โ my-awesome-project โ
โ Components โ 158 โ
โ Packages โ 19 โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฅ Most Complex Components:
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโ
โ Component โ Complexity โ Lines โ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโค
โ Dashboard โ 45 โ 523 โ
โ ProjectManager โ 38 โ 412 โ
โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโ
๐๏ธ City Preview (Building Heights):
โโโโ โโโ โโ โโโโโ โโ โ โโโ โโโโ ...
(Taller = More Lines, Red = Complex, Green = Simple)
Use TUI when:
- Working in terminal environment
- Analyzing private/local projects
- Batch processing multiple repos
- CI/CD automation (CLI mode)
- No browser available
Use Web UI (SwarmDesk) when:
- Want full 3D visualization
- Need to explore dependencies interactively
- Presenting to others
- Want to navigate the code city
- TUI Mode: Requires TTY (terminal), won't work in pipes
- CLI Mode: Works anywhere, perfect for scripts
- Auto-detects and falls back gracefully
- GitHub cloning: Automatically clones, analyzes, and cleans up temp repos
- Git metrics: Tracks commit history and file age
- Dependency analysis: Maps import relationships
- React-aware: Special handling for components
- Multi-project: Analyze multiple projects in one session (TUI)
This TUI edition brings the power of SwarmDesk code visualization to your terminal. Experience the thrill of watching your codebase transform into data, then load it in SwarmDesk for the full 3D city experience!
See EXAMPLES.md for more usage examples.