uloop-cli: Unity Editor CLI Companion
uloop-cli is a command-line interface (CLI) tool designed to communicate with the Unity Editor via the Unity CLI Loop (uLoopMCP) server. It enables external applications, particularly AI agents and Large Language Models (LLMs), to automate Unity operations such as compiling code, running tests, getting console logs, and controlling Play Mode. The current stable version is 2.0.3, released on April 22, 2026. The package maintains a rapid release cadence, with multiple bugfix releases often occurring on the same day following a major or minor update. Its key differentiator is facilitating direct, programmatic control of the Unity Editor through a standardized CLI, abstracting away the complexities of Unity's internal scripting for external tools and AI, enabling seamless integration for automated development workflows.
Common errors
-
Error: Unity project not found in current directory. Please specify --project-path.
cause The `uloop-cli` command was executed without `--project-path` and could not automatically detect a Unity project in the current working directory.fixRun the command again with `uloop <command> --project-path /path/to/your/unity/project`. -
Failed to connect to uLoopMCP server. Is Unity Editor running with uLoopMCP?
cause The Unity Editor is either not running, or the `uLoopMCP` package is not installed/running within the Unity project, preventing the CLI from establishing a connection.fixEnsure your Unity Editor is open, the correct Unity project is loaded, and the `uLoopMCP` server is active within the uLoopMCP Window in Unity. -
Unknown command: 'my-custom-skill'. Available commands: [compile, run-tests, ...]
cause The custom skill you are trying to invoke has not been properly defined or synced from the Unity project, or the CLI cannot detect it.fixVerify that your custom skill is correctly set up in your Unity project, that `uLoopMCP` is running, and try running `uloop sync --project-path /path/to/your/unity/project` to refresh the CLI's cached skill definitions.
Warnings
- breaking Version 2.0.0 introduced significant performance improvements for `execute-dynamic-code` (over 6x faster) and a revamped Setup Wizard. While this is a feature, it implies internal changes that might affect highly customized scripts or integrations that relied on previous wizard behavior or execution timing. Review the release notes for detailed behavioral changes.
- gotcha Running `uloop update` previously showed a deprecation warning, which was removed in v1.7.2. While not a breaking change, users might have encountered this warning and should be aware it's no longer present.
- gotcha When `--project-path` is omitted, `uloop-cli` attempts to detect the Unity project in the current directory. This can lead to unexpected behavior or incorrect project targeting if not executed from the desired Unity project root or if multiple projects are present.
- gotcha Early versions could produce 'Unity not running' errors or misleading editor availability errors even when Unity was open. These issues were addressed in versions like 1.7.1 and 1.7.3.
Install
-
npm install uloop-cli -
yarn add uloop-cli -
pnpm add uloop-cli
Imports
- uloop
import uloop from 'uloop-cli'
npm install -g uloop-cli uloop --help
- uloop compile
uloop.compile()
uloop compile --project-path ./MyUnityProject
- uloop skills install
uloop install skills
uloop skills install --claude --global
Quickstart
npm install -g uloop-cli # Assuming Unity CLI Loop (uLoopMCP) is installed and running in your Unity project. # This example installs skills for Claude Code globally and then executes a compilation. # Replace './path/to/your/unity/project' with the actual path. # Step 1: Install skills for LLM tools (e.g., Claude Code) # This allows LLMs to automatically use uloop commands. uloop skills install --claude --global # Step 2: Compile your Unity project # This command will trigger a compilation within the specified Unity Editor instance. # The '--wait-for-domain-reload true' flag ensures the CLI waits until Unity has finished its domain reload. # The output will indicate compilation success or failure and any errors/warnings. uloop compile --project-path ./path/to/your/unity/project --wait-for-domain-reload true # Step 3: Example of chaining commands: Compile, wait, then enter Play Mode # This demonstrates automating a sequence of operations. uloop compile --project-path ./path/to/your/unity/project --wait-for-domain-reload true && \ uloop control-play-mode --project-path ./path/to/your/unity/project --action Play