Agent Skills › coder/xum › dev-server-sandbox

dev-server-sandbox

GitHub

提供运行多个隔离开发服务器实例的机制,通过创建临时环境、分配端口及配置种子,支持并行调试与多工作区开发。

.mux/skills/dev-server-sandbox/SKILL.md coder/mux

Trigger Scenarios

需要并行启动多个开发服务器实例 在多git worktree环境下隔离运行后端服务

Install

npx skills add coder/mux --skill dev-server-sandbox -g -y
More Options

Non-standard path

npx skills add https://github.com/coder/mux/tree/main/.mux/skills/dev-server-sandbox -g -y

Use without installing

npx skills use coder/mux@dev-server-sandbox

指定 Agent (Claude Code)

npx skills add coder/mux --skill dev-server-sandbox -a claude-code -g -y

安装 repo 全部 skill

npx skills add coder/mux --all -g -y

预览 repo 内 skill

npx skills add coder/mux --list

SKILL.md

Frontmatter
{
    "name": "dev-server-sandbox",
    "description": "Run multiple isolated mux dev-server instances (temp MUX_ROOT + free ports)"
}

dev-server sandbox instances

make dev-server starts the mux backend server, which uses a lockfile at:

  • <MUX_ROOT>/server.lock (defaults to ~/.mux-dev/server.lock in development)

This means you can only run one dev server per mux root directory.

This skill documents the repo workflow for starting multiple dev-server instances in parallel (including from different git worktrees) by giving each instance its own temporary MUX_ROOT.

Quick start

make dev-server-sandbox

What it does

  • Creates a fresh temporary MUX_ROOT directory
  • Copies these files into the sandbox if present (unless disabled by flags):
    • providers.jsonc (provider config)
    • config.json (project list)
    • Each file is seeded independently from the first root that has it ($MUX_ROOT, then ~/.mux-dev, then ~/.mux), so a root with only config.json doesn't drop provider config
  • Provider credential env vars are stripped from the server's env when they could silently override or mismatch the intended setup: all of them with --clean-providers (including Bedrock's AWS_REGION and AWS_BEARER_TOKEN_BEDROCK; shared AWS credentials like AWS_PROFILE are kept); otherwise only *_BASE_URL env vars that would shadow a seeded providers.jsonc entry that has an apiKey but no explicit baseUrl (API key env vars are always kept so env-key fallback still works)
  • Picks free ports (BACKEND_PORT, VITE_PORT)
  • Disables tutorials by default inside the sandbox (MUX_ENABLE_TUTORIALS_IN_SANDBOX=1 opts back in)
  • Allows all hosts (VITE_ALLOWED_HOSTS=all) so it works behind port-forwarding domains
  • Runs make dev-server with those env overrides

Agent usage with bash.monitor

When you need the sandbox to keep running while you continue or end the turn, start it as a monitored background bash. The monitor wakes the workspace on useful server output; call task_await only if you need surrounding logs.

bash({
  script: "make dev-server-sandbox",
  display_name: "Dev Server Sandbox",
  run_in_background: true,
  timeout_secs: 1800,
  monitor: {
    filter: "ready|listening|localhost|ERROR|EADDRINUSE|failed|Failed",
    cooldown_ms: 1000,
    max_events: 3,
  },
});

Use this for line-oriented server readiness/errors. For external status polling (PR checks, deployment health, remote CI), use a background task/workflow monitor instead.

Options

# Start with a clean instance (do not copy providers or projects)
make dev-server-sandbox DEV_SERVER_SANDBOX_ARGS="--clean-providers --clean-projects"

# Skip copying providers.jsonc
make dev-server-sandbox DEV_SERVER_SANDBOX_ARGS="--clean-providers"

# Clear projects from config.json (preserves other config)
make dev-server-sandbox DEV_SERVER_SANDBOX_ARGS="--clean-projects"

# Use a specific root to seed from (default: per-file from $MUX_ROOT, ~/.mux-dev, ~/.mux)
SEED_MUX_ROOT=~/.mux-dev make dev-server-sandbox

# Keep the sandbox root directory after exit (useful for debugging)
KEEP_SANDBOX=1 make dev-server-sandbox

# Pin ports (must be different)
BACKEND_PORT=3001 VITE_PORT=5174 make dev-server-sandbox

# Re-enable tutorials for sandbox dogfooding
MUX_ENABLE_TUTORIALS_IN_SANDBOX=1 make dev-server-sandbox

# Override which make binary to use
MAKE=gmake make dev-server-sandbox

Security notes

  • providers.jsonc may contain API keys.
  • The sandbox root directory is created on disk (usually under your system temp dir).
  • This flow intentionally does not copy secrets.json.

Version History

  • ac87089 Current 2026-08-20 09:55

Same Skill Collection

.agents/skills/dogfood/SKILL.md
.mux/skills/deep-review/SKILL.md
.mux/skills/dev-desktop-sandbox/SKILL.md
.mux/skills/generate-readme-screenshots/SKILL.md
.mux/skills/pull-requests/SKILL.md
.mux/skills/react-effects/SKILL.md
.mux/skills/tbench/SKILL.md
.mux/skills/tests/SKILL.md
.xum/skills/bug-bash/SKILL.md
.xum/skills/crap-gate/SKILL.md
.xum/skills/deep-review/SKILL.md
.xum/skills/dev-desktop-sandbox/SKILL.md
.xum/skills/dev-server-sandbox/SKILL.md
.xum/skills/generate-readme-screenshots/SKILL.md
.xum/skills/pull-requests/SKILL.md
.xum/skills/react-effects/SKILL.md
.xum/skills/tbench/SKILL.md
.xum/skills/tests/SKILL.md
.agents/skills/electron/SKILL.md

Metadata

Files
0
Version
ac87089
Hash
2c40776c
Indexed
2026-08-20 09:55

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-31 03:25
浙ICP备14020137号-1