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/RULE.md
1# turbo run23The primary command for executing tasks across your monorepo.45## Basic Usage67```bash8# Full form (use in CI, package.json, scripts)9turbo run <tasks>1011# Shorthand (only for one-off terminal invocations)12turbo <tasks>13```1415## When to Use `turbo run` vs `turbo`1617**Always use `turbo run` when the command is written into code:**1819- `package.json` scripts20- CI/CD workflows (GitHub Actions, etc.)21- Shell scripts22- Documentation23- Any static/committed configuration2425**Only use `turbo` (shorthand) for:**2627- One-off commands typed directly in terminal28- Ad-hoc invocations by humans or agents2930```json31// package.json - ALWAYS use "turbo run"32{33"scripts": {34"build": "turbo run build",35"dev": "turbo run dev",36"lint": "turbo run lint",37"test": "turbo run test"38}39}40```4142```yaml43# CI workflow - ALWAYS use "turbo run"44- run: turbo run build --affected45- run: turbo run test --affected46```4748```bash49# Terminal one-off - shorthand OK50turbo build --filter=web51```5253## Running Tasks5455Tasks must be defined in `turbo.json` before running.5657```bash58# Single task59turbo build6061# Multiple tasks62turbo run build lint test6364# See available tasks (run without arguments)65turbo run66```6768## Passing Arguments to Scripts6970Use `--` to pass arguments through to the underlying package scripts:7172```bash73turbo run build -- --sourcemap74turbo test -- --watch75turbo lint -- --fix76```7778Everything after `--` goes directly to the task's script.7980## Package Selection8182By default, turbo runs tasks in all packages. Use `--filter` to narrow scope:8384```bash85turbo build --filter=web86turbo test --filter=./apps/*87```8889See `filtering/` for complete filter syntax.9091## Quick Reference9293| Goal | Command |94| ------------------- | -------------------------- |95| Build everything | `turbo build` |96| Build one package | `turbo build --filter=web` |97| Multiple tasks | `turbo build lint test` |98| Pass args to script | `turbo build -- --arg` |99| Preview run | `turbo build --dry` |100| Force rebuild | `turbo build --force` |101