Skip to main content
██████╗  ██████╗ ███████╗████████╗██████╗ ███████╗███████╗
██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔══██╗██╔════╝██╔════╝
██████╔╝██║   ██║███████╗   ██║   ██████╔╝█████╗  █████╗
██╔══██╗██║   ██║╚════██║   ██║   ██╔══██╗██╔══╝  ██╔══╝
██║  ██║╚██████╔╝███████║   ██║   ██║  ██║███████╗███████╗
╚═╝  ╚═╝ ╚═════╝ ╚══════╝   ╚═╝   ╚═╝  ╚═╝╚══════╝╚══════╝

CI codecov PyPI version PyPI downloads Python versions License

Explore ROS 2 package dependencies from the command line (CLI, TUI, library).

rostree demo

Full demo reel · how the demo was made

Docs: docs/README.md — overview, package discovery, dependency trees, usage, development.

Quick start

pip install rostree
source /opt/ros/<distro>/setup.bash   # and/or your workspace install/setup.bash
rostree                               # interactive TUI

Why it is fast

A ROS dependency graph is a DAG, not a tree: rcutils sits under almost every branch. Expanding each path separately is exponential — a 159-package workspace printed 68,081 lines at depth 7, and never finished without a depth limit.

rostree expands each package once, where it first appears, and references it elsewhere (↩ see above), the way cargo tree does with (*). Package discovery happens once per run instead of once per node, and manifests are parsed once.

rostree tree nav2_bringup -r 0.2.2 0.3.0
depth 6 18,273 lines / 4.4 s 548 lines / 0.02 s
depth 7 68,081 lines / 17.4 s 552 lines / 0.02 s
no depth limit (the default) did not finish in 4 min 552 lines / 0.02 s

Nothing is hidden: every edge is still shown, once. --full restores the fully expanded tree if you want it.

CLI commands

rostree                      # Launch interactive TUI
rostree scan                 # Scan host for ROS 2 workspaces
rostree list --by-source     # List packages grouped by source
rostree list -f nav2         # Filter the package list

rostree tree rclcpp          # Dependency tree
rostree tree rclcpp -r -d 3  # Runtime deps only, 3 levels
rostree tree rclcpp --json   # Machine-readable

rostree why nav2_bringup rcutils   # How did this get into my tree?
rostree rdeps rclcpp               # What depends on this package?
rostree check                      # Cycles + unresolved deps (non-zero exit for CI)

rostree graph rclcpp --render png       # PNG via Graphviz
rostree graph rclcpp --render svg --open
rostree graph -w ~/ros2_ws --render png # Whole workspace
rostree graph rclcpp -f mermaid         # Mermaid text

TUI

rostree tui                  # Interactive terminal UI
rostree tui rclcpp           # Start on a package's tree

/ filters every package as you type, Enter opens a tree, v flips to "what depends on this", t switches between runtime and all dependencies, and ? shows the full keymap. Scanning and tree building run off the UI thread, and rows are created as you expand them, so nothing blocks.

rostree TUI showing a dependency tree

Python API

from rostree import list_known_packages, get_package_info, build_tree, scan_workspaces
from rostree.api import build_graph, reverse_dependencies, tree_stats

packages = list_known_packages()
root = build_tree("rclcpp", runtime_only=True)
print(tree_stats(root))                  # nodes, packages, depth, repeats, missing

graph = build_graph("nav2_bringup")      # the resolved DAG, linear to build
print(graph.cycles(), sorted(graph.missing))

print(reverse_dependencies("rclcpp"))    # who depends on it

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rostree-0.3.0.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rostree-0.3.0-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

Details for the file rostree-0.3.0.tar.gz.

File metadata

  • Download URL: rostree-0.3.0.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rostree-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1de4f7cf2241646136f12571de3f9076f06dd4d1f4d0143db4a6550eae7831db
MD5 90931647dcedec6367f51182bd694707
BLAKE2b-256 74e867d7c411b2adc359bfbe43f781fc3756bae394d37b8f6f23030bbc68a046

See more details on using hashes here.

Provenance

The following attestation bundles were made for rostree-0.3.0.tar.gz:

Publisher: publish.yml on guilyx/rostree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rostree-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: rostree-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rostree-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fa3a0583d612cd2a1d84a1e7a84eb4cbd21ba9b2d708e4cf8b6c70c31e2ac96
MD5 403857f3802470b0a39d54bf5adaa15b
BLAKE2b-256 d269325a105e6eebd083246df4325079edf45abdcb5772c90c0b101215001aac

See more details on using hashes here.

Provenance

The following attestation bundles were made for rostree-0.3.0-py3-none-any.whl:

Publisher: publish.yml on guilyx/rostree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page