just
just
is a handy way to save and run project-specific commands.
This readme is also available as a book.
(中文文档在 这里, 快看过来!)
Commands, called recipes, are stored in a file called justfile
with syntax
inspired by make
:
You can then run them with just RECIPE
:
$ just test-all
cc *.c -o main
./test --all
Yay, all your tests passed!
just
has a ton of useful features, and many improvements over make
:
-
just
is a command runner, not a build system, so it avoids much ofmake
's complexity and idiosyncrasies. No need for.PHONY
recipes! -
Linux, MacOS, and Windows are supported with no additional dependencies. (Although if your system doesn't have an
sh
, you'll need to choose a different shell.) -
Errors are specific and informative, and syntax errors are reported along with their source context.
-
Recipes can accept command line arguments.
-
Wherever possible, errors are resolved statically. Unknown recipes and circular dependencies are reported before anything runs.
-
just
loads.env
files, making it easy to populate environment variables. -
Recipes can be listed from the command line.
-
Command line completion scripts are available for most popular shells.
-
Recipes can be written in arbitrary languages, like Python or NodeJS.
-
just
can be invoked from any subdirectory, not just the directory that contains thejustfile
. -
And much more!
If you need help with just
please feel free to open an issue or ping me on
Discord. Feature requests and bug reports are
always welcome!
Installation
Prerequisites
just
should run on any system with a reasonable sh
, including Linux, MacOS,
and the BSDs.
On Windows, just
works with the sh
provided by
Git for Windows,
GitHub Desktop, or
Cygwin.
If you'd rather not install sh
, you can use the shell
setting to use the
shell of your choice.
Like PowerShell:
# use PowerShell instead of sh:
set shell := ["powershell.exe", "-c"]
hello:
Write-Host "Hello, world!"
…or cmd.exe
:
# use cmd.exe instead of sh:
set shell := ["cmd.exe", "/c"]
list:
dir
You can also set the shell using command-line arguments. For example, to use
PowerShell, launch just
with --shell powershell.exe --shell-arg -c
.
(PowerShell is installed by default on Windows 7 SP1 and Windows Server 2008 R2
S1 and later, and cmd.exe
is quite fiddly, so PowerShell is recommended for
most Windows users.)
Packages
Operating System | Package Manager | Package | Command |
---|---|---|---|
Alpine Linux | apk-tools | just | apk add just |
Arch Linux | pacman | just | pacman -S just |
Debian 13 (unreleased) and Ubuntu 24.04 derivatives | apt | just | apt install just |
Debian and Ubuntu derivatives | MPR | just |
git clone https://mpr.makedeb.org/just cd just makedeb -si
|
Debian and Ubuntu derivatives | Prebuilt-MPR | just |
You must have the Prebuilt-MPR set up on your system in order to run this command.apt install just
|
Fedora Linux | DNF | just | dnf install just |
FreeBSD | pkg | just | pkg install just |
Gentoo Linux | Portage | guru/dev-build/just |
eselect repository enable guru emerge --sync guru emerge dev-build/just
|
macOS | MacPorts | just | port install just |
Microsoft Windows | Chocolatey | just | choco install just |
Microsoft Windows | Scoop | just | scoop install just |
Microsoft Windows | Windows Package Manager | Casey/Just | winget install --id Casey.Just --exact |
NixOS | Nix | just | nix-env -iA nixos.just |
openSUSE | Zypper | just | zypper in just |
Solus | eopkg | just | eopkg install just |
Various | asdf | just |
asdf plugin add just asdf install just <version>
|
Various | Cargo | just | cargo install just |
Various | Conda | just | conda install -c conda-forge just |
Various | Homebrew | just | brew install just |
Various | Nix | just | nix-env -iA nixpkgs.just |
Void Linux | XBPS | just | xbps-install -S just |
Pre-Built Binaries
Pre-built binaries for Linux, MacOS, and Windows can be found on the releases page.
You can use the following command on Linux, MacOS, or Windows to download the
latest release, just replace DEST
with the directory where you'd like to put
just
:
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to DEST
For example, to install just
to ~/bin
:
# create ~/bin
mkdir -p ~/bin
# download and extract just to ~/bin/just
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin
# add `~/bin` to the paths that your shell searches for executables
# this line should be added to your shells initialization file,
# e.g. `~/.bashrc` or `~/.zshrc`
export PATH="$PATH:$HOME/bin"
# just should now be executable
just --help
Note that install.sh
may fail on GitHub Actions, or in other environments
where many machines share IP addresses. install.sh
calls GitHub APIs in order
to determine the latest version of just
to install, and those API calls are
rate-limited on a per-IP basis. To make install.sh
more reliable in such
circumstances, pass a specific tag to install with --tag
.
GitHub Actions
just
can be installed on GitHub Actions in a few ways.
Using package managers pre-installed on GitHub Actions runners on MacOS with
brew install just
, and on Windows with choco install just
.
With extractions/setup-just:
- uses: extractions/setup-just@v1
with:
just-version: 1.5.0 # optional semver specification, otherwise latest
Or with taiki-e/install-action:
- uses: taiki-e/install-action@just
Release RSS Feed
An RSS feed of just
releases is available here.
Node.js Installation
just-install can be used to automate
installation of just
in Node.js applications.
just
is a great, more robust alternative to npm scripts. If you want to
include just
in the dependencies of a Node.js application, just-install
will install a local,