just installieren: justfile schreiben, Recipes starten, Vergleich mit make
just, justfile, Recipes — wann statt Makefile.
Jedes Repo wiederholt lint/test/build — just hält Recipes in einer justfile. Dieser Leitfaden: the same dance—lint, test, build—buried in a README or locked inside language-specific scripts. just is a command runner by Casey Rodarmor: drop a justfile at the root, name recipes, and run them with just. Syntax is gentler than Make, and cross-platform setup is usually simpler. Installation macOS/Linux, justfile schreiben, Recipes ausführen, Vergleich mit make für hereink.
The query is how to install just command runner write justfile run recipes compare to make. You should finish with just installed, a first recipe, just --list for discovery, and a clear sense of when just beats a Makefile.
Was just löst
Discoverable project commands
New teammates run just --list instead of hunting Slack snippets. Comments above recipes show up in the listing.
Lighter than ad-hoc scripts
Recipes run from the project root by default, support variables, dependencies, and arguments—without a forest of chmod +x shell files.
Upstream:
github.com/casey/just, docs atjust.systems. Runjust --versionafter install.
just installieren
- 1macOS (Homebrew)
brew install just. Verify withwhich justandjust --version. - 2Linux (distro packages)
Arch:
sudo pacman -S just. On Debian/Ubuntu if packages lag, usecargo install justor official prebuilt binaries from the install page on just.systems. - 3Rust toolchain
With Rust installed:
cargo install just. Keep~/.cargo/binon yourPATH. - 4Version managers
mise use -g just@latest, or asdf’s just plugin if your team already standardizes on mise/asdf.
justfile schreiben
Create justfile (or .justfile) at the repo root. Minimal starter:
default:
just --list
# Run unit tests
test:
cargo test
check: lint test
echo "all green"
lint:
cargo clippy -- -D warningsSyntax highlights:
- Recipe names:
name:then indented commands (spaces, not tabs). - Parameters:
deploy env:and use{{env}}in the body. - Variables: top-level
port := "3000", reference as{{port}}. - Shebang recipes: start with
#!/usr/bin/env bashfor multi-line shell.
port := "8080"
serve:
python -m http.server {{port}}
greet name="world":
echo "hello {{name}}"Recipes ausführen
cd ~/projects/my-app
just --list
just test
just check
just greet Alice
justjust searches upward for a justfile. Override with just --justfile path/to/justfile recipe. Use -n / --dry-run to print commands without executing.
just vs make
| Topic | just | make |
|---|---|---|
| Primary job | Run project commands | Build graph from file timestamps |
| Syntax | Recipes + {{var}} | Targets, prerequisites, tab rules |
| Windows | First-class docs and builds | Often needs GNU make or WSL |
| Incremental builds | Not the default model | Core feature |
| Onboarding | README-friendly | Large Makefiles get brittle |
- Passt für just
- Unified
test/lint/deventrypoints; polyglot repos; readable task lists outside npm or poetry scripts. - Bei make bleiben
- C/C++ incremental compiles, heavy dependency graphs, or a mature Makefile the team already trusts.
Overlap with npm scripts?
Node-only repos can stay on npm scripts. just shines when Go, Python, and codegen share one task list—or when you want tasks decoupled from the package manager. Recipes can call npm run build.
Does cd inside a recipe stick?
Each recipe starts in the justfile directory; cd affects only later lines in that recipe. Use just --working-directory or a shebang script for cross-folder work.
Load .env automatically?
just supports set dotenv-load in the justfile (see the manual). Prefer direnv or CI secrets for sensitive values.
Nach den Tasks das System skizzieren
Once just dev works locally, service boundaries still belong on a shared canvas. See Raum erstellen.