Linux, MacOS, Windows, and other reasonable unices 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.
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.
Windows
On Windows, just works with the sh provided by
Git for Windows,
GitHub Desktop, or
Cygwin. After installation, sh must be available in
the PATH of the shell you want to invoke just from.
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.)
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:
# 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.
Another way to avoid rate-limiting is to pass a GitHub authentication token to
install.sh as an environment variable named GITHUB_TOKEN, allowing it to
authenticate its requests.
Releases include a SHA256SUM file
which can be used to verify the integrity of pre-built binary archives.
To verify a release, download the pre-built binary archive along with the
SHA256SUM file and run:
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, platform-specific binary as part of the npm install
command. This removes the need for every developer to install just
independently using one of the processes mentioned above. After installation,
the just command will work in npm scripts or with npx. It’s great for teams
who want to make the set up process for their project as easy as possible.
With the release of version 1.0, just features a strong commitment to
backwards compatibility and stability.
Future releases will not introduce backwards incompatible changes that make
existing justfiles stop working, or break working invocations of the
command-line interface.
This does not, however, preclude fixing outright bugs, even if doing so might
break justfiles that rely on their behavior.
There will never be a just 2.0. Any desirable backwards-incompatible changes
will be opt-in on a per-justfile basis, so users may migrate at their
leisure.
Features that aren’t yet ready for stabilization are marked as unstable and may
be changed or removed at any time. Using unstable features produces an error by
default, which can be suppressed with by passing the --unstable flag,
set unstable, or setting the environment variable JUST_UNSTABLE, to any
value other than false, 0, or the empty string.
Editor Support
justfile syntax is close enough to make that you may want to tell your
editor to use make syntax highlighting for just.
Vim and Neovim
Vim version 9.1.1042 or better and Neovim version 0.11 or better support
Justfile syntax highlighting out of the box, thanks to
pbnj.
vim-just
The vim-just plugin provides syntax
highlighting for justfiles.
Install it with your favorite package manager, like
Plug:
Vim’s built-in makefile syntax highlighting isn’t perfect for justfiles, but
it’s better than nothing. You can put the following in ~/.vim/filetype.vim:
if exists("did_load_filetypes")
finish
endif
augroup filetypedetect
au BufNewFile,BufRead justfile setf make
augroup END
Or add the following to an individual justfile to enable make mode on a
per-file basis:
# vim: set ft=make :
Emacs
just-mode provides syntax
highlighting and automatic indentation of justfiles. It is available on
MELPA as just-mode.
justl provides commands for executing and
listing recipes.
You can add the following to an individual justfile to enable make mode on
a per-file basis:
Once just is installed and working, create a file named justfile in the
root of your project with the following contents:
recipe-name:
echo 'This is a recipe!'
# this is a comment
another-recipe:
@echo 'This is another recipe.'
When you invoke just it looks for file justfile in the current directory
and upwards, so you can invoke it from any subdirectory of your project.
The search for a justfile is case insensitive, so any case, like Justfile,
JUSTFILE, or JuStFiLe, will work. just will also look for files with the
name .justfile, in case you’d like to hide a justfile.
Running just with no arguments runs the first recipe in the justfile:
$ just
echo 'This is a recipe!'
This is a recipe!
One or more arguments specify the recipe(s) to run:
$ just another-recipe
This is another recipe.
just prints each command to standard error before running it, which is why
echo 'This is a recipe!' was printed. This is suppressed for lines starting
with @, which is why echo 'This is another recipe.' was not printed.
Recipes stop running if a command fails. Here cargo publish will only run if
cargo test succeeds:
publish:
cargo test
# tests passed, time to publish!
cargo publish
Recipes can depend on other recipes. Here the test recipe depends on the
build recipe, so build will run before test:
build:
cc main.c foo.c bar.c -o main
test: build
./test
sloc:
@echo "`wc -l *.c` lines of code"
$ just test
cc main.c foo.c bar.c -o main
./test
testing… all tests passed!
Recipes without dependencies will run in the order they’re given on the command
line:
$ just build sloc
cc main.c foo.c bar.c -o main
1337 lines of code
Dependencies will always run first, even if they are passed after a recipe that
depends on them:
$ just test build
cc main.c foo.c bar.c -o main
./test
testing… all tests passed!
When just is invoked without a recipe, it runs the recipe with the
[default] attribute, or the first recipe in the justfile if no recipe has
the [default] attribute.
This recipe might be the most frequently run command in the project, like
running the tests:
test:
cargo test
You can also use dependencies to run multiple recipes by default:
If no recipe makes sense as the default recipe, you can add a recipe to the
beginning of your justfile that lists the available recipes:
default:
just --list
Listing Available Recipes
Recipes can be listed in alphabetical order with just --list:
$ just --list
Available recipes:
build
test
deploy
lint
Recipes in submodules can be listed with just --list PATH,
where PATH is a space- or ::-separated module path:
$ cat justfile
mod foo
$ cat foo.just
mod bar
$ cat bar.just
baz:
$ just --list foo bar
Available recipes:
baz
$ just --list foo::bar
Available recipes:
baz
just --summary is more concise:
$ just --summary
build test deploy lint
Pass --unsorted to print recipes in the order they appear in the justfile:
test:
echo 'Testing!'
build:
echo 'Building!'
$ just --list --unsorted
Available recipes:
test
build
$ just --summary --unsorted
test build
If you’d like just to default to listing the recipes in the justfile, you
can use this as your default recipe:
default:
@just --list
Note that you may need to add --justfile {{justfile()}} to the line above.
Without it, if you executed just -f /some/distant/justfile -d . or
just -f ./non-standard-justfile, the plain just --list inside the recipe
would not necessarily use the file you provided. It would try to find a
justfile in your current path, maybe even resulting in a No justfile found
error.
The heading text can be customized with --list-heading:
justjustis a handy way to save and run project-specific commands.This readme is also available as a book. The book reflects the latest release, whereas the readme on GitHub reflects latest master.
(中文文档在 这里, 快看过来!)
Commands, called recipes, are stored in a file called
justfilewith syntax inspired bymake:You can then run them with
just RECIPE:justhas a ton of useful features, and many improvements overmake:justis a command runner, not a build system, so it avoids much ofmake‘s complexity and idiosyncrasies. No need for.PHONYrecipes!Linux, MacOS, Windows, and other reasonable unices 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.
justloads.envfiles, 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.
justcan be invoked from any subdirectory, not just the directory that contains thejustfile.And much more!
If you need help with
justplease feel free to open an issue or ping me on Discord. Feature requests and bug reports are always welcome!Installation
Prerequisites
justshould run on any system with a reasonablesh, including Linux, MacOS, and the BSDs.Windows
On Windows,
justworks with theshprovided by Git for Windows, GitHub Desktop, or Cygwin. After installation,shmust be available in thePATHof the shell you want to invokejustfrom.If you’d rather not install
sh, you can use theshellsetting to use the shell of your choice.Like PowerShell:
…or
cmd.exe:You can also set the shell using command-line arguments. For example, to use PowerShell, launch
justwith--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.exeis quite fiddly, so PowerShell is recommended for most Windows users.)Packages
Cross-platform
arkade get justasdf plugin add justasdf install just <version>cargo install justconda install -c conda-forge justbrew install justnix-env -iA nixpkgs.justnpm install -g rust-justpipx install rust-justsnap install --edge --classic justBSD
pkg install justpkg_add justLinux
apk add justpacman -S justapt install justdnf install justemerge -av dev-build/justnix-env -iA nixos.justzypper in justeopkg install justxbps-install -S justWindows
choco install justscoop install justwinget install --id Casey.Just --exactmacOS
port install justPre-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
DESTwith the directory where you’d like to putjust:For example, to install
justto~/bin:Note that
install.shmay fail on GitHub Actions, or in other environments where many machines share IP addresses.install.shcalls GitHub APIs in order to determine the latest version ofjustto install, and those API calls are rate-limited on a per-IP basis. To makeinstall.shmore reliable in such circumstances, pass a specific tag to install with--tag.Another way to avoid rate-limiting is to pass a GitHub authentication token to
install.shas an environment variable namedGITHUB_TOKEN, allowing it to authenticate its requests.Releases include a
SHA256SUMfile which can be used to verify the integrity of pre-built binary archives.To verify a release, download the pre-built binary archive along with the
SHA256SUMfile and run:GitHub Actions
justcan 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 withchoco install just.With extractions/setup-just:
Or with taiki-e/install-action:
Release RSS Feed
An RSS feed of
justreleases is available here.Node.js Installation
just-install can be used to automate installation of
justin Node.js applications.justis a great, more robust alternative to npm scripts. If you want to includejustin the dependencies of a Node.js application,just-installwill install a local, platform-specific binary as part of thenpm installcommand. This removes the need for every developer to installjustindependently using one of the processes mentioned above. After installation, thejustcommand will work in npm scripts or with npx. It’s great for teams who want to make the set up process for their project as easy as possible.For more information, see the just-install README file.
Backwards Compatibility
With the release of version 1.0,
justfeatures a strong commitment to backwards compatibility and stability.Future releases will not introduce backwards incompatible changes that make existing
justfiles stop working, or break working invocations of the command-line interface.This does not, however, preclude fixing outright bugs, even if doing so might break
justfilesthat rely on their behavior.There will never be a
just2.0. Any desirable backwards-incompatible changes will be opt-in on a per-justfilebasis, so users may migrate at their leisure.Features that aren’t yet ready for stabilization are marked as unstable and may be changed or removed at any time. Using unstable features produces an error by default, which can be suppressed with by passing the
--unstableflag,set unstable, or setting the environment variableJUST_UNSTABLE, to any value other thanfalse,0, or the empty string.Editor Support
justfilesyntax is close enough tomakethat you may want to tell your editor to usemakesyntax highlighting forjust.Vim and Neovim
Vim version 9.1.1042 or better and Neovim version 0.11 or better support Justfile syntax highlighting out of the box, thanks to pbnj.
vim-justThe vim-just plugin provides syntax highlighting for
justfiles.Install it with your favorite package manager, like Plug:
Or with Vim’s built-in package support:
tree-sitter-justtree-sitter-just is an Nvim Treesitter plugin for Neovim.
Makefile Syntax Highlighting
Vim’s built-in makefile syntax highlighting isn’t perfect for
justfiles, but it’s better than nothing. You can put the following in~/.vim/filetype.vim:Or add the following to an individual
justfileto enablemakemode on a per-file basis:Emacs
just-mode provides syntax highlighting and automatic indentation of
justfiles. It is available on MELPA as just-mode.justl provides commands for executing and listing recipes.
You can add the following to an individual
justfileto enablemakemode on a per-file basis:Visual Studio Code
An extension for VS Code is available here.
Unmaintained VS Code extensions include skellock/vscode-just and sclu1034/vscode-just.
JetBrains IDEs
A plugin for JetBrains IDEs by linux_china is available here.
Kakoune
Kakoune supports
justfilesyntax highlighting out of the box, thanks to TeddyDD.Helix
Helix supports
justfilesyntax highlighting out-of-the-box since version 23.05.Sublime Text
The Just package by nk9 with
justsyntax and some other tools is available on PackageControl.Micro
Micro supports Justfile syntax highlighting out of the box, thanks to tomodachi94.
Zed
The zed-just extension by jackTabsCode is avilable on the Zed extensions page.
Other Editors
Feel free to send me the commands necessary to get syntax highlighting working in your editor of choice so that I may include them here.
Language Server Protocol
just-lsp provides a language server protocol implementation, enabling features such as go-to-definition, inline diagnostics, and code completion.
Model Context Protocol
just-mcp provides a model context protocol adapter to allow LLMs to query the contents of
justfilesand run recipes.Quick Start
See the installation section for how to install
juston your computer. Try runningjust --versionto make sure that it’s installed correctly.For an overview of the syntax, check out this cheatsheet.
Once
justis installed and working, create a file namedjustfilein the root of your project with the following contents:When you invoke
justit looks for filejustfilein the current directory and upwards, so you can invoke it from any subdirectory of your project.The search for a
justfileis case insensitive, so any case, likeJustfile,JUSTFILE, orJuStFiLe, will work.justwill also look for files with the name.justfile, in case you’d like to hide ajustfile.Running
justwith no arguments runs the first recipe in thejustfile:One or more arguments specify the recipe(s) to run:
justprints each command to standard error before running it, which is whyecho 'This is a recipe!'was printed. This is suppressed for lines starting with@, which is whyecho 'This is another recipe.'was not printed.Recipes stop running if a command fails. Here
cargo publishwill only run ifcargo testsucceeds:Recipes can depend on other recipes. Here the
testrecipe depends on thebuildrecipe, sobuildwill run beforetest:Recipes without dependencies will run in the order they’re given on the command line:
Dependencies will always run first, even if they are passed after a recipe that depends on them:
Recipes may depend on recipes in submodules:
Examples
A variety of
justfiles can be found in the examples directory and on GitHub.Features
The Default Recipe
When
justis invoked without a recipe, it runs the recipe with the[default]attribute, or the first recipe in thejustfileif no recipe has the[default]attribute.This recipe might be the most frequently run command in the project, like running the tests:
You can also use dependencies to run multiple recipes by default:
If no recipe makes sense as the default recipe, you can add a recipe to the beginning of your
justfilethat lists the available recipes:Listing Available Recipes
Recipes can be listed in alphabetical order with
just --list:Recipes in submodules can be listed with
just --list PATH, wherePATHis a space- or::-separated module path:just --summaryis more concise:Pass
--unsortedto print recipes in the order they appear in thejustfile:If you’d like
justto default to listing the recipes in thejustfile, you can use this as your default recipe:Note that you may need to add
--justfile {{justfile()}}to the line above. Without it, if you executedjust -f /some/distant/justfile -d .orjust -f ./non-standard-justfile, the plainjust --listinside the recipe would not necessarily use the file you provided. It would try to find a justfile in your current path, maybe even resulting in aNo justfile founderror.The heading text can be customized with
--list-heading: