Skip to content



With path command it is possible to generate and search through the XPATH style paths extracted from a YANG file.

By extracting the XPATH styled paths from a YANG model it is made possible to utilize CLI search tools like awk, sed and alike to find the paths satisfying specific matching rules.

The embedded search capability allows to perform a quick and simple search through the model's paths using simple inclusion/exclusion operators.



When --types flag is present the extracted paths will also have a corresponding type printed out.


The --path-type flag governs which style is used to display the path information. The default value is xpath which will produce the XPATH compatible paths.

The other option is gnmi which will result in the paths to be formatted using the gNMI Path Conventions.

elem:{name:"state"}  elem:{name:"sfm"  key:{key:"sfm-slot"  value:"*"}}  elem:{name:"hardware-data"}  elem:{name:"firmware-revision-status"}

With the --search flag present an interactive CLI search dialog is displayed that allows to navigate through the paths list and perform a search.

❯ gnmic path --file _test/nokia-state-combined.yang --search
Use the arrow keys to navigate: ↓ ↑ → ←  and : toggles search
? select path: 
  ▸ /state/aaa/radius/statistics/coa/dropped/invalid
↓   /state/aaa/radius/statistics/disconnect-messages/dropped/invalid


When the --descr flag is present, the leaf description is printed after the path, indented with a \t.


When the --config-only flag is present, paths are generated only for YANG leaves representing config data.


When the --state-only flag is present, paths are generated only for YANG leaves representing state data.


When the --with-non-leaves flag is present, paths are generated not only for YANG leaves.


# output to stdout the XPATH styled paths
# from the nokia-state module of nokia-state-combined.yang file
gnmic path --file nokia-state-combined.yang

# from the nokia-conf module
gnmic path -m nokia-conf --file nokia-conf-combined.yang

# with the gNMI styled paths
gnmic path --file nokia-state-combined.yang --path-type gnmi

# with path types
gnmic path --file nokia-state-combined.yang --types

# entering the interactive navigation prompt
gnmic path --file nokia-state-combined.yang --search

  1. Nokia combined models can be found in nokia/7x50_YangModels repo.