deps - Dependency Graph
Overview
The deps command generates visual dependency graphs for your .NET solutions and projects. You can output in multiple formats: Mermaid markdown, interactive HTML, or SVG images. This helps you understand project relationships and identify circular dependencies.
Syntax
nmbl deps <ProjectOrSolution> [options]Arguments
ProjectOrSolution- Path to a .csproj or .slnx file
Options
--output <path>- Output file path (format determined by extension: .md, .html, .svg)--include-nuget- Show NuGet packages without versions--include-nuget-versions- Show NuGet packages with version numbers
Output Formats
The output format is automatically determined by the file extension:
.md- Mermaid markdown (can be rendered in GitHub, Azure DevOps, etc.).html- Interactive HTML with pan/zoom.svg- Scalable vector graphics image
Examples
Generate Mermaid Markdown
nmbl deps MySolution.slnx --output deps.mdCreates a Mermaid diagram that can be viewed in GitHub README files or documentation.
Generate Interactive HTML
nmbl deps MyProject.csproj --output deps.htmlCreates an HTML file with an interactive, zoomable dependency graph.
Generate SVG Image
nmbl deps MySolution.slnx --output deps.svgCreates a high-quality SVG image suitable for documentation or presentations.
Include NuGet Packages
nmbl deps MyProject.csproj --include-nuget --output deps.mdShows both project dependencies and NuGet package dependencies.
Include NuGet Package Versions
nmbl deps MySolution.slnx --include-nuget-versions --output deps.htmlShows NuGet packages with their version numbers for detailed dependency analysis.
Generate Multiple Formats
# Generate all formats for the same solution
nmbl deps MySolution.slnx --output deps.md
nmbl deps MySolution.slnx --output deps.html
nmbl deps MySolution.slnx --output deps.svgCreates multiple formats for different use cases.
Use Cases
Documentation
nmbl deps MySolution.slnx --output docs/architecture/dependencies.mdGenerate dependency diagrams for your architecture documentation.
Code Reviews
nmbl deps MySolution.slnx --include-nuget --output review.htmlCreate interactive graphs to help reviewers understand changes.
Identifying Circular Dependencies
The graph visualization makes it easy to spot circular dependencies (cycles in the graph) that should be refactored.
Architecture Validation
# Generate before making changes
nmbl deps MySolution.slnx --output before.svg
# Make architectural changes
# Generate after changes
nmbl deps MySolution.slnx --output after.svg
# Compare the two diagramsRelated Commands
projectreferences- List project referencesloc- Count lines of code