Modern software development projects often accumulate an assortment of utility scripts, test suites, container builds, and database migration commands. While traditional developers relied on GNU make to orchestrate these tasks, make was fundamentally designed as a C compiler dependency tracker—burdening projects with quirky tab-indented syntax, awkward argument parsing, and implicit file-generation rules. just is a dedicated, modern command runner written in Rust that provides a clean, purpose-built syntax for project task management without the idiosyncrasies of Makefiles.
Why Use just Over GNU Make?
Unlike build engines that focus on file timestamp dependencies, just is engineered explicitly as a command runner:
- Sensible Syntax: Supports standard spaces or tabs for indentation, eliminating the dreaded “missing separator” errors inherent to Makefiles.
- Positional and Variadic Arguments: Recipes accept parameters, default values, and variadic flags directly from the command line.
- Cross-Platform Compatibility: Runs consistently across Linux, macOS, and Windows with support for native shells or custom interpreters (such as Bash, Python, or Node.js).
- Interactive Recipe Listing: Running
justwithout arguments prints a clean, formatted catalogue of available tasks along with their documentation comments. - Built-in Environment Variable Loading: Automatically imports variables from local
.envfiles without extra plugins.
How to Install just on Linux
Install just across various Linux distributions using native repositories, Cargo, or prebuilt binaries:
| Distribution / Toolchain | Terminal Installation Command |
|---|---|
| Ubuntu / Debian | sudo apt install just (Ubuntu 24.04+) or cargo install just |
| Arch Linux / Manjaro | sudo pacman -S just |
| Fedora | sudo dnf install just |
| Homebrew on Linux | brew install just |
Verify that the binary installed successfully:
just --version
Creating a Project justfile
In the root of any repository, create a file named justfile (or Justfile):
nano justfile
Add common development recipes with inline documentation comments:
# Set default recipe to show all commands
default:
@just --list
# Start development containers
up:
docker compose up -d
# Stop all running containers
down:
docker compose down
# Run the project test suite with optional verbosity
test filter="":
cargo test {{filter}}
# Deploy project to target environment (staging or production)
deploy env="staging":
@echo "Deploying release to {{env}} server..."
./scripts/deploy.sh {{env}}
Executing Recipes with Parameters
Running commands with just is intuitive and concise:
- To view all documented tasks in your project, type:
The terminal lists all recipes alongside their explanatory descriptions.just - To run a basic recipe:
just up - To pass parameters to a recipe:
just deploy production just test auth_module
Advanced justfile Features
Tailor complex automation tasks using these built-in just capabilities:
1. Silent Commands
Prefix any command line with an @ symbol to suppress echoing the command string itself, executing only the output.
2. Polyglot Recipes
You can execute recipes in languages other than your default shell by providing a standard shebang line:
# Generate cryptographic audit hash using Python
hash-audit:
#!/usr/bin/env python3
import hashlib
print("Hash:", hashlib.sha256(b"digitash").hexdigest())
3. Dependency Chains
Specify prerequisites that must complete before the target recipe runs:
# Build production bundle after tests pass
build: test
cargo build --release
Shell Autocompletion for High Productivity
Enable tab completion in your shell (Bash or Zsh) by adding completion scripts to your profile:
# For Bash
just --completions bash >> ~/.bashrc
# For Zsh
just --completions zsh > ~/.zfunc/_just
Once enabled, pressing Tab after typing just suggests all declared recipes dynamically.