Zephyr Justfile Usage
Use this skill to create or extend Justfiles for Zephyr applications, following the preferred patterns and conventions.
1) Start from the reference
- Use
references/just-quick-reference.mdas the default baseline. - Pull missing details from
references/just-manual.mdonly when needed. - Use
references/zephyr-justfile-template.justas the starting template for new apps.
2) Establish core settings
- Prefer
set shell := ['zsh', '-uc']andset unstable := trueto match the template. - Use
require('west')to enforce tool availability. - Derive
appfromsource_dir()andboardfromwest config build.boardwith a fallback. - Keep variables at the top; expose knobs via env/vars, not long argument lists.
3) Default + discoverability
- Use a default listing recipe that formats the app name.
- Prefer
just --list-headingto keep a consistent UI.
4) Zephyr build workflow
- Provide
configureto setwest configdefaults (board, build dir format, pristine). - Provide
build,build_clean, andcleanwithbuild_dirderived from west config. - Use
board,snippet,target, andcleanas overridable knobs.
5) Flash/run tooling
- Provide a
flashrecipe that depends onbuild.
6) Devicetree tooling (dtsh)
- Provide
_dtshguard + helpers:dts_tree,dts_ls,dts_cat,dtsh_out_html,dts_find.
7) Extend safely
- Group recipes by workflow stage:
config,build,run,tools. - Keep private helpers prefixed with
_. - Quote interpolations when values may include spaces.
- Use
--justfile {{ source_file() }}for self-invocations.
References
references/just-quick-reference.md— concise just patternsreferences/just-manual.md— baseline manual detailsreferences/zephyr-justfile-template.just— Zephyr app template