cargo-modules 0,0

A cargo plugin for showing a tree-like overview of a crate's modules.


Build Status Downloads Version License


A cargo plugin for showing a tree-like overview of a crate’s modules.


With time, as your Rust projects grow bigger and bigger, it gets more and more important to properly structure your code. Fortunately Rust provides us with a quite sophisticated module system, allowing us to neatly split up our crates into arbitrarily small sub-modules of types and functions. While this helps to avoid monolithic and unstructured chunks of code, it can also make it hard at times to still mentally stay on top of the over-all high-level structure of the project at hand.

This is where cargo-modules comes into play:



Install cargo-modules via:

cargo install cargo-modules


cargo modules

Orphaned Modules

If you want to also list of potentially orphaned modules, then add a --orphans argument:

cargo modules --orphans

Any file src/../ or src/../foo/ that is not linked by its super-module via mod foo; is considered a (potential) orphaned module.

To keep false positives to a minimum cargo-modules excludes all build scripts as well as and from the selection of potential orphans.

Plain Mode

If you, for some reason, need to remove the coloring, use:

cargo modules --plain


If you need any further help:

cargo modules --help


Please read for details on our code of conduct,
and the process for submitting pull requests to us.


We use SemVer for versioning. For the versions available, see the tags on this repository.


See also the list of contributors who participated in this project.


This project is licensed under the MPL-2.0 – see the file for details.

Related Repositories



A cargo plugin for showing a tree-like overview of a crate's modules. ...



A cargo sub command for generating modules. ...

Top Contributors

regexident dtolnay andrey-gvrd llogiq