Choosing a Different Shell
The shell setting controls the command used to invoke recipe lines and
backticks. Shebang recipes are unaffected. The default shell is sh -cu.
# use python3 to execute recipe lines and backticks
set shell := ["python3", "-c"]
# use print to capture result of evaluation
foos := `print("foo" * 4)`
foo:
print("Snake snake snake snake.")
print("{{foos}}")
just passes the command to be executed as an argument. Many shells will need
an additional flag, often -c, to make them evaluate the first argument.
Windows Shell
just uses sh on Windows by default. To use a different shell on Windows,
use windows-shell:
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
hello:
Write-Host "Hello, world!"
See powershell.just for a justfile that uses PowerShell on all platforms.
Windows PowerShell
set windows-powershell uses the legacy powershell.exe binary, and is no
longer recommended. See the windows-shell setting above for a more flexible
way to control which shell is used on Windows.
just uses sh on Windows by default. To use powershell.exe instead, set
windows-powershell to true.
set windows-powershell := true
hello:
Write-Host "Hello, world!"
Python 3
set shell := ["python3", "-c"]
Bash
set shell := ["bash", "-uc"]
Z Shell
set shell := ["zsh", "-uc"]
Fish
set shell := ["fish", "-c"]
Nushell
set shell := ["nu", "-c"]
If you want to change the default table mode to light:
set shell := ['nu', '-m', 'light', '-c']
Nushell was written in Rust, and has cross-platform support for Windows / macOS and Linux.