Skip to content

Commit 720e6b6

Browse files
committed
tools: dtsh: add dtsh to Zephyr extension commands overview
Add a brief entry to zephyr-cmds.rst to improve discoverability, especially since west --help won't show the dtsh command. Part of RFC zephyrproject-rtos#59863. Signed-off-by: Christophe Dufaza <[email protected]>
1 parent 935c4cd commit 720e6b6

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

doc/develop/west/zephyr-cmds.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,3 +428,55 @@ each individual commit associated with the given pull request.
428428
│ ├── second-commit-from-pr.patch
429429
│ └── third-commit-from-pr.patch
430430
└── patches.yml
431+
432+
The Devicetree Shell: ``west dtsh``
433+
***********************************
434+
435+
DTSh is an interactive DTS files *viewer* with a shell-like command line interface: the devicetree is presented as a hierarchical file system, navigated and queried with familiar commands like ``cd``, ``ls``, ``tree`` or ``find``.
436+
The shell has a rich user interface (contextual auto-completion, commands history, semantic highlighting, pager integration, user profiles), and can also execute commands or scripts non-interactively.
437+
Commands output redirection permits to export custom views of the devicetree to text, HTML, or SVG files.
438+
439+
Please refer to the `DTSh manual`_ for detailed documentation.
440+
441+
``dtsh`` is provided by an optional Zephyr module project,
442+
which interested users must install it explicitly:
443+
444+
.. code-block:: bash
445+
446+
# Enable and download optional West project.
447+
west config manifest.project-filter -- +dtsh
448+
west update
449+
450+
# Install module requirements.
451+
west packages -m dtsh pip --install
452+
453+
454+
Without argument, ``west dtsh`` will try to open the devicetree at :file:`build/zephy/zephyr.dts`:
455+
456+
.. code-block:: none
457+
458+
$ west build
459+
$ west dtsh
460+
dtsh (0.2.3): Shell-like interface with Devicetree
461+
How to exit: q, or quit, or exit, or press Ctrl-D
462+
463+
> ls -l
464+
Name Labels Binding
465+
───────────────────────────────────────────────────────
466+
chosen
467+
aliases
468+
soc
469+
pin-controller pinctrl nordic,nrf-pinctrl
470+
entropy_bt_hci rng_hci zephyr,bt-hci-entropy
471+
sw-pwm sw_pwm nordic,nrf-sw-pwm
472+
cpus
473+
leds gpio-leds
474+
pwmleds pwm-leds
475+
buttons gpio-keys
476+
connector arduino_header arduino-header-r3
477+
analog-connector arduino_adc arduino,uno-adc
478+
479+
Run ``west dtsh -h`` for the full West command synopsis.
480+
481+
.. _DTSh manual:
482+
https://dottspina.github.io/dtsh/handbook.html

0 commit comments

Comments
 (0)