Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Build Status

Dart Class Diagram Generator

A small command line utility to generate a class (UML or similar) diagram from a Dart package.


Below is a UML diagram of the dcdg source code, created with dcdg. You can find the PlantUML source in the example/ directory.

Example UML Diagram


Install from pub:

pub global activate dcdg

Install from clone:

pub global activate -s path .


From inside a Dart package directory:

pub global run dcdg

This will dump a PlantUML file to stdout. You can save it to a file instead with the -o option.

See --help for more options, including ways to filter what ends up in the output. You can find the help contents in USAGE.txt as well.


There are test fixtures in test/fixtures/. Each Dart package in this directory contains various (fake) classes. Try running DCDG against these fixtures to familiarize yourself with how it works.


Pull requests are welcome! It is intended to be reasonably straightforward to add a new output format. Take a look at the DOT format implementation in lib/src/builders for an example.

If you have found a bug or have a feature request please open an issue.


Format code using the tool/ script. It will have a non-zero exit code if the formatting changed. That's fine, it does that so it can be used in CI.

Run the full test suite (including unit and functional tests) with tool/

If you change the user interface or add features you should run tool/ to regenerate documentation and other resources. This script requires PlantUML.