Forge
Concepts

Tasks

Understanding tasks in Forge

Tasks

Tasks are the actions you can perform on projects. Each task is defined as a target in the project configuration.

Common Tasks

Forge provides standard tasks across all project types:

  • build - Compile and package the project
  • test - Run unit tests
  • lint - Check code quality and style
  • format - Format source code

Running Tasks

Run a task on a specific project:

nx run my-project:build

Run a task on all affected projects:

nx affected -t build

Run multiple tasks:

nx run-many -t build test lint

Task Pipeline

Tasks can depend on other tasks. For example, build might depend on the build task of dependent libraries. Forge automatically orchestrates task execution in the correct order.

In this task graph:

  • api:build runs first (no dependencies)
  • backend:build waits for api:build
  • frontend:build waits for both api:build and backend:build

Forge executes independent tasks in parallel and respects dependencies automatically.

Caching

Task results are cached locally and remotely. When inputs haven't changed, Forge replays the cached output instead of re-running the task.

On this page