unity-cli

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

2|Updated May 18, 2026
One-click install
npx skills add https://github.com/pcone-mm/NewFPG --skill unity-cli-pcone-mm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-cli
Source: https://github.com/pcone-mm/NewFPG/tree/main/.agents/skills/unity-skills/skills/unity-cli
Command: npx skills add https://github.com/pcone-mm/NewFPG --skill unity-cli-pcone-mm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unity Editor automation normally requires the editor to be running and reachable through the UnitySkills REST server, leaving no way to start a closed project, run CI-style headless tests, or execute one-shot batch tasks. This Skill provides advisory guidance for driving the experimental official Unity CLI against a project that has been explicitly bound in the UnitySkills panel. ## Core Features & Use Cases - Cold Start & Liveness: Launch a bound project without Unity Hub using open --args -unityskills-coldstart, triage editor liveness via the UnitySkills registry, and poll REST health until ready. - Headless Tests & 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: Build with a required --target and --execute-method, dirty-worktree protection, and structured JSON output for scripting. - Use Case: A CI pipeline needs a full regression run overnight: check cli_config.json is enabled, run unity test --mode EditMode --format json --non-interactive, and parse the NUnit XML report for failures. ## Quick Start Check that Library/UnitySkills/cli_config.json exists with enabled:true, then ask the AI to cold-start the bound Unity project and run its EditMode tests headlessly with JSON output.

Frequently Asked Questions about unity-cli

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

FAQPage Schema
How do I start a Unity project from the command line without Unity Hub?

Use the Unity CLI open command with the project path and pass --args -unityskills-coldstart so the UnitySkills plugin force-starts its REST server. First verify the project's cli_config.json has enabled:true and the required editor version is installed via the editors command.

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

Run the CLI test command with the project path, --mode EditMode or PlayMode, an optional --filter, --output for the NUnit XML report, and a --timeout. Exit code 0 means all tests passed, while exit code 6 means tests ran but at least one failed.

When should I use the Unity CLI versus the UnitySkills REST API?

Use the CLI only when the editor is closed: cold starts, full headless test runs, batch automation, and builds. Once the REST health endpoint responds, all interactive operations like scene edits and quick test iterations go through REST skills, never the CLI.

Can I run the Unity CLI on any Unity project?

No. The CLI workflow only applies to projects explicitly bound in the UnitySkills panel, meaning Library/UnitySkills/cli_config.json exists with enabled:true. Each feature (cold start, tests, run, build) also has its own per-project switch in that config.

Why does the Unity CLI build command refuse to run?

The build command refuses to run with uncommitted changes as a dirty-worktree guard, and it requires both --target and --execute-method pointing to an existing static build method in the project. Only pass --allow-dirty-build when the user explicitly requests it.

Why does unity status show no running editor instances?

The status command only lists editors visible to the CLI, which requires the Unity Pipeline package in the project, so an empty result does not prove the editor is closed. Check the UnitySkills registry at ~/.unity_skills/registry.json for a live pid instead.