UnityCtl.Cli 0.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global UnityCtl.Cli --version 0.4.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local UnityCtl.Cli --version 0.4.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=UnityCtl.Cli&version=0.4.0
                    
nuke :add-package UnityCtl.Cli --version 0.4.0
                    

UnityCtl

Let AI agents drive the Unity Editor. Edit scripts, compile, play, screenshot, debug—all from the command line.

What Can AI Do With This?

Edit and Compile

An agent modifies your C# scripts, then compiles:

# Agent edits PlayerController.cs, then...
unityctl asset refresh

Compilation errors appear directly in the output. The agent iterates until it compiles.

Play Mode + Screenshots

Enter play mode and capture what's happening:

unityctl play enter
unityctl screenshot capture
unityctl logs                 # shows all logs since last clear
unityctl play exit

The agent can see the game running and read any Debug.Log output.

Execute Arbitrary C#

Run any C# code in the editor—create objects, set properties, click buttons, open windows, whatever:

# Spawn a cube at the origin
unityctl script execute -c "using UnityEngine; public class Script { public static object Main() { return GameObject.CreatePrimitive(PrimitiveType.Cube).name; } }"

# Find the player and move them
unityctl script execute -c "using UnityEngine; public class Script { public static object Main() { var p = GameObject.Find(\"Player\"); p.transform.position = new Vector3(0, 10, 0); return \"moved\"; } }"

# Pass arguments to scripts (use -- separator)
unityctl script execute -f SpawnObjects.cs -- Cube 5

Installation

Requires .NET 10 SDK or newer.

Linux/macOS:

curl -sSL https://raw.githubusercontent.com/DirtybitGames/unityctl/main/scripts/install.sh | bash

Windows (PowerShell):

iwr https://raw.githubusercontent.com/DirtybitGames/unityctl/main/scripts/install.ps1 | iex

Or install manually:

dotnet tool install -g UnityCtl.Cli
dotnet tool install -g UnityCtl.Bridge

Project Setup

Run setup from your Unity project directory (or any parent folder like a monorepo root):

unityctl setup

This installs the Unity package and Claude Code skill. If run outside a Unity project, it will prompt for the project path and save it to .unityctl/config.json for future commands.

Quick start: unityctl bridge start, open Unity, unityctl wait

Or launch Unity via CLI: unityctl bridge start, unityctl editor run, unityctl wait

More Commands

Command Description
unityctl setup One-command project setup (config + package + skill)
unityctl update Update CLI, bridge, and Unity package
unityctl editor run Launch Unity Editor (auto-detects version)
unityctl editor stop Stop running Unity Editor
unityctl asset refresh Refresh assets and trigger compilation
unityctl logs View logs since last clear (use -n to limit, --full for all history)
unityctl scene load <path> Load a scene
unityctl scene list List scenes in build settings
unityctl test run Run edit mode tests
unityctl test run --mode playmode Run play mode tests
unityctl menu execute <path> Execute Unity menu item
unityctl asset import <path> Import an asset
unityctl config set/get/list Manage configuration
unityctl package add/remove/status Manage Unity package
unityctl skill add/remove/status Manage Claude Code skill

Run unityctl --help for the full command list.

Architecture

┌─────────┐        ┌────────┐        ┌──────────────┐
│ unityctl│──HTTP──│ bridge │──WS────│ Unity Editor │
│  (CLI)  │        │(daemon)│        │   (plugin)   │
└─────────┘        └────────┘        └──────────────┘

The bridge daemon survives Unity's domain reloads, so your workflow isn't interrupted when scripts recompile.

Motivation

This project comes from a frustration with trying to use claude code to be productive in Unity. It is great at spitting out code that looks OK but doesn't compile. It would try to call unity in batch mode to compile, but Unity refuses since the editor is running. Having the editor open is key to being in the loop and getting visual confirmation that things are working.

There are MCP servers for Unity, but they eat a lot of context window for any task that doesn't require driving the editor. By creating a CLI that claude can learn by trying to use it (and can "remember" on demand through the skill.md), claude is able to use the editor on demand without a constant context cost.

The API is kept simple, and leans mostly on the script execution to get work done. Claude is good at writing ad-hoc scripts to achieve a goal in unity, and this seems more flexible and reliable than implementing APIs for managing or editing specific types of assets.

Documentation

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.4.1 49 2/10/2026
0.4.0 50 2/10/2026
0.3.6 82 2/4/2026
0.3.5 81 2/3/2026
0.3.4 87 2/3/2026
0.3.3 101 1/11/2026
0.3.2 88 1/11/2026
0.3.1 91 1/9/2026
0.3.0 87 1/8/2026
0.2.2 374 11/30/2025
0.2.1 134 11/29/2025
0.2.0 184 11/27/2025
0.1.1 401 11/19/2025
0.1.0 405 11/19/2025