# Just — A Modern Command Runner and Makefile Alternative > Just is a command runner, like Make but for modern dev workflows. Write recipes in a Justfile, run them with `just recipe-name`. Simpler syntax than Make, no obscure behaviors, cross-platform, and works great for project tasks. ## Install Save as a script file and run: ## Quick Use ```bash # Install brew install just # macOS cargo install just # Rust scoop install just # Windows ``` Create `justfile` in your project root: ```make # List recipes default: @just --list # Run tests test: npm test # Build for production build: npm run build @echo "Build complete" # Deploy with arg deploy env="staging": ./scripts/deploy.sh {{env}} # Multi-line recipe release version: git tag v{{version}} git push --tags cargo publish # Recipe with dependencies ci: test build echo "CI passed" ``` Run: ```bash just # default recipe just test # run tests just deploy prod # with argument just ci # runs test then build then echo ``` ## Intro Just is a command runner, inspired by Make but built for modern developer workflows. Written in Rust by Casey Rodarmor, it offers cleaner syntax, cross-platform support, and avoids Make quirks (tab-only indentation, .PHONY gotchas, shell escaping). Perfect for project task automation. - **Repo**: https://github.com/casey/just - **Stars**: 32K+ - **Language**: Rust - **License**: CC0 (public domain) ## What Just Does - **Recipes** — named task definitions in a justfile - **Arguments** — positional and named with defaults - **Dependencies** — recipes can depend on other recipes - **Shebang recipes** — run entire recipe with python/node/bash - **String interpolation** — `{{var}}` substitution - **Env vars** — dotenv support via `set dotenv-load` - **Conditional** — `if os == "macos" { ... }` - **Private recipes** — prefix with `_` - **Groups** — organize recipes into groups ## Architecture Parses the justfile, builds a DAG of recipes, and runs them via the configured shell (sh by default, or any shebang). No make-style file timestamps or incremental logic — simpler and more predictable. ## Self-Hosting Single Rust binary. ## Key Features - Modern clean syntax - Cross-platform (macOS, Linux, Windows) - Recipe arguments with defaults - Dependencies and groups - Shebang recipes for multi-language tasks - Env var integration - Nice error messages - `just --list` auto-help - Tab or space indentation ## Comparison | Tool | Language | Scope | Strengths | |---|---|---|---| | Just | Rust | Task runner | Simple modern syntax | | Make | C | Build + tasks | Ubiquitous, incremental | | Taskfile | Go | Task runner | YAML-based | | npm scripts | JS | Node projects | Built into npm | | mise tasks | Rust | Task runner | Integrated env manager | | cargo-make | Rust | Rust projects | Rust-focused | ## 常见问题 FAQ **Q: 和 Make 区别?** A: Just 不做增量构建(无文件时间戳追踪),专注于任务运行。语法更干净,无 tab 强制、无 .PHONY 坑。适合 project tasks,不适合 C/C++ 大型构建。 **Q: 可以在 CI 用吗?** A: 非常合适。CI 上 `just ci` 一行跑所有检查,开发者本地完全一样的体验。 **Q: 支持 include 吗?** A: 支持 `import` 语法(v1.14+)来复用 recipes。 ## 来源与致谢 Sources - Docs: https://just.systems - GitHub: https://github.com/casey/just - License: CC0 --- Source: https://tokrepo.com/en/workflows/d3b6480b-35cb-11f1-9bc6-00163e2b0d79 Author: Script Depot