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.4.0.tar.gz (45.6 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.4.0-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rostree-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5a12f1bf45e4505b02fdfc1b22bc8a6d6ff0ffcb3dcdb49621a9953b09104231
MD5 654ca2e0a30f75a621e7e5b2ad05b2c1
BLAKE2b-256 3d26136ea81f4d2244a1ab213df6b6efc6ec92a06f1c6f658e5ad6a5d472caf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rostree-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: rostree-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 52.0 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ae729dcb5a71e8ae243467a3344ad86a056e3d4396f69ce0d8fd88d4e201d29
MD5 eae8d292f5e7a0bea75d07e9891e1f39
BLAKE2b-256 7b2a15756da1ba1a8ac66bc157cb1545674c8450aca2cbbb2f6e6922f6397acf

See more details on using hashes here.

Provenance

The following attestation bundles were made for rostree-0.4.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