Turbo.json Discovery
If you use Turborepo, devmux can automatically discover your services from turbo.json.
Quick Start
Section titled “Quick Start”devmux discover turboThis reads your turbo.json and generates a devmux.config.json.
How It Works
Section titled “How It Works”devmux looks for:
- Tasks named
devin yourturbo.json - Packages that have those tasks defined
- Port configurations from package.json scripts
Example
Section titled “Example”Given this turbo.json:
{ "$schema": "https://turbo.build/schema.json", "tasks": { "dev": { "cache": false, "persistent": true }, "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] } }}And these packages:
apps/apiwith"dev": "wrangler dev --port 8787"apps/webwith"dev": "next dev --port 3000"
Running devmux discover turbo generates:
{ "project": "myapp", "services": { "api": { "command": "pnpm dev", "cwd": "./apps/api", "port": 8787 }, "web": { "command": "pnpm dev", "cwd": "./apps/web", "port": 3000 } }}Port Detection
Section titled “Port Detection”devmux tries to detect ports from your package.json scripts:
| Pattern | Detected Port |
|---|---|
--port 3000 | 3000 |
-p 8080 | 8080 |
:3000 | 3000 |
PORT=4000 | 4000 |
If no port is detected, the service is still added but without a port health check.
Customizing Discovery
Section titled “Customizing Discovery”Filter by Package
Section titled “Filter by Package”Only discover specific packages:
devmux discover turbo --filter "apps/*"Custom Task Name
Section titled “Custom Task Name”Look for a different task name:
devmux discover turbo --task "serve"Dry Run
Section titled “Dry Run”Preview without writing:
devmux discover turbo --dry-runAfter Discovery
Section titled “After Discovery”-
Review the generated config
Open
devmux.config.jsonand verify:- Service names make sense
- Ports are correct
- Paths are correct
-
Add missing ports
If a port wasn’t detected, add it manually:
{"worker": {"command": "pnpm dev","cwd": "./apps/worker","port": 9000}} -
Test it
Terminal window devmux ensure apidevmux status
Limitations
Section titled “Limitations”For complex setups, you may need to manually adjust the generated config.
Re-running Discovery
Section titled “Re-running Discovery”Discovery is non-destructive by default. If devmux.config.json exists:
# Overwrites existing configdevmux discover turbo --force
# Merges with existing configdevmux discover turbo --mergeWorkspace Detection
Section titled “Workspace Detection”devmux auto-detects your workspace root by looking for:
turbo.jsonpnpm-workspace.yamlpackage.jsonwithworkspacesfield
The project name is inferred from your root package.json name.