Skip to content

Craftpipe/diagram-draft

DiagramDraft

A CLI tool that auto-generates Mermaid diagrams from your codebase. Scan your project, extract dependencies, and get architecture visualizations instantly—no API calls required.

What It Does

  • Scans your codebase and extracts import/export relationships
  • Generates Mermaid diagrams for architecture, data flow, and module dependencies
  • Outputs to stdout or markdown files (free version)
  • Creates interactive HTML reports with rendered diagrams (premium)
  • Exports dependency graphs as JSON/CSV (premium)
  • Team-friendly config files for consistent diagram generation (premium)

Installation

npm install -g diagramdraft

Or use directly:

npx diagramdraft

Quick Start

Generate a flowchart diagram

diagramdraft --path ./src --type flowchart

Output to a markdown file

diagramdraft --path ./src --output diagram.md

Generate multiple diagram types

diagramdraft --path ./src --type flowchart,sequence,component

Create an interactive HTML report (premium)

diagramdraft --path ./src --report

Usage Examples

Analyze a specific directory:

diagramdraft --path ./services --type component

Generate and save to file:

diagramdraft --path ./src --output architecture.md --type flowchart

Use a config file (premium):

diagramdraft --config diagramdraft.config.json

Export dependency graph (premium):

diagramdraft --path ./src --export json --output deps.json

Configuration (Premium)

Create a diagramdraft.config.json file:

{
  "paths": ["./src", "./lib"],
  "types": ["flowchart", "component"],
  "output": "./diagrams",
  "exclude": ["node_modules", "test"],
  "reportFormat": "html"
}

Features

Feature Free Premium
Codebase scanning
Mermaid diagram generation
Stdout/markdown output
Interactive HTML reports
JSON/CSV export
Config files
Team collaboration

FAQ

Q: Does DiagramDraft require API keys?
A: No. Everything runs locally on your machine.

Q: What file types are supported?
A: JavaScript, TypeScript, Python, Java, and Go.

Q: Can I customize the diagram output?
A: Yes. Use config files (premium) or pass CLI flags to customize paths, types, and output formats.

Q: How do I integrate diagrams into my docs?
A: Copy the Mermaid code from stdout or markdown files directly into your documentation.

Q: Is there a way to exclude certain directories?
A: Yes. Use the --exclude flag or add exclusions to your config file (premium).

Q: Can teams share diagram configurations?
A: Yes, with premium. Commit your diagramdraft.config.json to version control.


Built with AI by Craftpipe
Support: support@heijnesdigital.com

⭐ Pro Features

Upgrade to Pro for:

  • html report
  • json csv export
  • config file

Get Procraftpipe.gumroad.com (€39)

Set PRO_LICENSE=<your-key> environment variable to unlock.

About

A CLI workflow tool that scans your codebase and auto-generates Mermaid diagrams for architecture, data flow, and module dependencies. It walks your project files, extracts import/export relationships, identifies key modules, and produces ready-to-paste Mermaid diagram code for flowcharts, sequence diagrams, and component maps — all without any AI

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors