facepunch/sbox-public/sbox-cli
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Drives a running s&box editor or game through sbox-cli, the engine's MCP bridge, to inspect and edit scenes, prefabs, assets and Hammer maps, run C# inside the engine, check compile results, enter play mode and take screenshots. Use when working in an s&box project (a folder with a .sbproj file), when asked to do anything in the s&box editor, or when asked to launch, attach to or automate s&box.
Install
npx vskill@latest install facepunch/sbox-public/sbox-cliSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
sbox-cli
sbox-cli ships with every s&box installation. It connects to a running editor or game over a local named pipe and gives you its live tools: the scene hierarchy, components, assets, Hammer maps, play mode, the console, and arbitrary C# run inside the process.
When an editor has the project open, work through it instead of hand-editing scene, prefab or asset files. The editor validates changes, records undo for its scene tools, recompiles code and shows you what actually happened. Hand-edited .scene/.prefab JSON is easy to get subtly wrong.
Everything runs locally, as the current user, against the user's own editor. There is no network listener and no port to configure.
1. Find sbox-cli
It is <engine>/bin/managed/sbox-cli.exe, where <engine> is the folder containing sbox.exe:
- The
FACEPUNCH_ENGINEenvironment variable. The launcher sets it as a Windows user
variable, so a shell started before that may lack it — check the user scope too ([Environment]::GetEnvironmentVariable('FACEPUNCH_ENGINE','User')).
- The default Steam folder,
C:\Program Files (x86)\Steam\steamapps\common\sbox. - The folder of a running
sbox-dev.exe. - Ask the user.
Don't hard-code the result into project files; it differs per machine.
2. Use it
Run it from the project folder (or any folder inside it). It finds the .sbproj there and talks to the editor that has that project open — never to another project's editor. Outside any project it uses the only running instance. --connect <pid|project> picks one explicitly; --list shows what's running.
One call at a time
--call <tool> [json-arguments] connects, calls one tool, prints the result and disconnects; the editor keeps running. Structured results print as JSON, text as-is, and images (screenshots) are saved to files whose paths are printed. Exit 0 = success, 2 = the tool reported an error (message on stderr), 1 = couldn't connect or bad arguments.
Each call is a fresh connection, so batch related calls with call_tools. Pass long or quote-heavy input through a file (run_csharp takes path). Windows PowerShell 5.1 strips double quotes from native arguments — escape them ('{\"query\":\"scene\"}') or use pwsh/bash.
As an MCP server
For a long session, register it with the client so tools appear natively over one connection:
The client's working directory picks the project, as above. With --connect the server fails to start if that project's editor isn't open. --project instead attaches to the open editor or, if there is none, opens one that the server owns — it closes, discarding unsaved work, when the client disconnects. Restart the client's server after the editor restarts.
Lifetimes
| Command | Does | When the CLI exits | ||
|---|---|---|---|---|
| `--connect [pid\ | project]` | Attaches to a running editor, or a game started with -mcp | Instance keeps running | |
--call <tool> [json] | Attaches (like --connect), one call | Instance keeps running | ||
--project [project] | Attaches to the project's open editor, else opens one | Closes only an editor it opened | ||
| `--game <project\ | org.ident>` | Starts a game | Game closes |
Editors accept connections unless Project Settings > AI > Enable MCP Communication is off. If the user has the project open, attach to it — never launch a second copy.
New projects
Don't write a .sbproj by hand. Create the project from a template, the same way the launcher does, then open it:
--new makes a folder named after the project's ident (my_game) and prints the .sbproj path. Without --template it uses the launcher's default; without --in, the current directory.
3. Work loop
- Orient. Call
editor_status(editor) orinstance_status(game). Confirm the project, the
active scene, whether it has unsaved changes, play state and compile state.
- Discover. Only a handful of entry points are in
tools/list. The real tools are registered
by editor and addon code and change as code hotloads. Find them with search_tools (every keyword must match) or list_toolsets → describe_toolset, then invoke them by name or through call_tool. Use the returned input schema; don't guess arguments. A catalog of what usually exists is in references/tools.md.
- Act. Prefer the dedicated tools (
scene,asset,hammer,play,uitoolsets).
Fall back to run_csharp for anything they don't cover — see references/run-csharp.md.
- Verify.
read_consoleshows what the engine logged (pass back its cursor assinceto see
only new output). Tool failures come back as errors explaining what to do instead — read them and adapt. Use screenshots for anything visual.
- After editing C#: saving triggers compile and hotload. Poll
editor_statusuntil
IsCompiling is false, then check LastCompileSucceeded / LastCompileErrors, and compile_status for the diagnostics. Re-run search_tools if you changed tool code.
- Save the scene if you changed it and the user expects it on disk (
save_scene).
Check engine APIs in the XML docs beside the CLI — Sandbox.Engine.xml (game code) and Sandbox.Tools.xml (editor code) — or in existing project code. s&box is not Unity; Unity APIs guessed from memory will not compile.
Conventions
- Vectors and angles are comma strings:
"x,y,z","pitch,yaw,roll"— not arrays or objects. - Source engine coordinates: 1 unit = 1 inch, +X forward, +Y left, +Z up, angles in degrees.
- Game objects and components are identified by GUID; assets by the relative path that
asset_search returns (models/chair.vmdl).
- Paging is
limit/offset; out-of-range values clamp. - Hammer maps (
.vmap) are not scenes. Scene tools can't see map contents; usehammer_*tools.
Things that bite
- Edited scene vs. running scene. In play mode
Game.ActiveSceneis the runtime copy; changes
there vanish when play stops. editor_status reports the scene being edited.
- Undo. Editor scene tools document their undo behavior.
run_csharp, runtime tools and console
commands mutate live state with no undo.
- Timeouts and retries. If a mutation times out or the connection drops, inspect the current
state before retrying — the work may have completed. A call that waits more than 30 s for the main thread (modal dialog, long operation) is cancelled and reported as the editor being blocked.
- Can't connect. Nothing in
--listmeans no editor or game is running, MCP is disabled in
Project Settings > AI, the game wasn't started with -mcp, or the engine build predates the pipe. Engine startup logs are in <engine>/logs.
- Generated files. The
.slnx/.csprojfiles are generated by the editor. Edit source files
and .sbproj settings, not the generated projects.
References
| Topic | File | |
|---|---|---|
| Raw protocol for MCP clients and programs: handshake, framing, results, timeouts, limits, exchange directory | references/protocol.md | |
| Built-in entry points and the usual toolsets (scene, asset, hammer, play, ui, network…) | references/tools.md | |
run_csharp: what's in scope, script files, cancellation, examples | references/run-csharp.md | |
| s&box project layout, compile/hotload loop, validating changes | references/project.md | |
Adding your own MCP tools to a project or addon ([McpTool]) | references/authoring-tools.md |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingengine/Launcher/SboxCli/skills/sbox-cli/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/facepunch/sbox-public/sbox-cli)