Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Unity CLI Skill & AI Agent Toolkit

Skills Compatible Unity 6+ Ready License: MIT GitHub stars

Comprehensive, production-ready Unity CLI Agent Skill for all modern AI coding harnesses (Claude Code, Cursor, Windsurf, OpenCode, VS Code Copilot, Codex, Antigravity, Cline, and more).

This skill enables AI agents to directly control a running Unity Editor via the native Unity Pipeline IPC package (com.unity.pipeline), replacing deprecated in-editor MCP servers with high-speed (200–600ms latency, zero domain reload) command execution, live C# eval, project management, batch builds, and test automation.


⚡ Quick Start: Install via npx skills

You can install this skill globally across your AI agent tools or locally in your project repository:

1. Global Installation (All Agents)

# Add globally to all detected agents (Claude Code, Cursor, Windsurf, Codex, etc.)
npx skills add DennysOliveira/unity-cli -g

# Or specifically for Claude Code CLI
npx skills add DennysOliveira/unity-cli --agent claude-code -g

# Or specifically for Cursor / Windsurf
npx skills add DennysOliveira/unity-cli --agent cursor -g

2. Project-Level Installation

cd /path/to/your/unity-workspace
npx skills add DennysOliveira/unity-cli

🚀 Key Capabilities

Capability CLI / Pipeline Interface Description
Live Editor Control unity command, unity list, unity status Create/modify GameObjects, edit scenes, change transforms, add components in the active scene without YAML editing.
In-Memory C# Eval unity command eval '<C#>' Evaluate arbitrary C# expressions and scripts inside a running Editor instance in 200–600ms without recompiling.
Project Creation & Templates unity projects create, unity templates Scaffold new 2D, 3D, URP, HDRP, VR/AR, or Multiplayer projects with verified template packages.
Package & Pipeline Sync unity pipeline install Install or update com.unity.pipeline for zero-configuration AI agent socket integration.
Batch Runs & Headless CI unity run, unity build Headless execution, standalone player builds, Android signing/export, CI timeout management.
Test Automation unity test Run EditMode and PlayMode tests with automated conversion to standard NUnit / JUnit reports.
Editor & Module Lifecycle unity install, unity editors, unity install-modules Download, configure, and upgrade Unity Editor versions and target platform build modules.
Diagnostics & Recovery unity doctor, unity logs, unity pipeline list Automated detection and recovery loops for Editor Safe Mode and compilation lockouts.

📖 Architecture & Knowledge Base Structure

The skill is modularized into dedicated reference guides to optimize context-window tokens and precision:

unity-cli/
├── SKILL.md                          # Main orchestrator & operational entry point
├── CHANGELOG.md                      # Release & deprecation tracking
├── SECURITY.md                       # Security & authorization standards
└── references/
    ├── integration-advanced.md       # Live Editor driving, C# eval, Pipeline package, Safe Mode recovery
    ├── build-run-test.md             # Headless batch, CI builds, Android keystore, test runners
    ├── projects-templates.md         # Hub registry, project creation, cloning, custom templates
    ├── editors-install.md            # Editor versions, modules, release feeds, installation paths
    ├── auth-license-cloud.md         # Unity Cloud, license activation/floating, OAuth & service accounts
    ├── config-hub.md                 # Persistent CLI proxy settings, telemetry, Hub management
    └── diagnostics-maintenance.md   # Diagnostic logs, doctor utility, cache purging, analytics

🛠️ Step-by-Step Workflow for AI Agents

1. Drive a Connected Editor (Zero-YAML editing)

Before modifying scene files (.unity), prefabs (.prefab), or assets (.asset), the agent checks if an Editor is live:

# 1. Check if an active Editor is connected
unity status --format json

# 2. Discover commands exposed by the project's Pipeline package
unity command

# 3. Create or manipulate GameObjects dynamically
unity command create_gameobject
unity command eval 'new UnityEngine.GameObject("ProceduralSpawner");'
unity command save_scene

2. Scaffold a New Project

# List available templates for installed Editor
unity templates list --editor 6000.5.10f1

# Create a clean URP project
unity projects create MyNewGame --editor-version 6000.5.10f1 --template com.unity.template.urp-blank

# Install the Pipeline bridge
unity pipeline install --project-path ./MyNewGame

# Launch the Editor
unity open ./MyNewGame

3. Safe Mode Recovery Protocol

If an Editor fails to connect, the agent diagnoses compilation issues immediately:

# Confirm Safe Mode status
unity pipeline list --format json

# Read precise compilation errors from project logs
cat ./Logs/Editor.log | grep -E "error CS"

📚 Grounding & Official Sources

This toolkit is strictly grounded on official Unity documentation and live CLI specifications:

  1. Unity CLI: Replacement for in-Editor MCP Server
  2. Unity CLI Full Command Reference
  3. Unity Production Pipeline Package (com.unity.pipeline)
  4. Built-in binary introspection via unity --help, unity skill, and unity doctor.

🤝 Contributing

Contributions are welcome! If Unity releases new CLI commands or subcommands, feel free to open a Pull Request or issue.

  1. Fork the repo.
  2. Create your feature branch (git checkout -b feature/new-subcommand).
  3. Commit your changes (git commit -m 'feat: add support for unity cloud build').
  4. Push to the branch (git push origin feature/new-subcommand).
  5. Open a Pull Request.

📄 License

Distributed under the MIT License. See LICENSE for more information.

About

Comprehensive Unity CLI skill set for AI agents (Claude Code, Cursor, Windsurf, OpenCode) to control Unity Editor live, manage projects, run builds, and automate game development.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors