Lines Matching +full:board +full:- +full:schema
1 .. _west-extensions:
8 for short. Extensions show up in the ``west --help`` output in a special
14 :ref:`build, flash, and debug <west-build-flash-debug>` and the
15 :ref:`ones described here <west-zephyr-ext-cmds>` , are extensions. That's why
16 help for them shows up like this in ``west --help``:
18 .. code-block:: none
24 sign: sign a Zephyr binary for bootloader chain-loading
25 flash: flash and run a binary on a board
27 debugserver: connect to board and launch a debug server
28 attach: interactively debug a board
30 See :file:`zephyr/scripts/west-commands.yml` and the
37 :ref:`configuration <west-config>` option to ``false``. To set this
40 .. code-block:: console
42 west config --global commands.allow_extensions false
44 If you want to, you can then re-enable them in a particular :term:`west
47 .. code-block:: console
49 west config --local commands.allow_extensions true
60 #. Add information about it to a :file:`west-commands.yml` file.
61 #. Make sure the :file:`west-commands.yml` file is referenced in the
65 built-in command.
79 details on the west APIs you can use, see :ref:`west-apis`.
81 .. code-block:: py
95 'my-command-name', # gets stored as self.name
96 'one-line help for what my-command-name does', # self.help
99 A multi-line description of my-command.
116 parser.add_argument('-o', '--optional', help='an optional argument')
124 # $ west my-command-name -o FOO BAR
125 # --optional is FOO
127 self.inf('--optional is', args.optional)
135 Step 2: Add or Update Your :file:`west-commands.yml`
138 You now need to add a :file:`west-commands.yml` file to your project which
144 .. code-block:: yaml
146 west-commands:
147 - file: my_west_extension.py
149 - name: my-command-name
151 help: one-line help for what my-command-name does
153 The top level of this YAML file is a map with a ``west-commands`` key. The
161 runs ``west my-command-name``, since:
163 - It allows users to run ``west update`` with a manifest from an untrusted
165 the way. Since importing a Python module is shell-equivalent, this provides
168 - It's a small optimization, since your code will only be imported if it is
172 :file:`west-commands.yml` file to get the basic information it needs to display
173 information about your extension to the user in ``west --help`` output, etc.
176 multiple files, your :file:`west-commands.yml` will look something like this:
178 .. code-block:: yaml
180 west-commands:
181 - file: my_west_extension.py
183 - name: my-command-name
185 help: one-line help for what my-command-name does
186 - file: another_file.py
188 - name: command2
190 - name: a-third-command
196 - :file:`my_west_extension.py` defines extension ``my-command-name``
198 - :file:`another_file.py` defines two extensions:
201 #. ``a-third-command`` with class ``ThirdCommand``
203 See the file :file:`west-commands-schema.yml` in the `west repository`_ for a
204 schema describing the contents of a :file:`west-commands.yml`.
209 Finally, you need to specify the location of the :file:`west-commands.yml` you
213 .. code-block:: yaml
219 - name: your-project
220 west-commands: path/to/west-commands.yml
223 Where :file:`path/to/west-commands.yml` is relative to the root of the project.
224 Note that the name :file:`west-commands.yml`, while encouraged, is just a
230 .. code-block:: yaml
236 west-commands: path/to/west-commands.yml
238 That's it; you can now run ``west my-command-name``. Your command's name, help,
240 --help`` output. If you share the updated repositories with others, they'll be
247 https://github.com/zephyrproject-rtos/west/