Nx
Nx Setup
Configure DxCore to parallelize Nx monorepo tasks.
Note
DxCore is not affiliated with, endorsed by, or sponsored by Narwhal Technologies, Inc. (Nrwl). Nx is a trademark of Narwhal Technologies, Inc. See Trademarks & Attribution.
Tip
Nx provides a native task distribution feature — Distribute Task Execution. Check whether it meets your needs before using DxCore’s Nx adapter.
⚠️ Experimental: Nx support is experimental. APIs and behavior may change without notice.
Prerequisites
- An Nx workspace with project dependencies configured
- The
dxcorebinary installed - Access to a DxCore coordinator
How It Works
The Nx adapter expects Nx’s task graph JSON piped to stdin. Use nx run-many with --graph=stdout to produce the task graph — this includes per-task metadata like dependency edges and cache configuration. DxCore parses the graph to discover tasks, packages, dependencies, and cacheable flags.
When an agent executes a task, it runs npx nx run <package>:<task> for the assigned work item.
Producing the Task Graph
Pipe the Nx task graph output directly to the dispatcher:
nx run-many --targets=build,test --graph=stdout | dxcore dispatch \
-c $COORDINATOR_URL -s $SESSION_ID -t $TOKEN -b nx
Warning
Use nx run-many --graph=stdout, not nx graph --file=stdout. The nx graph command only outputs the project dependency graph (no tasks). The nx run-many --graph=stdout command outputs the full task graph including per-task cache booleans that DxCore uses for smart scheduling.
Important
Always pass -b nx to both the dispatcher and agents so the correct adapter is used.
Agent Execution
Each agent must have the repository checked out with dependencies installed. When assigned a task, the agent runs:
npx nx run <package>:<task>
Limitations
Compared to the Turborepo adapter, the Nx adapter has some limitations at plan time:
| Feature | Turborepo | Nx |
|---|---|---|
| Task hashes | Yes | No |
| Cache status | Yes | No |
| Dependencies | Yes | Yes |
| Package names | Yes | Yes |
Note
DxCore does not provide its own caching. Nx’s computation cache (local or Nx Cloud) operates independently at execution time — DxCore does not interfere with it and does not have visibility into cache status at plan time.