Unable to run custom scripts as west commands

Hi,

my question is basically, how can I run my own script as west command: like west my-own-cmd

when I run west -h. I can see the extensions from nrf and zephyr but I cant see from my project. Can you shed some light on how to create a project which allow me to run my own west script:

west -h

extension commands from project manifest (path: nrf):
ncs-loot: list out of tree unreverted NCS patches
ncs-compare: compare upstream manifest with NCS
ncs-upmerger: perform upmerge for project (e.g. Zephyr)
ncs-sbom: generate Software Bill Of Materials including
license information

extension commands from project zephyr (path: zephyr):
completion: output shell completion scripts
boards: display information about supported boards
build: compile a Zephyr application
sign: sign a Zephyr binary for bootloader chain-loading
flash: flash and run a binary on a board
debug: flash and interactively debug a Zephyr application
debugserver: connect to board and launch a debug server
attach: interactively debug a board
zephyr-export: export Zephyr installation as a CMake config
package
spdx: create SPDX bill of materials
blobs: work with binary blobs

I needed to create my own project under ncs2.2.0 and followed these instructions https://docs.zephyrproject.org/latest/develop/west/extensions.html and https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.99-dev1/zephyr/guides/west/manifest.html#west-manifest-cmd

I created the folder structure like this:

12/10/2023  09:52    <DIR>          .
02/10/2023  15:37    <DIR>          ..
10/02/2023  16:17    <DIR>          .west
10/02/2023  16:18    <DIR>          bootloader
12/10/2023  09:51    <DIR>          custom-prj
10/02/2023  16:18    <DIR>          mbedtls
10/02/2023  16:21    <DIR>          modules
10/02/2023  16:17    <DIR>          nrf
10/02/2023  16:18    <DIR>          nrfxlib
10/02/2023  16:19    <DIR>          test
10/02/2023  16:21    <DIR>          tools
10/02/2023  16:32    <DIR>          zephyr

Id like to have my own scripts that should be run as a west command like nrf scripts like west ncs-compare

my project folder structure:

11/10/2023  17:29    <DIR>          .
10/10/2023  15:20    <DIR>          ..
09/10/2023  10:55    <DIR>          boards
08/10/2023  00:05               748 CMakeLists.txt
08/10/2023  00:05             3,679 Kconfig.netfeasa
08/10/2023  08:36    <DIR>          modules
08/10/2023  08:41               791 modules.cmake
11/10/2023  17:05                50 README.md
08/10/2023  00:05    <DIR>          scripts
08/10/2023  00:05    <DIR>          VSCode_workspace
08/10/2023  00:05    <DIR>          west
08/10/2023  00:05            16,859 west-zephyr-bckp.yml.bckp
12/10/2023  09:02             1,041 west.yml
11/10/2023  17:02    <DIR>          wiki
11/10/2023  17:29    <DIR>          zephyr
               6 File(s)         23,168 bytes
               9 Dir(s)  41,403,899,904 bytes free

I have west.yml and west-commands.yml files

Parents Reply Children
Related