unity-cli

Automates Unity Editor lifecycle, headless tests, batch runs, and builds via the official Unity CLI.

Updated Oct 13, 2025
One-click install
npx skills add https://github.com/Darth-Carrotpie/ProxyCore --skill unity-cli-darth-carrotpie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: unity-cli
Source: https://github.com/Darth-Carrotpie/ProxyCore/tree/main/.agents/skills/unity-skills/skills/unity-cli
Command: npx skills add https://github.com/Darth-Carrotpie/ProxyCore --skill unity-cli-darth-carrotpie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When the Unity Editor is closed, REST-based automation cannot reach the project, leaving agents unable to start the editor, run tests, execute batch methods, or produce builds. This Skill provides advisory guidance for driving the experimental official Unity CLI against a project that has been explicitly bound in the UnitySkills panel, covering the full editor-closed lifecycle. ## Core Features & Use Cases - Cold start and liveness triage: Launch a bound project with the -unityskills-coldstart marker so the REST server force-starts, and diagnose editor state via the UnitySkills registry before retrying. - Headless tests and batch runs: Execute EditMode/PlayMode tests with NUnit XML output and timeouts, or run one-shot -executeMethod batch automation while the editor is closed. - Headless builds: Invoke project-defined static build methods with target, output path, versioning, and dirty-worktree guards. - Use Case: A CI-style workflow needs a full regression run overnight: the agent verifies cli_config.json is enabled, confirms the editor version is installed, runs unity test with a timeout and JSON output, and reports failures from exit code 6. ## Quick Start Check that Library/UnitySkills/cli_config.json exists with enabled:true, then ask the agent to cold-start the bound Unity project and run its EditMode tests headlessly with a timeout.

Frequently Asked Questions about unity-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Unity tests headlessly from the command line?▼

Use the Unity CLI test command with the project path, --mode EditMode or PlayMode, --output for NUnit XML, and --timeout for unattended runs. Exit code 0 means all passed, 6 means some tests failed, and other non-zero codes indicate the command itself failed.

How to cold start a Unity project without Unity Hub?▼

Run the CLI open command with the project path and pass --args -unityskills-coldstart so the UnitySkills plugin force-starts its REST server. First verify the required editor version is installed with the editors -i command, and never open a project whose editor is already running.

When is the Unity CLI allowed for a project?▼

Only when the project's own Library/UnitySkills/cli_config.json exists with enabled:true, and each feature (coldStart, openArgs, cliTest, cliRun, cliBuild) is individually switched on. The global registry is for liveness checks only and never authorizes CLI use.

Can I run Unity CLI commands while the editor is open?▼

No. Unity refuses a second instance on the same project due to the Library/UnityLockfile. When the editor is running, all operations including tests and scene changes must go through the UnitySkills REST skills instead of the CLI.

Why does unity status show no running editor instances?▼

The status command only lists editors visible through the Unity Pipeline package, so a running editor without that package shows nothing. Check the UnitySkills registry for a live pid matching the project path before assuming the editor is closed.

What are the limitations of Unity CLI headless builds?▼

Builds require both --target and --execute-method pointing to an existing static build method in the project, since Unity has no built-in command-line build. The CLI also refuses to build with uncommitted changes unless --allow-dirty-build is explicitly passed.