Skip to content

Task Automation

Similar to Make, Just simplifies the execution of common and repetitive tasks. This means you can specify targets in your justfile to reduce regularly executed tasks with complex commands (such as building your documentation) from, for example,

uv run --group docs sphinx-build -b html docs/ docs/_build/html
to just docs 🚀

Task overview

Run just in your terminal, and it will list all the recipies available for execution:

Available recipes:
  build            # Build the project, useful for checking that packaging is correct
  clean            # Remove all build, test, coverage and Python artifacts
  clean-build      # Remove build artifacts
  clean-docs       # Remove documentation build artifacts
  clean-pyc        # Remove Python file artifacts
  clean-test       # Remove test and coverage artifacts
  coverage         # Run coverage, and build to HTML
  docs             # Compile the documentation
  docs-serve       # Serve the documentation with live reload
  lint *ARGS       # Run ruff check for linting without modifying files
  pdb *ARGS        # Run all the tests, but on failure, drop into the debugger
  publish          # Publish to PyPI (manual alternative to GitHub Actions)
  qa               # Run all the formatting, linting, and testing commands
  tag              # Tag the current version in git and put to github
  test *ARGS       # Run all the tests, but allow for arguments to be passed
  test-gh-actions  # Test github actions locally
  version          # Print the current version of the project

Some commands allow for arguments to be passed. For the exact commands, have a look at the justfile in the project directory.

Add your own tasks

You can add custom tasks to your justfile, simply by defining a target and the actions to execute:

# Short description of my new task
my-new-task:
    echo "My new task..."
    # Add your commands

For more details on Just, read the Just documentation.

Create shortcuts for complex commands

I usually structure my data-processing workflow such that I can run a single process via the command line1, for example

python scripts/process-raw-data.py -i data/raw/input_data.csv  -o ./data/interim/ --clean-data --fill_nan

These commands I set as targets in the justfile, for example:

# Process raw data and write the newly generated data into ./data/interim/
process-raw-data:
    python scripts/process-raw-data.py -i data/raw/input_data.csv  -o ./data/interim/ --clean-data --fill_nan

I can now simply run just process-raw-data in the project's root directory.


  1. The Python packages click, fire, and docopt provide neat functionalities to convert your scripts into interactive command-line interfaces.