Running
just
Run the default (first) recipe
just <recipe> [<args>...]
Run one or more recipes in order
just --list / just -l
List recipes with doc comments
just --dry-run / just -n
Print recipe lines without running them
just --show <recipe> / just -s <recipe>
Print a recipe's source
just --init
Write a starter justfile in the project root
just --choose
Pick recipes with a chooser (fzf by default)
Set JUST_CHOOSER or pass --chooser to use another picker;
recipes needing arguments are not offered.
just --fmt
Rewrite the justfile in canonical style
just <var>=<value> <recipe>
Override a variable for this run
--set <var> <value> is the long form.
just --yes <recipe>
Auto-answer [confirm] prompts
just --quiet / just -q
Suppress all output
just --justfile <file> / just -f <file>
Use a specific justfile
just --global-justfile / just -g
Use the global justfile
just --edit / just -e
Open the justfile in $VISUAL or $EDITOR
just --command <cmd> / just -c <cmd>
Run a command with the justfile's env and .env loaded
just --evaluate [<var>]
Print variables with their values
just --completions <shell>
Print a shell completion script
Recipe syntax
A recipe
build: cargo build --release
<name>: <dep> <dep>
Run dependencies before the recipe
<name>: <dep> && <after>
Run a dependency after the recipe body
<name>: (<dep> "<arg>")
Pass an argument to a dependency
@<name>:
Don't echo this recipe's lines
@<command>
Don't echo one line
-<command>
Keep going if this line fails
{{<var>}}
Insert a variable or expression into a line
<name> <param>:
Required parameter
<name> <param>=<default>:
Parameter with a default
<name> +<files>:
Variadic: one or more values
<name> *<flags>:
Variadic: zero or more values
<name> $<param>:
Export a parameter as an env var
alias <short> := <recipe>
Another name for a recipe
List recipes when run bare
default: @just --list
[arg("<param>",
long="<opt>")]
Take a parameter as a --option
Variables
<name> := "<value>"
Define a variable
export <NAME> := "<value>"
Export to recipe environments
<name> := `<command>`
Capture a command's output
<a> + <b>
Concatenate strings
<dir> / <file>
Join path parts with a slash
if <a> == <b> { <x> } else { <y>
}
Conditional expression
Also !=, =~ (regex match) and &&, ||.
'<text>'
Literal string, no escapes
"<text>"
String with \n \t \" escapes
set dotenv-load
Load .env into the environment
$<NAME>
Read an env var inside a recipe line
env("<NAME>",
"<default>")
Env var with fallback
env("<NAME>")
Env var, error if unset
justfile_directory()
Directory of the justfile
invocation_directory()
Directory just was started from
path_exists(<p>)
True if the path exists
require("<tool>")
Path to a tool, error if missing