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/configuration/global-options.md
1# Global Options Reference23Options that affect all tasks. Full docs: https://turborepo.dev/docs/reference/configuration45## globalEnv67Environment variables affecting all task hashes.89```json10{11"globalEnv": ["CI", "NODE_ENV", "VERCEL_*"]12}13```1415Use for variables that should invalidate all caches when changed.1617## globalDependencies1819Files that affect all task hashes.2021```json22{23"globalDependencies": ["tsconfig.json", ".env", "pnpm-lock.yaml"]24}25```2627Lockfile is included by default. Add shared configs here.2829## globalPassThroughEnv3031Variables available to tasks but not included in hash.3233```json34{35"globalPassThroughEnv": ["AWS_SECRET_KEY", "GITHUB_TOKEN"]36}37```3839Use for credentials that shouldn't affect cache keys.4041## cacheDir4243Custom cache location. Default: `node_modules/.cache/turbo`.4445```json46{47"cacheDir": ".turbo/cache"48}49```5051## daemon5253**Deprecated**: The daemon is no longer used for `turbo run` and this option will be removed in version 3.0. The daemon is still used by `turbo watch` and the Turborepo LSP.5455## envMode5657How unspecified env vars are handled. Default: `"strict"`.5859```json60{61"envMode": "strict" // Only specified vars available62// or63"envMode": "loose" // All vars pass through64}65```6667Strict mode catches missing env declarations.6869## ui7071Terminal UI mode. Default: `"stream"`.7273```json74{75"ui": "tui" // Interactive terminal UI76// or77"ui": "stream" // Traditional streaming logs78}79```8081TUI provides better UX for parallel tasks.8283## remoteCache8485Configure remote caching.8687```json88{89"remoteCache": {90"enabled": true,91"signature": true,92"timeout": 30,93"uploadTimeout": 6094}95}96```9798| Option | Default | Description |99| --------------- | ---------------------- | ------------------------------------------------------ |100| `enabled` | `true` | Enable/disable remote caching |101| `signature` | `false` | Sign artifacts with `TURBO_REMOTE_CACHE_SIGNATURE_KEY` |102| `preflight` | `false` | Send OPTIONS request before cache requests |103| `timeout` | `30` | Timeout in seconds for cache operations |104| `uploadTimeout` | `60` | Timeout in seconds for uploads |105| `apiUrl` | `"https://vercel.com"` | Remote cache API endpoint |106| `loginUrl` | `"https://vercel.com"` | Login endpoint |107| `teamId` | - | Team ID (must start with `team_`) |108| `teamSlug` | - | Team slug for querystring |109110See https://turborepo.dev/docs/core-concepts/remote-caching for setup.111112## concurrency113114Default: `"10"`115116Limit parallel task execution.117118```json119{120"concurrency": "4" // Max 4 tasks at once121// or122"concurrency": "50%" // 50% of available CPUs123}124```125126## futureFlags127128Enable experimental features that will become default in future versions.129130```json131{132"futureFlags": {133"errorsOnlyShowHash": true134}135}136```137138### `errorsOnlyShowHash`139140When using `outputLogs: "errors-only"`, show task hashes on start/completion:141142- Cache miss: `cache miss, executing <hash> (only logging errors)`143- Cache hit: `cache hit, replaying logs (no errors) <hash>`144145### `longerSignatureKey`146147Enforce a minimum key length of 32 bytes for `TURBO_REMOTE_CACHE_SIGNATURE_KEY` when `remoteCache.signature` is enabled. Short keys weaken HMAC-SHA256 signatures. Fails the run immediately if the key is too short.148149### `globalConfiguration`150151Moves global configuration keys under a top-level `global` key for clarity and changes how `global.inputs` (formerly `globalDependencies`) affects task hashing.152153When enabled:154155- Global config keys move under `global` with cleaner names156- `global.inputs` files are **prepended to every task's inputs** instead of being folded into the global hash — tasks can opt out of specific global inputs using negation globs157158```json159{160"futureFlags": { "globalConfiguration": true },161"global": {162"inputs": ["tsconfig.json", ".env"],163"env": ["CI", "NODE_ENV"],164"passThroughEnv": ["AWS_SECRET_KEY"],165"ui": "tui",166"envMode": "strict",167"cacheDir": ".turbo/cache",168"remoteCache": { "enabled": true },169"concurrency": "50%"170},171"tasks": {172"build": {173"dependsOn": ["^build"],174"outputs": ["dist/**"]175}176}177}178```179180**Key rename mapping:**181182| Old (top-level) | New (`global.`) |183| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |184| `globalDependencies` | `inputs` |185| `globalEnv` | `env` |186| `globalPassThroughEnv` | `passThroughEnv` |187| `ui`, `envMode`, `cacheDir`, `daemon`, `concurrency`, `noUpdateNotifier`, `dangerouslyDisablePackageManagerCheck`, `remoteCache` | Same names under `global` |188189**Behavior change for `global.inputs`:**190191With `globalDependencies` (old): files are hashed into the **global hash**, which is embedded in every task's cache key. Changing any of these files invalidates all tasks — there is no opt-out.192193With `global.inputs` (new): files are treated as **implicit task inputs** prepended to each task's `inputs` globs. This means:194195- Tasks can exclude specific global files: `"inputs": ["$TURBO_DEFAULT$", "!$TURBO_ROOT$/tsconfig.json"]`196- The global hash no longer includes these file hashes (it still includes lockfile, engines, global env, etc.)197- Tasks with no explicit `inputs` still hash all package files plus the global inputs198199See the [gotchas doc](./gotchas.md) for guidance on using `$TURBO_DEFAULT$` with `global.inputs`.200201## noUpdateNotifier202203Disable update notifications when new turbo versions are available.204205```json206{207"noUpdateNotifier": true208}209```210211## dangerouslyDisablePackageManagerCheck212213Bypass the `packageManager` field requirement. Use for incremental migration.214215```json216{217"dangerouslyDisablePackageManagerCheck": true218}219```220221**Warning**: Unstable lockfiles can cause unpredictable behavior.222223## Git Worktree Cache Sharing224225When working in Git worktrees, Turborepo automatically shares local cache between the main worktree and linked worktrees.226227**How it works:**228229- Detects worktree configuration230- Redirects cache to main worktree's `.turbo/cache`231- Works alongside Remote Cache232233**Benefits:**234235- Cache hits across branches236- Reduced disk usage237- Faster branch switching238239**Disabled by**: Setting explicit `cacheDir` in turbo.json.240