Skip to main content

Turborepo

Turborepo Setup

Configure DxCore to parallelize Turborepo monorepo tasks.

Note

DxCore is not affiliated with, endorsed by, or sponsored by Vercel, Inc. Turborepo is a trademark of Vercel, Inc. See Trademarks & Attribution.

Prerequisites

  • A Turborepo monorepo with a turbo.json configuration
  • The dxcore binary installed
  • Access to a DxCore coordinator

How It Works

The Turborepo adapter uses turbo run <task> --dry=json to extract the full task graph. This gives DxCore the complete DAG including task hashes, cache status, dependencies, and package names.

When an agent executes a task, it runs npx turbo run <task> --filter=<package> for the assigned package.

Producing the Task Graph

Pipe the dry-run output directly to the dispatcher:

turbo run build test --dry=json | dxcore dispatch \
-c $COORDINATOR_URL -s $SESSION_ID -t $TOKEN -b turbo

The --dry=json flag is critical — it outputs the graph without executing anything.

Important

Always pass -b turbo to both the dispatcher and agents so the correct adapter is used for parsing and execution.

Agent Execution

Each agent must have the repository checked out and dependencies installed. When the coordinator assigns a task, the agent runs:

npx turbo run <task> --filter=<package>

Turborepo’s own caching still works — if a task has a remote cache hit, the agent completes it instantly.

Shard Configuration

For long-running tasks, add a dxcore.json in the relevant package directory:

{
"shards": {
"test": 4
}
}

This splits the test task for that package into 4 parallel shards. See Shard Configuration for details.

Next Steps