ros2inspector doctor
Run read-only diagnostics on the installation and the workspace. Use it first when results look wrong, or as a quick health check in CI.
Usage
ros2inspector doctor [PATH | -C PATH] [--json]
PATH defaults to the current directory.
Options
| Option | Default | Description |
|---|---|---|
-C, --path | . | Workspace root (same as PATH) |
--json | false | Emit machine-readable JSON |
Checks
The report starts with the ros2inspector and Python versions, the platform and the cache location, then runs these checks:
| Check | Fails or warns when |
|---|---|
workspace_exists | The path does not exist |
workspace_root | No src/ or install/setup.bash is found above the path, so the path itself is used (a warning) |
packages | No package.xml is found |
unparsable_package_xml | A manifest cannot be parsed |
duplicate_package_names | Two manifests declare the same package name |
ros_distro | ROS_DISTRO is not set (a warning: static analysis does not need ROS 2) |
offline_visualization_asset | The bundled Cytoscape.js asset for viz is missing |
module_* | A required module, such as jinja2 or tree_sitter_cpp, cannot be imported |
cache_writable | The analysis cache directory cannot be written |
Each check reports ok, warn or fail, with a hint when there is something to do. Nothing is modified.
Exit codes
| Code | Meaning |
|---|---|
0 | Every check passed; warnings are informational |
1 | At least one check failed |
Examples
ros2inspector doctor
ros2inspector doctor ~/robot_ws --json | jq '.checks[] | select(.status != "ok")'