UniCli

A command-line interface for controlling Unity Editor from the terminal.
UniCli lets you compile scripts, run tests, manage packages, inspect GameObjects, and more — all without leaving your terminal.
Designed to work with AI coding agents such as Claude Code, UniCli gives AI the ability to interact with Unity Editor directly through structured CLI commands with JSON output.
- 80+ built-in commands: compile, test, build, inspect GameObjects, manage scenes/prefabs/packages, and more
- Dynamic C# execution: run arbitrary C# code in Unity via
unicli eval
- Extensible: add custom commands with a single C# class
- AI-agent ready: structured JSON output, Claude Code plugin, and Agent Skills support
- Cross-platform: NativeAOT binaries for macOS (arm64/x64), Linux (x64), and Windows (x64)
Table of Contents
Getting Started
UniCli requires two components: the CLI (unicli) installed on your machine, and the Unity Package (com.yucchiy.unicli-server) installed in your Unity project. Both must be set up for UniCli to work.
Requirements
- Unity 2022.3 or later
- macOS (arm64 / x64), Linux (x64), or Windows (x64)
CLI
Homebrew (macOS):
brew tap yucchiy/tap
brew install unicli
Scoop (Windows):
scoop bucket add unicli https://github.com/yucchiy/scoop-bucket
scoop install unicli
Linux / Manual: Download the latest binary from the Releases page and place it in your PATH.
Unity Package
The UniCli package must be installed in your Unity project. You can install it using the CLI:
unicli install
Or add it manually via Unity Package Manager using the git URL:
https://github.com/yucchiy/UniCli.git?path=src/UniCli.Unity/Packages/com.yucchiy.unicli-server
Quick Usage
Open your Unity project in the Editor, then run unicli from the Unity project directory (or any subdirectory). UniCli automatically detects the project by looking for an Assets folder in the current directory and its ancestors.
# Verify connection
unicli check
# List all available commands
unicli commands
# Compile scripts
unicli exec Compile
# Run EditMode tests
unicli exec TestRunner.RunEditMode
# Execute arbitrary C# code (--json for JSON output)
unicli eval 'return Application.unityVersion;' --json
CLI Usage
The unicli binary provides the following subcommands:
| Subcommand | Description |
|---|
check | Check package installation and Unity Editor connection |
install | Install the UniCli package into a Unity project |
exec | Execute a command on the Unity Editor |
eval | Compile and execute C# code dynamically in the Unity Editor |
commands | List all available commands |
status | Show connection status and project info |
completions | Generate shell completion scripts (bash / zsh / fish) |
unicli check # verify installation and editor connection
unicli install # install the Unity package
unicli commands # list all available commands
unicli eval '<code>' # compile and execute C# code dynamically
unicli status # show connection details
unicli completions bash # generate shell completions