UD Copilot

Generate comprehensive UML diagrams from your project code using Mermaid and export them to PDF with a single click!
Features
🎨 7 Diagram Types: Generate Use Case, Sequence, ERD, Class, Component, Deployment, and State Machine diagrams
📊 Multi-Language Support: Analyzes TypeScript, JavaScript, Python, Java, and C# projects
🖼️ Visual Preview: View diagrams directly in VS Code with beautiful rendering
📄 PDF Export: Export all diagrams to a single, professionally formatted PDF document
⚡ Fast & Easy: Generate all diagrams with one command
Supported Diagram Types
1. Use Case Diagram
Visualizes actors and their interactions with the system based on public methods and classes.
2. Sequence Diagram
Shows the flow of messages between objects and method calls in your application.
3. Entity Relationship Diagram (ERD)
Displays database entities, attributes, and relationships extracted from data models.
4. Class Diagram
Illustrates class structures, properties, methods, inheritance, and interfaces.
5. Component Diagram
Represents system architecture with modules, services, and their dependencies.
6. Deployment Diagram
Shows the deployment architecture including servers, databases, and external services.
7. State Machine Diagram
Visualizes state transitions and workflows in your application.
Usage
Generate All Diagrams
- Open your project in VS Code
- Press
Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
- Type "UD Copilot: Generate All UML Diagrams"
- Wait for the analysis to complete
- View diagrams in the preview panel
- Optionally export to PDF
Generate Individual Diagrams
Use the Command Palette (Ctrl+Shift+P) and search for:
UD Copilot: Generate Use Case Diagram
UD Copilot: Generate Sequence Diagram
UD Copilot: Generate Entity Relationship Diagram
UD Copilot: Generate Class Diagram
UD Copilot: Generate Component Diagram
UD Copilot: Generate Deployment Diagram
UD Copilot: Generate State Machine Diagram
Export to PDF
- Generate diagrams first (or use "Generate All Diagrams")
- Press
Ctrl+Shift+P and select "UD Copilot: Export All Diagrams to PDF"
- Find the PDF in your project's
uml-diagrams folder
Configuration
Configure the extension in VS Code settings:
{
"antigravity-uml.outputDirectory": "uml-diagrams",
"antigravity-uml.diagramTheme": "default",
"antigravity-uml.maxDepth": 5
}
Settings
- outputDirectory: Directory where diagrams will be saved (default:
uml-diagrams)
- diagramTheme: Mermaid theme (
default, dark, forest, neutral)
- maxDepth: Maximum depth for analyzing nested structures (default:
5)
Requirements
- VS Code 1.85.0 or higher
- Node.js (for rendering diagrams)
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Search for "UD Copilot"
- Click Install
From VSIX File
- Download the
.vsix file
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Click the
... menu and select "Install from VSIX..."
- Select the downloaded file
How It Works
- Project Analysis: The extension scans your project files and extracts classes, methods, properties, and relationships
- Diagram Generation: Based on the extracted data, it generates Mermaid syntax for each diagram type
- Rendering: Diagrams are rendered using Mermaid and displayed in a preview panel
- Export: All diagrams can be exported to a single PDF with a table of contents
Examples
Class Diagram
classDiagram
class User {
+String name
+String email
+login() void
+logout() void
}
class Admin {
+manageUsers() void
}
User <|-- Admin
Sequence Diagram
sequenceDiagram
User->>+Controller: Request
Controller->>+Service: Process
Service->>+Database: Query
Database-->>-Service: Data
Service-->>-Controller: Result
Controller-->>-User: Response
Supported Languages
- TypeScript (
.ts, .tsx)
- JavaScript (
.js, .jsx)
- Python (
.py)
- Java (
.java)
- C# (
.cs)
Known Limitations
- Complex generic types may not be fully represented
- Private nested classes might not be detected in all languages
- Diagram complexity increases with project size
Troubleshooting
Diagrams not generating?
- Ensure your project has source files in supported languages
- Check that the workspace folder is open
- Verify file permissions in the output directory
PDF export failing?
- Make sure diagrams have been generated first
- Check available disk space
- Ensure write permissions in the output directory
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
License
This extension is licensed under the MIT License.
Support
Release Notes
See CHANGELOG.md for detailed release notes.
Enjoy generating beautiful UML diagrams! 🚀