dendron-viz

Crates.iodendron-viz
lib.rsdendron-viz
version0.1.1
created_at2026-01-24 17:49:06.49731+00
updated_at2026-01-25 09:38:56.505896+00
descriptionA powerful dependency graph visualizer and analyzer for Rust projects
homepagehttps://github.com/Rogue-strider/DENDRON
repositoryhttps://github.com/Rogue-strider/DENDRON
max_upload_size
id2067079
size70,332
Satyam Jha (Rogue-strider)

documentation

https://github.com/Rogue-strider/DENDRON#readme

README

DENDRON 🌳

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•β•β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•β•

A powerful, blazing-fast dependency graph visualizer and analyzer for Rust projects

Rust License: MIT Build Status

Features β€’ Installation β€’ Usage β€’ Examples β€’ Contributing


✨ Features

Core Features

  • 🌳 Beautiful Tree Visualization - Color-coded dependency trees with Unicode box drawing
  • πŸ” Nested Dependencies - Analyze transitive dependencies using cargo metadata
  • πŸ“Š Multiple View Modes
    • Full dependency tree
    • Direct dependencies only
    • Depth-limited view
    • Compact summary view
  • πŸ“€ Export Formats
    • JSON (pretty & compact)
    • DOT (GraphViz compatible)
  • 🎨 Colorful Output - Syntax highlighting with depth-based coloring
  • ⚑ Fast & Lightweight - Written in pure Rust for maximum performance

Analysis Features

  • πŸ”„ Circular Dependency Detection - Identify dependency cycles that could cause issues
  • πŸ” Duplicate Version Detection - Find packages with multiple versions to reduce bloat
  • πŸ“ˆ Comprehensive Statistics - Detailed metrics about your dependency graph

Developer Features

  • πŸ› οΈ CLI Friendly - Extensive command-line options for automation
  • 🚫 CI/CD Ready - Disable colors for pipeline integration
  • πŸ“ Multi-Project Support - Analyze any Rust project by path

Planned Features

  • πŸ”’ Security vulnerability scanning (RustSec integration)
  • πŸ“œ License compatibility checker
  • πŸ“¦ Update checker for outdated dependencies
  • πŸ“Š Dependency size analysis
  • 🌐 Multi-language support (npm, pip, Maven)

πŸš€ Installation

From Source (Current)

git clone https://github.com/Rogue-strider/DENDRON
cd DENDRON
cargo install --path .

From crates.io (Coming Soon)

cargo install dendron-viz

Prerequisites

  • Rust 1.70 or higher
  • Cargo

πŸ“– Usage

Basic Usage

# Analyze current project
dendron

# Analyze specific project
dendron --path /path/to/project

# Show nested dependencies
dendron --nested

# Limit depth
dendron --nested --depth 2

View Modes

# Direct dependencies only
dendron --direct-only

# Compact summary
dendron --summary --nested

# Full tree with depth limit
dendron --nested --depth 3

Analysis Commands

# Check for duplicate versions
dendron --nested --check-duplicates

# Check for circular dependencies
dendron --nested --check-circular

# Combined analysis (recommended for CI/CD)
dendron --nested --check-duplicates
dendron --nested --check-circular

Export Options

# Export to JSON (pretty)
dendron --nested --output json > dependencies.json

# Export to JSON (compact)
dendron --output json-compact > deps.json

# Export to DOT format (GraphViz)
dendron --nested --output dot > deps.dot

# Visualize with GraphViz
dendron --output dot > deps.dot && dot -Tpng deps.dot -o graph.png

Advanced Options

# Disable colors (for CI/CD)
dendron --no-color

# Combine options
dendron --nested --depth 3 --summary --no-color

πŸ“‹ Examples

Example Output (Tree View)

🌳 Dependency Tree (Max Depth: 2)

πŸ“¦ dendron (0.1.0)
β”œβ”€β”€ anyhow (1.0.100)
β”œβ”€β”€ cargo_metadata (0.18.1)
β”‚   β”œβ”€β”€ camino (1.2.2)
β”‚   β”œβ”€β”€ cargo-platform (0.1.9)
β”‚   β”œβ”€β”€ semver (1.0.27)
β”‚   └── serde (1.0.228)
β”œβ”€β”€ clap (4.5.54)
β”‚   β”œβ”€β”€ clap_builder (4.5.54)
β”‚   └── clap_derive (4.5.49)
β”œβ”€β”€ colored (2.2.0)
β”œβ”€β”€ serde (1.0.228)
└── toml (0.8.23)

πŸ“Š Statistics:
  β”œβ”€ Direct Dependencies: 6
  β”œβ”€ Total Dependencies: 46
  └─ Max Depth: 6

✨ Analysis complete!

Example Output (Summary View)

πŸ“‹ Dependency Summary:

πŸ“¦ dendron (0.1.0)

└─ Level 1: 6 packages (showing first 10)
   β”œβ”€ toml (0.8.23)
   β”œβ”€ serde (1.0.228)
   β”œβ”€ anyhow (1.0.100)
   β”œβ”€ clap (4.5.54)
   β”œβ”€ colored (2.2.0)
   └─ cargo_metadata (0.18.1)

└─ Level 2: 11 packages (showing first 10)
   β”œβ”€ semver (1.0.27)
   β”œβ”€ camino (1.2.2)
   β”œβ”€ cargo-platform (0.1.9)
   └─ 8 more packages...

Example Output (Duplicate Detection)

⚠️ Found 3 packages with multiple versions:

πŸ“¦ proc-macro2
  β”œβ”€ v1.0.92 (used 4 times)
  └─ v1.0.70 (used 2 times)

πŸ“¦ syn
  β”œβ”€ v2.0.90 (used 5 times)
  └─ v1.0.109 (used 3 times)

πŸ“¦ unicode-ident
  β”œβ”€ v1.0.22 (used 3 times)
  └─ v1.0.14 (used 1 time)

πŸ’‘ Impact:
   β€’ 3 duplicate versions increase binary size
   β€’ Consider updating dependencies to use consistent versions
   β€’ Run cargo update to update

πŸ“Š Duplicate Statistics:
  β”œβ”€ Packages with duplicates: 3
  β”œβ”€ Total versions: 6
  └─ Duplicate versions: 3

Example Output (Circular Dependency Detection)

⚠️ Found 2 circular dependencies:

Cycle 1:
  β”Œβ”€β†’ package-a
  β”œβ”€β†’ package-b
  β”œβ”€β†’ package-c
  └─→ package-a (completes cycle)

Cycle 2:
  β”Œβ”€β†’ package-x
  β”œβ”€β†’ package-y
  └─→ package-x (completes cycle)

πŸ’‘ Impact:
   β€’ Circular dependencies can cause compilation issues
   β€’ They may increase build time and binary size
   β€’ Consider refactoring to break the cycles

πŸ“Š Circular Dependency Statistics:
  β”œβ”€ Total cycles: 2
  β”œβ”€ Packages involved: 5
  └─ Longest cycle: 3 packages

Example JSON Export

{
  "package": {
    "name": "dendron-viz",
    "version": "0.1.1"
  },
  "dependencies": {
    "toml": {
      "version": "0.8.23",
      "depth": 1,
      "dependencies": ["serde", "indexmap", "toml_datetime"]
    },
    "serde": {
      "version": "1.0.228",
      "depth": 1,
      "dependencies": ["serde_derive"]
    }
  },
  "statistics": {
    "direct_dependencies": 6,
    "total_dependencies": 46,
    "max_depth": 6
  }
}

🎯 Command Reference

dendron [OPTIONS]

Options:
  -p, --path <PATH>           Path to project directory (default: current)
  -d, --depth <NUMBER>        Maximum depth to display
  -D, --direct-only           Show only direct dependencies
  -n, --nested                Show nested/transitive dependencies
  -s, --summary               Show compact summary view
  -o, --output <FORMAT>       Output format: json, json-compact, dot
      --check-duplicates      Check for duplicate dependency versions
      --check-circular        Check for circular dependencies
      --no-color              Disable colored output
  -h, --help                  Print help
  -V, --version               Print version

πŸ’‘ Use Cases

For Developers

  • Understand Dependencies: Visualize your project's dependency tree
  • Optimize Build Size: Find and eliminate duplicate versions
  • Detect Issues: Identify circular dependencies before they cause problems
  • Documentation: Export dependency graphs for documentation

For CI/CD Pipelines

# In your CI/CD pipeline
dendron --nested --check-duplicates --no-color
dendron --nested --check-circular --no-color

# Export for artifacts
dendron --nested --output json > artifacts/dependencies.json

For Team Collaboration

# Generate visual graph
dendron --output dot > deps.dot
dot -Tpng deps.dot -o dependency-graph.png

# Share with team for review

πŸ› οΈ Development

Building from Source

# Clone the repository
git clone https://github.com/Rogue-strider/DENDRON
cd DENDRON

# Build the project
cargo build --release

# Run tests
cargo test

# Run locally
cargo run -- --nested --depth 2

Project Structure

dendron/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs           # CLI entry point
β”‚   β”œβ”€β”€ parser/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ cargo.rs      # Cargo.toml parser
β”‚   β”‚   └── metadata.rs   # cargo metadata parser
β”‚   β”œβ”€β”€ graph/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ node.rs       # Dependency node structure
β”‚   β”‚   β”œβ”€β”€ builder.rs    # Graph building logic
β”‚   β”‚   └── export.rs     # Export formats (JSON, DOT)
β”‚   └── analyzer/
β”‚       β”œβ”€β”€ mod.rs
β”‚       β”œβ”€β”€ duplicates.rs # Duplicate version detection
β”‚       └── circular.rs   # Circular dependency detection
β”œβ”€β”€ Cargo.toml
└── README.md

Tech Stack

  • Language: Rust 2021 Edition
  • CLI Framework: clap 4.x
  • Serialization: serde, serde_json
  • Parsing: toml, cargo_metadata
  • Colors: colored

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Areas for Contribution

  • πŸ”’ Security vulnerability scanning (RustSec integration)
  • πŸ“œ License compatibility checker
  • πŸ“¦ Update checker for outdated dependencies
  • πŸ“Š Dependency size analysis
  • 🌐 Multi-language support (npm, pip, etc.)
  • πŸ“š Documentation improvements
  • πŸ› Bug fixes
  • ✨ New features

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details. License: MIT


πŸ™ Acknowledgments

  • Inspired by tools like cargo tree, npm ls, and various dependency visualization tools
  • Built with amazing Rust crates from the community
  • Special thanks to all contributors (ofCourse its only meπŸ₯²) but hoping for others to contribute

πŸ“ž Contact

Author: Rogue-strider
Repository: github.com/Rogue-strider/DENDRON
Email: satyamjha91064@gmail.com


Made with ❀️ and πŸ¦€ Rust

⭐ Star this repo if you find it useful!

Commit count: 33

cargo fmt