Generic JSON
Generic JSON Setup
Configure DxCore to parallelize any task graph using the generic JSON adapter.
Prerequisites
- A task graph described as JSON in DxCore’s generic format
- The
dxcorebinary installed - Access to a DxCore coordinator
How It Works
The generic JSON adapter is the “escape hatch” for any build system or workflow that can be described as a directed acyclic graph (DAG) with explicit shell commands. Unlike the Turborepo, Nx, Gradle, or Docker adapters, the generic adapter does not integrate with a specific build tool — you provide the full task graph yourself.
DxCore reads your JSON, schedules tasks respecting dependency order, and distributes them across agents for parallel execution.
Producing the Task Graph
Write a JSON file with a tasks array. Each task needs four required fields (taskId, package, task, command) and an optional dependencies array:
{
"tasks": [
{
"taskId": "lint",
"package": "app",
"task": "lint",
"command": "npm run lint",
"dependencies": []
},
{
"taskId": "test",
"package": "app",
"task": "test",
"command": "npm test",
"dependencies": ["lint"]
}
]
}
Pipe the JSON to the dispatcher:
cat graph.json | dxcore dispatch \
-c $COORDINATOR_URL -s $SESSION_ID -t $TOKEN -b generic
Important
Always pass -b generic to both the dispatcher and agents so the correct adapter is used for parsing and execution.
Agent Execution
Each agent must have the tools referenced by your commands available in its environment. When the coordinator assigns a task, the agent runs the command field directly — for example, npm test is split into the executable npm and argument test.
No build tool wrapper is involved. The command you specify is exactly what runs.
No Caching or Hashing
The generic adapter does not compute task hashes or track cache status. Every task has an empty hash and a cache status of MISS, meaning every task runs on every invocation. If you need caching, handle it within your commands (e.g., by checking for cached artifacts before doing work).