API Reference

Turborepo

High-performance monorepo build system that caches task outputs and runs tasks across packages with dependency awareness.

Official Documentation ↗
CompatibilityThis documentation covers version v2. Check the official docs for the latest API surface.

Installation

npmnpm install --save-dev turbo
pnpmpnpm add -D turbo

Methods

Overview

Turborepo is a monorepo build system that caches task outputs and schedules tasks across packages using the dependency graph. This reference lists the most frequently used APIs with accurate signatures and runnable snippets.

Core APIs

  • turbo run — Runs a named task across the packages that define it, respecting the dependency graph.
  • turbo prune — Generates a trimmed copy of the monorepo containing only a package and its dependencies.
  • --filter — Scopes task execution to a package, its dependents, or its dependencies.

Example

# run build in every workspace that declares it
turbo run build

# only packages that changed since main plus their dependents
turbo run test --filter=...[origin/main]

Notes

Cache correctness depends on declaring inputs and env dependencies in turbo.json. In v2 the pipeline key was renamed to tasks.

Verification

Run the same task twice without changes and confirm the second run reports a full cache hit for every package task.

API reference evidence

Fetched from official sources on 2026-11-08T20:09:00+08:00 via WebFetch https://turbo.build/repo/docs/reference/command-line-reference;WebFetch https://turbo.build/repo/docs/reference/command-line-reference/run;WebFetch https://turbo.build/repo/docs/reference/command-line-reference/prune.

FAQ

Where is remote caching configured?
Run turbo login and turbo link, then set the remoteCache options or use the TURBO_TOKEN environment variable in CI.
Why was my task cache miss on CI?
Cache keys include inputs, env vars, and lockfile; add TURBO_TOKEN and specify env dependencies with the env key in turbo.json so keys stay stable.
What replaced the pipeline key in v2?
Turbo v2 renamed pipeline to tasks in turbo.json and introduced a top-level schema file; migrate by renaming the key.