Skip to content

Turbo.json Discovery

If you use Turborepo, devmux can automatically discover your services from turbo.json.

Terminal window
devmux discover turbo

This reads your turbo.json and generates a devmux.config.json.

devmux looks for:

  1. Tasks named dev in your turbo.json
  2. Packages that have those tasks defined
  3. Port configurations from package.json scripts

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/api with "dev": "wrangler dev --port 8787"
  • apps/web with "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
}
}
}

devmux tries to detect ports from your package.json scripts:

PatternDetected Port
--port 30003000
-p 80808080
:30003000
PORT=40004000

If no port is detected, the service is still added but without a port health check.

Only discover specific packages:

Terminal window
devmux discover turbo --filter "apps/*"

Look for a different task name:

Terminal window
devmux discover turbo --task "serve"

Preview without writing:

Terminal window
devmux discover turbo --dry-run
  1. Review the generated config

    Open devmux.config.json and verify:

    • Service names make sense
    • Ports are correct
    • Paths are correct
  2. Add missing ports

    If a port wasn’t detected, add it manually:

    {
    "worker": {
    "command": "pnpm dev",
    "cwd": "./apps/worker",
    "port": 9000
    }
    }
  3. Test it

    Terminal window
    devmux ensure api
    devmux status

For complex setups, you may need to manually adjust the generated config.

Discovery is non-destructive by default. If devmux.config.json exists:

Terminal window
# Overwrites existing config
devmux discover turbo --force
# Merges with existing config
devmux discover turbo --merge

devmux auto-detects your workspace root by looking for:

  1. turbo.json
  2. pnpm-workspace.yaml
  3. package.json with workspaces field

The project name is inferred from your root package.json name.