Just
Just is a handy command runner that saves and executes project-specific tasks with a clean, make-inspired syntax designed for simplicity and robustness.
Just is a command runner that provides a convenient and robust way to save and execute project-specific commands. Unlike build systems like make, Just is focused specifically on command execution, eliminating common complexities and idiosyncrasies by avoiding the need for .PHONY targets or manual dependency management. It is designed to be cross-platform, running seamlessly on Linux, macOS, and Windows without requiring extra dependencies. Commands in Just, referred to as recipes, are defined in a file named justfile using syntax inspired by make, making the learning curve shallow for existing users.
Just executes recipes by invoking commands defined within a justfile. It supports static error resolution, reporting unknown recipes or circular dependencies before execution. Recipes can accept command-line arguments, support complex expression languages, and integrate built-in functions. It also provides automatic .env file loading to streamline environment variable management. Just can be invoked from any subdirectory, automatically locating the nearest justfile. For more complex projects, Just supports modularity through imports and multi-file organization with a module system, allowing for cleaner codebases.
Some of the key features are:
- Command Runner focus: Avoids build system complexity, treating all recipes as phony by default.
- Cross-platform support: Runs on Linux, macOS, and Windows without additional dependencies.
- Informative errors: Provides specific, helpful syntax errors with source context.
- Flexible parameters: Recipes support command-line arguments, flags, options, and default values.
- Rich expressions: Includes a built-in expression language and various utility functions.
- Environment support: Automatically loads .env files and provides robust environment variable handling.
- Language agnostic: Allows recipes to be written in any language using shebangs, such as Python or Node.js.
- Modular design: Supports imports and modules to organize large project configurations.
Just is used from the command line by invoking the name of the recipe to execute. Users can list available recipes, get usage information, or use shell auto-completion for better productivity. It supports running multiple recipes at once, passing arguments to dependencies, and can even be configured to prompt for confirmation before executing sensitive commands. Its configuration and execution logic prioritize simplicity, stability, and backwards compatibility, ensuring that justfiles remain functional across releases.
Some common use cases include:
- Build automation: Managing build commands for projects written in any programming language.
- Development workflows: Standardizing commands for linting, testing, and formatting code across a team.
- CI/CD integration: Providing a clean interface for executing tasks within GitHub Actions or other CI pipelines.
- Task management: Saving and executing complex command chains for environment setup or deployment.
- Environment configuration: Simplifying the injection of environment variables from .env files or secret managers.