Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Configure and optimize Turborepo monorepo build pipelines with correct task structure, caching, and CI setup.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/cli/commands.md
1# turbo run Flags Reference23Full docs: https://turborepo.dev/docs/reference/run45## Package Selection67### `--filter` / `-F`89Select specific packages to run tasks in.1011```bash12turbo build --filter=web13turbo build -F=@repo/ui -F=@repo/utils14turbo test --filter=./apps/*15```1617See `filtering/` for complete syntax (globs, dependencies, git ranges).1819### Task Identifier Syntax (v2.2.4+)2021Run specific package tasks directly:2223```bash24turbo run web#build # Build web package25turbo run web#build docs#lint # Multiple specific tasks26```2728### `--affected`2930Run only in packages changed since the base branch.3132```bash33turbo build --affected34turbo test --affected --filter=./apps/* # combine with filter35```3637**How it works:**3839- Default: compares `main...HEAD`40- In GitHub Actions: auto-detects `GITHUB_BASE_REF`41- Override base: `TURBO_SCM_BASE=development turbo build --affected`42- Override head: `TURBO_SCM_HEAD=your-branch turbo build --affected`4344**Requires git history** - shallow clones may fall back to running all tasks.4546## Execution Control4748### `--dry` / `--dry=json`4950Preview what would run without executing.5152```bash53turbo build --dry # human-readable54turbo build --dry=json # machine-readable55```5657### `--force`5859Ignore all cached artifacts, re-run everything.6061```bash62turbo build --force63```6465### `--concurrency`6667Limit parallel task execution.6869```bash70turbo build --concurrency=4 # max 4 tasks71turbo build --concurrency=50% # 50% of CPU cores72```7374### `--continue`7576Keep running other tasks when one fails.7778```bash79turbo build test --continue80```8182### `--only`8384Run only the specified task, skip its dependencies.8586```bash87turbo build --only # skip running dependsOn tasks88```8990### `--parallel` (Discouraged)9192Ignores task graph dependencies, runs all tasks simultaneously. **Avoid using this flag**—if tasks need to run in parallel, configure `dependsOn` correctly instead. Using `--parallel` bypasses Turborepo's dependency graph, which can cause race conditions and incorrect builds.9394## Cache Control9596### `--cache`9798Fine-grained cache behavior control.99100```bash101# Default: read/write both local and remote102turbo build --cache=local:rw,remote:rw103104# Read-only local, no remote105turbo build --cache=local:r,remote:106107# Disable local, read-only remote108turbo build --cache=local:,remote:r109110# Disable all caching111turbo build --cache=local:,remote:112```113114## Output & Debugging115116### `--graph`117118Generate task graph visualization.119120```bash121turbo build --graph # opens in browser122turbo build --graph=graph.svg # SVG file123turbo build --graph=graph.png # PNG file124turbo build --graph=graph.json # JSON data125turbo build --graph=graph.mermaid # Mermaid diagram126```127128### `--summarize`129130Generate JSON run summary for debugging.131132```bash133turbo build --summarize134# creates .turbo/runs/<run-id>.json135```136137### `--output-logs`138139Control log output verbosity.140141```bash142turbo build --output-logs=full # all logs (default)143turbo build --output-logs=new-only # only cache misses144turbo build --output-logs=errors-only # only failures145turbo build --output-logs=none # silent146```147148### `--profile`149150Generate Chrome tracing profile for performance analysis.151152```bash153turbo build --profile=profile.json154# open chrome://tracing and load the file155```156157### `--verbosity` / `-v`158159Control turbo's own log level.160161```bash162turbo build -v # verbose163turbo build -vv # more verbose164turbo build -vvv # maximum verbosity165```166167## Environment168169### `--env-mode`170171Control environment variable handling.172173```bash174turbo build --env-mode=strict # only declared env vars (default)175turbo build --env-mode=loose # include all env vars in hash176```177178## UI179180### `--ui`181182Select output interface.183184```bash185turbo build --ui=tui # interactive terminal UI (default in TTY)186turbo build --ui=stream # streaming logs (default in CI)187```188189---190191# turbo-ignore192193Full docs: https://turborepo.dev/docs/reference/turbo-ignore194195Skip CI work when nothing relevant changed. Useful for skipping container setup.196197## Basic Usage198199```bash200# Check if build is needed for current package (uses Automatic Package Scoping)201npx turbo-ignore202203# Check specific package204npx turbo-ignore web205206# Check specific task207npx turbo-ignore --task=test208```209210## Exit Codes211212- `0`: No changes detected - skip CI work213- `1`: Changes detected - proceed with CI214215## CI Integration Example216217```yaml218# GitHub Actions219- name: Check for changes220id: turbo-ignore221run: npx turbo-ignore web222continue-on-error: true223224- name: Build225if: steps.turbo-ignore.outcome == 'failure' # changes detected226run: pnpm build227```228229## Comparison Depth230231Default: compares to parent commit (`HEAD^1`).232233```bash234# Compare to specific commit235npx turbo-ignore --fallback=abc123236237# Compare to branch238npx turbo-ignore --fallback=main239```240241---242243# Other Commands244245## turbo boundaries246247Check workspace violations (experimental).248249```bash250turbo boundaries251```252253See `references/boundaries/` for configuration.254255## turbo watch256257Re-run tasks on file changes.258259```bash260turbo watch build test261```262263See `references/watch/` for details.264265## turbo prune266267Create sparse checkout for Docker.268269```bash270turbo prune web --docker271```272273## turbo link / unlink274275Connect/disconnect Remote Cache.276277```bash278turbo link # connect to Vercel Remote Cache279turbo unlink # disconnect280```281282## turbo login / logout283284Authenticate with Remote Cache provider.285286```bash287turbo login # authenticate288turbo logout # log out289```290291## turbo generate292293Scaffold new packages.294295```bash296turbo generate297```298