unity-cli

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

1.7k|162|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/Besty0728/Unity-Skills --skill unity-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-cli
Source: https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/unity-cli
Command: npx skills add https://github.com/Besty0728/Unity-Skills --skill unity-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When the Unity Editor is closed, REST-based automation cannot reach the project. This Skill guides AI agents in using the experimental Unity CLI to cold-start the bound Unity project, run headless tests, execute one-shot batch methods, and produce builds without opening the editor manually.

Core Features & Use Cases

  • Cold Start & Lifecycle: Launch the bound Unity project with the -unityskills-coldstart marker so the REST server starts automatically, with liveness triage via registry, lockfile, and CLI process checks.
  • Headless Tests & Batch Runs: Run EditMode/PlayMode tests with NUnit XML output and timeouts, or execute one-shot -executeMethod batch automation while the editor is closed.
  • Headless Builds: Build via Unity 6 Build Profiles, built-in desktop targets, or custom C# build methods, with structured JSON/NDJSON output and defined exit codes.
  • Use Case: In a CI pipeline, cold-start a Unity project, run the full EditMode and PlayMode test suites headlessly, then produce a Windows build — all without human interaction with the editor.

Quick Start

Check the project's Library/UnitySkills/cli_config.json to confirm the Unity CLI is enabled, then use the configured cliPath to cold-start the project and wait for the REST health endpoint to respond.

Frequently Asked Questions about unity-cli

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

FAQPage Schema
How do I cold-start a Unity project from the command line?

Use the Unity CLI's 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 set to true and the required editor version is installed.

How to run Unity tests headlessly in CI?

Run the CLI test command with --mode EditMode or PlayMode, a --filter pattern, --output for the NUnit XML report, and a --timeout. Exit code 0 means all tests passed, while 6 indicates test failures or abnormal editor exit.

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

No. Unity refuses a second instance on the same project due to the Library/UnityLockfile. When the editor is running, use the UnitySkills REST skills instead; the CLI is only for closed-editor lifecycle operations.

Why does the Unity CLI fail to start on older Linux distributions?

Starting with beta4, the Unity CLI requires glibc 2.34 or newer, so it fails on Ubuntu 20.04, Debian 11, RHEL/CentOS 8, and Amazon Linux 2. This is a compatibility constraint, not a missing installation, so reinstalling will not fix it.

What are the limitations of Unity CLI headless builds?

Builds only work on the bound project with the editor closed, and the build command refuses to run with uncommitted changes unless --allow-dirty-build is passed. Mobile and WebGL targets require a custom static C# build method via --execute-method.