High-performance build system for JavaScript and TypeScript codebases with intelligent caching and task scheduling.
npx @tessl/cli install tessl/npm-turbo@2.5.00
# Turbo
1
2
Turbo is a high-performance build system for JavaScript and TypeScript codebases that dramatically speeds up development workflows in monorepos. Built in Rust for optimal performance, it provides intelligent caching, task scheduling, and incremental builds through advanced dependency graph analysis, remote caching capabilities, and parallel task execution.
3
4
## Package Information
5
6
- **Package Name**: turbo
7
- **Package Type**: npm
8
- **Language**: CLI tool (Rust binary distributed via npm)
9
- **Installation**: `npm install -g turbo` or `npm install --save-dev turbo`
10
11
## Core Imports
12
13
Since Turbo is a CLI tool, there are no traditional imports. Instead, you use the globally installed binary:
14
15
```bash
16
# Global installation
17
npm install -g turbo
18
turbo --help
19
20
# Local installation (recommended)
21
npm install --save-dev turbo
22
npx turbo --help
23
```
24
25
For package.json scripts:
26
27
```json
28
{
29
"scripts": {
30
"build": "turbo run build",
31
"test": "turbo run test",
32
"dev": "turbo run dev --parallel"
33
}
34
}
35
```
36
37
## Basic Usage
38
39
```bash
40
# Initialize in a new project
41
cd my-monorepo
42
turbo run build
43
44
# Run multiple tasks with dependencies
45
turbo run build test lint --parallel
46
47
# Run tasks only for changed packages
48
turbo run build --filter="...@myorg/changed-package"
49
50
# Generate task execution graph
51
turbo run build --graph=graph.html
52
```
53
54
## Architecture
55
56
Turbo is built around several key components:
57
58
- **Task Execution Engine**: Schedules and executes tasks based on dependency graphs with intelligent parallelization
59
- **Caching System**: Local and remote caching with content-based hashing for maximum cache hit rates
60
- **Dependency Analysis**: Analyzes package relationships and task dependencies for optimal execution order
61
- **Configuration Management**: Centralized configuration via `turbo.json` with workspace-specific overrides
62
- **Remote Caching Integration**: Integration with Vercel's remote cache infrastructure for team collaboration
63
- **Daemon Process**: Optional background process for improved performance through persistent analysis
64
65
## Capabilities
66
67
### Task Execution
68
69
Core task execution functionality for running scripts across monorepo packages with intelligent scheduling and dependency management.
70
71
```bash { .api }
72
turbo run <tasks...> [options]
73
turbo <tasks...> [options] # shorthand
74
```
75
76
[Task Execution](./task-execution.md)
77
78
### Package Management
79
80
Tools for analyzing, filtering, and managing packages within your monorepo structure.
81
82
```bash { .api }
83
turbo ls [packages...] [options]
84
turbo prune <scope> [options]
85
```
86
87
[Package Management](./package-management.md)
88
89
### Caching & Performance
90
91
Local and remote caching configuration with performance profiling and analysis tools.
92
93
```bash { .api }
94
turbo run <tasks> --cache=<config>
95
turbo run <tasks> --profile=<file>
96
```
97
98
[Caching & Performance](./caching-performance.md)
99
100
### Remote Cache Integration
101
102
Authentication and linking with Vercel's remote cache infrastructure for team collaboration.
103
104
```bash { .api }
105
turbo login [options]
106
turbo link [options]
107
turbo logout [options]
108
turbo unlink [options]
109
```
110
111
[Remote Cache Integration](./remote-cache.md)
112
113
### Code Generation
114
115
Tools for generating new packages, applications, and workspace components with customizable templates.
116
117
```bash { .api }
118
turbo generate [generator] [options]
119
turbo gen workspace [options]
120
```
121
122
[Code Generation](./code-generation.md)
123
124
### System Management
125
126
Daemon management, system information, and debugging utilities for maintaining optimal Turbo performance.
127
128
```bash { .api }
129
turbo daemon [command] [options]
130
turbo info
131
turbo scan
132
```
133
134
[System Management](./system-management.md)
135
136
### Utilities
137
138
Additional utilities for shell completion, GraphQL querying, workspace analysis, and watch mode execution.
139
140
```bash { .api }
141
turbo bin
142
turbo completion <shell>
143
turbo query [query] [options]
144
turbo telemetry [command]
145
turbo watch <tasks...> [options]
146
```
147
148
## Global Options
149
150
```bash { .api }
151
# Version and help
152
--version # Show version information
153
--help # Show help information
154
155
# Environment configuration
156
--cwd <path> # Set working directory
157
--color / --no-color # Control color output
158
--ui <mode> # Set UI mode (stream|tui|web)
159
160
# API and authentication
161
--api <url> # Override API endpoint
162
--token <token> # Set authentication token
163
--team <slug> # Set team slug
164
--login <url> # Override login endpoint
165
166
# Performance and debugging
167
--verbosity <level> / -v # Set verbosity level
168
--trace <file> # Save performance trace
169
--heap <file> # Save heap profile
170
--remote-cache-timeout <seconds> # Set HTTP timeout
171
172
# Advanced options
173
--skip-infer # Skip version inference
174
--no-update-notifier # Disable update notifications
175
--preflight # Enable OPTIONS preflight requests
176
--dangerously-disable-package-manager-check # Allow missing packageManager
177
--root-turbo-json <path> # Custom turbo.json path
178
```
179
180
## Configuration Types
181
182
```typescript { .api }
183
interface TurboConfig {
184
$schema?: string;
185
tasks: Record<string, TaskConfig>;
186
globalDependencies?: string[];
187
globalEnv?: string[];
188
globalPassThroughEnv?: string[] | null;
189
remoteCache?: RemoteCacheConfig;
190
ui?: "stream" | "tui" | "web";
191
concurrency?: string;
192
dangerouslyDisablePackageManagerCheck?: boolean;
193
cacheDir?: string;
194
daemon?: boolean;
195
envMode?: "strict" | "loose";
196
boundaries?: BoundariesConfig;
197
}
198
199
interface TaskConfig {
200
dependsOn?: string[];
201
inputs?: string[];
202
outputs?: string[];
203
cache?: boolean;
204
env?: string[];
205
passThroughEnv?: string[];
206
outputLogs?: "full" | "none" | "hash-only" | "new-only" | "errors-only";
207
persistent?: boolean;
208
interactive?: boolean;
209
}
210
211
interface RemoteCacheConfig {
212
signature?: boolean;
213
enabled?: boolean;
214
timeout?: number;
215
}
216
217
interface BoundariesConfig {
218
include?: string[];
219
exclude?: string[];
220
}
221
```
222
223
## Exit Codes
224
225
```bash { .api }
226
0 # Success
227
1 # General error or task failure
228
```
229
230
## Environment Variables
231
232
```bash { .api }
233
TURBO_BINARY_PATH # Override turbo binary path
234
TURBO_INVOCATION_DIR # Invocation directory (internal)
235
TURBO_PRINT_VERSION_DISABLED # Disable version printing (1|true)
236
TEST_RUN # Enable test run mode
237
```