A command-line interface for controlling Unity Editor from the terminal, supporting compilation, testing, building, asset management, and AI coding assistant integration.
UniCli is a command-line tool for controlling Unity Editor from the terminal — compile scripts, run tests, manage packages, inspect GameObjects, and more, all without leaving your terminal.
Dual-Component Architecture#
- CLI (unicli): NativeAOT-compiled terminal command-line tool
- Unity Package (com.yucchiy.unicli-server): Unity Editor plugin that receives and executes commands
Core Capabilities#
Build & Compile#
Compile- Trigger script compilationBuildPlayer.Build/BuildPlayer.Compile- Build and compile players
Testing#
TestRunner.RunEditMode- Run Edit Mode testsTestRunner.RunPlayMode- Run Play Mode tests
Scene & Object Management#
GameObject.Find/Create/Destroy- Find, create, destroy game objectsScene.Open/Save/List- Open, save, list scenesPrefab.Instantiate/Save/Apply- Instantiate, save, apply prefabs
Asset & Package Management#
AssetDatabase.Find/Delete- Search, delete assetsPackageManager.List/Add/Remove- Manage Unity Packages
Material & Animation#
Material.Create/SetColor/SetFloat- Create materials, set propertiesAnimatorController.Create/Animator.SetController- Create controllers, set parameters
Debugging & Profiling#
Profiler.StartRecording/GetFrameData- Performance profilingRemote.List/Invoke- Execute debug commands on devices
Key Features#
- JSON Output: All commands support
--jsonflag - Dynamic C# Execution:
evalcommand uses AssemblyBuilder to compile and execute arbitrary C# code in Unity Editor context - Custom Commands: Extend commands by inheriting
CommandHandler<TRequest, TResponse> - Modular Design: Enable/disable feature modules per project
- Claude Code Integration: Plugin support for AI assistants to directly operate Unity Editor
Communication Architecture#
CLI ↔ Editor communicates via Named Pipe with Length-prefixed JSON framing protocol. Editor ↔ Device uses Unity PlayerConnection with 16 KB chunked transmission.
Installation#
macOS (Homebrew):
brew tap yucchiy/tap
brew install unicli
Unity Package Installation:
unicli install
Or add via Unity Package Manager with git URL.
Supported Platforms#
- macOS (arm64 / x64)
- Windows (x64)
- Requires Unity 2022.3 or later