Jobs

A job groups related steps and controls how they execute. Jobs are defined as a map under jobs: or tasks: .

Job Fields

Field Description
desc: Description shown in job listings
steps: List of steps to execute
cmds: Alias for steps: (Taskfile-style)
cmd: Single command shorthand
run: Alias for cmd:
depends_on: Job dependencies (string or list of job names)
detach: true Run the job in background (parallel)
aliases: Alternative names for invoking the job
requires: Required variables when invoked via a for loop
if: Conditional execution (expr-lang expression)
dir: Working directory for all steps
timeout: Maximum execution time (e.g. "10m" , "300s" )
passthru: true Output printed with tree indentation
tty: true Allocate a PTY for color output
interactive: true Stream output live and connect stdin
quiet: true Suppress output
summarize: true Summarize output
show: Control visibility in tree (true /false /omit)
vars: Job-level variables
env: Job-level environment variables

Examples

  name: Job Dependencies Example

jobs:
  lint:
    desc: Run linters
    steps:
      - run: echo "Running linter..."

  test:
    desc: Run test suite
    depends_on: lint
    steps:
      - run: echo "Running tests..."

  build:
    desc: Build application
    depends_on: lint
    steps:
      - run: echo "Building app..."

  deploy:
    aliases: [default]
    desc: Deploy application
    depends_on: [build, test]
    steps:
      - run: echo "Deploying..."

Conditional Execution

Jobs can be conditionally executed using if: with an expr-lang expression:

  jobs:
  deploy:
    if: branch == "main"
    steps:
      - run: echo "Deploying..."

See Conditionals for full expression syntax and examples.

String Shorthand

For simple single-command jobs, use string shorthand:

  tasks:
  up: docker compose up -d
  down: docker compose down
  logs: docker compose logs -f

This is equivalent to:

  tasks:
  up:
    steps:
      - run: docker compose up -d

See Also