News

Unity CLI: Terminal-First Tooling and a Live C# REPL for AI Agents

Unity ships a standalone CLI for managing editors, projects, and authentication from the terminal, plus an experimental Pipeline package that turns a running Editor or Player into a programmable automation target with live C# eval.

July 23, 2026· 2 min read· Source: Unity
Unity CLI: Terminal-First Tooling and a Live C# REPL for AI Agents

Unity has released a standalone CLI binary that lets developers manage editors, modules, projects, and authentication entirely from the terminal — no Unity Hub UI required. The CLI is a single self-contained binary that installs via curl or PowerShell, supports structured JSON/TSV output, and uses predictable exit codes (0, 1, 130) for CI pipelines. It also handles service-account authentication via environment variables, making it suitable for headless build agents.

What the CLI does

The unity command replaces the old Unity Hub headless path (--headless) with a native binary that starts much faster. You can install an editor with specific modules in one line:

unity install 6000.2.10f1 -m android ios webgl

Other commands include unity editors to list installed versions, unity open to launch a project with the correct editor, and unity auth login for authentication. The unity doctor command diagnoses environment and credential issues.

Driving a running Editor with the Pipeline package

The experimental com.unity.pipeline package (Unity 6.0 LTS and newer) allows the CLI to communicate with a running Editor or a development Player build over a local API. Once installed via unity pipeline install, any static method decorated with [CliCommand] becomes a callable command from the terminal:

unity command greet --name World

The package also supports pointing the CLI at a running Player build with --runtime <player exec name>, enabling live log queries, runtime status checks, and hot-reload of code in a development build.

Live C# eval

The killer feature is unity command eval, which compiles and executes arbitrary C# expressions inside the running Editor or Player using Roslyn, returning results in milliseconds. No recompile or domain reload needed:

unity command eval "return Application.version;"
unity command eval "return UnityEditor.EditorApplication.isPlaying;" --json

Eval is gated behind a security token to prevent abuse.

AI agent foundation

Together, the CLI and Pipeline package give AI agents a tight feedback loop: they can open a project, inspect the scene, apply changes, run tests, enter Play mode, and verify results — all without human intervention. The structured JSON output and self-describing command list make it natural for function-calling models or MCP servers to consume.

The CLI speaks a language agents understand: structured JSON and a predictable exit-code contract mean a model gets clean, parseable results instead of scraped console text.
Manul X Editorial