Skip to main content

vulkro-sf role-hierarchy

Prints the role hierarchy from your role metadata as a tree, and marks roles that sit too deep.

vulkro-sf role-hierarchy .
vulkro-sf role-hierarchy . --format mermaid > roles.mmd

It builds the tree from roles/*.role-meta.xml (<parentRole> links). Every role deeper than the role-depth threshold is marked BLOAT: exactly the roles the sf-access-role-depth check flags. Output is sorted, so two runs over the same source are byte-identical, which suits a diff or a committed file.

It is informational and reports no findings. Managed-package roles and role assignments that exist only in the live org are not in static metadata, so they do not appear. No org connection is needed.

FlagWhat it does
[PATH]SFDX project or retrieved metadata. Default ..
--format <tree|json|mermaid>tree (indented text), json (nodes and edges) or mermaid (flowchart TD). Default tree.

Exit codes​

CodeMeaning
0Rendered (also when the project has no roles).
2Error (unscannable path, unknown --format).