Turborepo
High-performance monorepo build system that caches task outputs and runs tasks across packages with dependency awareness.
Official Documentation ↗v2. Check the official docs for the latest API surface.Installation
npm install --save-dev turbopnpm add -D turboMethods
No methods match this filter.
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.
turbo run→ signature from https://turbo.build/repo/docs/reference/command-line-reference/run; official text: “#turbo run <task>Run npm scripts across all workspaces in specified scope. Tasks must be specified in yourpipelineconfiguration.turbo run <task1> <task2> [options] [-- <args passed to task1 and task2>]”turbo prune→ signature from https://turbo.build/repo/docs/reference/command-line-reference/prune; official text: “#turbo prune <scope>...Generate a sparse/partial monorepo with a pruned lockfile for a target workspace.”--filter→ signature from https://turbo.build/repo/docs/reference/command-line-reference/run; official text: “###--filtertype: string[]Specify combinations of workspaces, directories, and git commits to act as entrypoints for execution. Multiple filters can be combined to select distinct sets of targets. Additionally, fil”
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.
Report a problem with this API docOpens a pre-filled issue on GitHub.