{"id":48747486,"url":"https://github.com/niqibiao/unity-cli-plugin","last_synced_at":"2026-04-16T08:00:26.207Z","repository":{"id":349571929,"uuid":"1202473059","full_name":"niqibiao/unity-cli-plugin","owner":"niqibiao","description":"Claude Code / Codex plugin for Unity — AI-driven scene editing, GameObject/Component manipulation, profiling, and C# REPL via 40+ built-in commands. Works with any Unity 2022.3+ project.","archived":false,"fork":false,"pushed_at":"2026-04-16T03:56:05.000Z","size":141,"stargazers_count":36,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T05:48:36.698Z","etag":null,"topics":["ai","claude-code","codex","repl","unity","unity-editor","unity-mcp","unity-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niqibiao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-06T04:04:06.000Z","updated_at":"2026-04-16T03:54:51.000Z","dependencies_parsed_at":"2026-04-16T08:00:25.547Z","dependency_job_id":null,"html_url":"https://github.com/niqibiao/unity-cli-plugin","commit_stats":null,"previous_names":["niqibiao/unity-cli-plugin"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/niqibiao/unity-cli-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqibiao%2Funity-cli-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqibiao%2Funity-cli-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqibiao%2Funity-cli-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqibiao%2Funity-cli-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niqibiao","download_url":"https://codeload.github.com/niqibiao/unity-cli-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqibiao%2Funity-cli-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31876852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T07:36:03.521Z","status":"ssl_error","status_checked_at":"2026-04-16T07:35:53.576Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","claude-code","codex","repl","unity","unity-editor","unity-mcp","unity-plugin"],"created_at":"2026-04-12T13:00:32.812Z","updated_at":"2026-04-16T08:00:26.187Z","avatar_url":"https://github.com/niqibiao.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n\n# unity-cli-plugin\n\n**AI coding agent plugin for Unity Editor — supports Claude Code \u0026 Codex CLI**\u003cbr/\u003e\n**Powered by [unity-csharpconsole](https://github.com/niqibiao/unity-csharpconsole)**\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Unity](https://img.shields.io/badge/Unity-2022.3%2B-black.svg?logo=unity)](https://unity.com/)\n[![Claude Code](https://img.shields.io/badge/Claude_Code-blueviolet.svg?logo=anthropic)](https://claude.ai/code)\n[![Codex CLI](https://img.shields.io/badge/Codex_CLI-00A67E.svg?logo=openai)](https://github.com/niqibiao/unity-cli-plugin/tree/codex-plugin)\n\n40+ commands for scene editing, components, assets, screenshots, profiling, and more.\u003cbr/\u003e\nDepends on **[unity-csharpconsole](https://github.com/niqibiao/unity-csharpconsole)** — a Roslyn-powered interactive C# REPL for Unity.\n\n[Quick Start](#-quick-start--claude-code) · [Usage](#-usage) · [Commands](#-commands) · [Custom Commands](#-custom-commands) · [Architecture](#️-architecture)\n\nEnglish | [中文](README_zh.md)\n\n\u003c/div\u003e\n\n---\n\n```\nYou:    \"Create 10 cubes in a circle and add Rigidbody to each\"\nClaude: Done. 10 cubes created at radius 5, each with a Rigidbody component.\n```\n\n### ⚡ CLI + Skills, Not MCP\n\nSame approach as [Playwright CLI](https://github.com/microsoft/playwright-cli) — CLI commands exposed through Claude Code's skill system instead of MCP. Why:\n\n- **Token-efficient.** Skills load on demand; MCP loads all tool schemas on every request.\n- **Unrestricted.** Falls back to a full [Roslyn C# REPL](https://github.com/niqibiao/unity-csharpconsole) — not limited to predefined tools.\n- **No sidecar.** Service runs inside Unity Editor. No extra process.\n- **Workflow-aware.** Understands Unity's compile lifecycle, play mode, domain reload.\n\n\n|                          | CLI + Skills (this plugin) | MCP                  |\n| ------------------------ | -------------------------- | -------------------- |\n| Context window cost      | **Low** (on-demand)        | High (always loaded) |\n| C# REPL fallback         | **Yes**                    | Limited or none      |\n| External server          | **None** (in-process)      | Required             |\n| Play-mode-aware refresh  | **Yes**                    | No                   |\n| Custom command discovery | **Automatic**              | Manual registration  |\n| Runtime / IL2CPP         | **Yes** (HybridCLR)        | Varies               |\n\n\n### 🚀 Quick Start — Claude Code\n\n**Prerequisites:** [Claude Code](https://claude.ai/code), Unity 2022.3+, Python 3.7+\n\n```bash\n# 1. Add the marketplace \u0026 install the plugin\nclaude plugin marketplace add niqibiao/unity-cli-plugin\nclaude plugin install unity-cli-plugin\n\n# 2. Install the Unity package (inside your project)\nclaude\n\u003e /unity-cli-setup\n\n# 3. Verify\n\u003e /unity-cli-status\n```\n\n### 🚀 Quick Start — Codex CLI (Experimental)\n\n\u003e **Note:** Codex CLI does not yet officially support third-party plugin distribution. The steps below rely on the local workspace marketplace, which may change in future releases.\n\n**Prerequisites:** [Codex CLI](https://github.com/openai/codex), Unity 2022.3+, Python 3.7+\n\n```bash\n# 1. Start Codex in your Unity project\ncd /path/to/your/unity-project\ncodex\n\n# 2. Tell Codex to clone and install the plugin:\n#    \"Clone https://github.com/niqibiao/unity-cli-plugin/tree/codex-plugin\n#     then run install.sh with the current directory\"\n\n# 3. Restart Codex, find and install the plugin\n/plugins              # locate unity-cli-plugin → Install\n\n# 4. Restart Codex again, then initialize the Unity package\n$unity-cli-setup\n\n# 5. Verify\n$unity-cli-status\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eManual install / already have a marketplace\u003c/summary\u003e\n\n```bash\ncd /path/to/your/unity-project\ngit clone --depth=1 -b codex-plugin https://github.com/niqibiao/unity-cli-plugin.git plugins/unity-cli-plugin\nrm -rf plugins/unity-cli-plugin/.git\n```\n\nThen add to `.agents/plugins/marketplace.json`:\n\n```jsonc\n{\n  \"name\": \"local-workspace\",\n  \"plugins\": [{\n    \"name\": \"unity-cli-plugin\",\n    \"source\": { \"source\": \"local\", \"path\": \"./plugins/unity-cli-plugin\" },\n    \"policy\": { \"installation\": \"INSTALLED_BY_DEFAULT\", \"authentication\": \"ON_INSTALL\" },\n    \"category\": \"Productivity\"\n  }]\n}\n```\n\u003c/details\u003e\n\n### 💬 Usage\n\nJust tell Claude what you want:\n\n```\n\u003e Add a directional light and rotate it 45 degrees on X\n\u003e Find all \"Enemy\" objects and list their components\n\u003e Take a screenshot of the Scene View\n\u003e Start profiler recording with deep profiling\n```\n\nClaude picks the right command or writes C# code as needed.\n\n#### ⌨️ Slash Commands\n\n\n| Command                       | Description                                  |\n| ----------------------------- | -------------------------------------------- |\n| `/unity-cli-setup`            | Install the Unity package                    |\n| `/unity-cli-status`           | Check package and service status             |\n| `/unity-cli-refresh`          | Trigger asset refresh / recompile            |\n| `/unity-cli-refresh-commands` | Refresh cached custom command list           |\n| `/unity-cli-sync-catalog`     | Compare local command catalog with live list |\n\n\n#### 💻 Direct CLI\n\n```bash\npython cli/cs.py exec --json --project . \"Debug.Log(\\\"Hello\\\")\"\npython cli/cs.py command --json --project . gameobject create '{\"name\":\"Cube\",\"primitiveType\":\"Cube\"}'\npython cli/cs.py refresh --json --project . --exit-playmode --wait 60\npython cli/cs.py batch --json --project . '[{\"ns\":\"gameobject\",\"action\":\"create\",\"args\":{\"name\":\"A\"}},{\"ns\":\"gameobject\",\"action\":\"create\",\"args\":{\"name\":\"B\"}}]'\npython cli/cs.py list-commands --json --project . --timeout 10\n```\n\n### 📦 Commands\n\n50 built-in commands across 13 namespaces. All commands support `--json` output.\n\n#### gameobject\n\n\n| Action       | Description                                           |\n| ------------ | ----------------------------------------------------- |\n| `find`       | Find GameObjects by name, tag, or component type      |\n| `create`     | Create a new GameObject (empty or primitive)          |\n| `destroy`    | Destroy a GameObject                                  |\n| `get`        | Get detailed info about a GameObject                  |\n| `modify`     | Change name, tag, layer, active state, or static flag |\n| `set_parent` | Reparent a GameObject                                 |\n| `duplicate`  | Duplicate a GameObject                                |\n\n\n#### component\n\n\n| Action   | Description                              |\n| -------- | ---------------------------------------- |\n| `add`    | Add a component to a GameObject          |\n| `remove` | Remove a component from a GameObject     |\n| `get`    | Get serialized field data of a component |\n| `modify` | Modify serialized fields of a component  |\n\n\n#### transform\n\n\n| Action | Description                                           |\n| ------ | ----------------------------------------------------- |\n| `get`  | Get position, rotation, and scale                     |\n| `set`  | Set position, rotation, and/or scale (local or world) |\n\n\n#### scene\n\n\n| Action      | Description                                                       |\n| ----------- | ----------------------------------------------------------------- |\n| `hierarchy` | Get the full scene hierarchy tree, optionally with component info |\n\n\n#### prefab\n\n\n| Action        | Description                                   |\n| ------------- | --------------------------------------------- |\n| `create`      | Create a prefab asset from a scene GameObject |\n| `instantiate` | Instantiate a prefab into the active scene    |\n| `unpack`      | Unpack a prefab instance                      |\n\n\n#### material\n\n\n| Action   | Description                                         |\n| -------- | --------------------------------------------------- |\n| `create` | Create a new material asset with a specified shader |\n| `get`    | Get material properties from an asset or a Renderer |\n| `assign` | Assign a material to a Renderer component           |\n\n\n#### screenshot\n\n\n| Action       | Description                             |\n| ------------ | --------------------------------------- |\n| `scene_view` | Capture the Scene View to an image file |\n| `game_view`  | Capture the Game View to an image file  |\n\n\n#### profiler\n\n\n| Action   | Description                                        |\n| -------- | -------------------------------------------------- |\n| `start`  | Start Profiler recording (optional deep profiling) |\n| `stop`   | Stop Profiler recording                            |\n| `status` | Get current Profiler state                         |\n| `save`   | Save recorded profiler data to a `.raw` file       |\n\n\n#### editor\n\n\n| Action            | Description                         |\n| ----------------- | ----------------------------------- |\n| `status`          | Get editor state and play mode info |\n| `playmode.status` | Get current play mode state         |\n| `playmode.enter`  | Enter play mode                     |\n| `playmode.exit`   | Exit play mode                      |\n| `menu.open`       | Execute a menu item by path         |\n| `window.open`     | Open an editor window by type name  |\n| `console.clear`   | Clear the editor console            |\n| `console.mark`    | Write a searchable marker to the editor log |\n\n\n#### asset\n\n\n| Action          | Description                           |\n| --------------- | ------------------------------------- |\n| `move`          | Move or rename an asset               |\n| `copy`          | Copy an asset to a new path           |\n| `delete`        | Delete one or more assets             |\n| `create_folder` | Create a folder in the Asset Database |\n\n\n#### project\n\n\n| Action           | Description                      |\n| ---------------- | -------------------------------- |\n| `scene.list`     | List all scenes in the project   |\n| `scene.open`     | Open a scene by path             |\n| `scene.save`     | Save the current scene           |\n| `selection.get`  | Get the current editor selection |\n| `selection.set`  | Set the editor selection         |\n| `asset.list`     | List assets by type filter       |\n| `asset.import`   | Import an asset by path          |\n| `asset.reimport` | Reimport an asset by path        |\n\n\n#### session\n\n\n| Action    | Description                             |\n| --------- | --------------------------------------- |\n| `list`    | List active REPL sessions               |\n| `inspect` | Inspect a session's state               |\n| `reset`   | Reset a session's compiler and executor |\n\n\n#### command\n\n\n| Action | Description                                      |\n| ------ | ------------------------------------------------ |\n| `list` | List all registered commands (built-in + custom) |\n\n\n### 🔧 Custom Commands\n\nCustom commands are supported. See [unity-csharpconsole](https://github.com/niqibiao/unity-csharpconsole) for how to define and register them.\n\n### 🏗️ Architecture\n\n```\nClaude Code                      Unity Editor\n┌──────────────────┐            ┌──────────────────────────┐\n│  Skills          │            │  com.zh1zh1.csharpconsole│\n│  ┌────────────┐  │            │  ┌────────────────────┐  │\n│  │ cli-command│──┼── HTTP ──▶ │  │ ConsoleHttpService │  │\n│  │ cli-exec   │  │            │  │  ├─ CommandRouter  │  │\n│  └────────────┘  │            │  │  ├─ REPL Compiler  │  │\n│                  │            │  │  └─ REPL Executor  │  │\n│  Python CLI      │            │  └────────────────────┘  │\n│  ┌────────────┐  │            │                          │\n│  │ cs.py      │  │            │  40+ CommandActions      │\n│  │ core_bridge│  │            │  (GameObject, Component, │\n│  └────────────┘  │            │   Prefab, Material, ...) │\n└──────────────────┘            └──────────────────────────┘\n```\n\n- **Plugin layer**: Skills and slash commands invoked by Claude Code\n- **CLI layer**: Python dispatcher, serializes requests to JSON\n- **Unity layer**: [unity-csharpconsole](https://github.com/niqibiao/unity-csharpconsole) — HTTP service, auto-discovered command handlers, Roslyn C# REPL\n\nAuto-detects project root and service port. No manual configuration.\n\n### ❓ Troubleshooting\n\n\n| Problem                | Solution                                                                                   |\n| ---------------------- | ------------------------------------------------------------------------------------------ |\n| `service: UNREACHABLE` | Make sure Unity Editor is open with the project loaded                                     |\n| `package: NOT FOUND`   | Run `/unity-cli-setup` or check `Packages/manifest.json`                                   |\n| Port conflict          | Service auto-advances to the next free port. Check `Temp/CSharpConsole/refresh_state.json` |\n| Commands not found     | Ensure the package compiled successfully (no errors in Unity Console)                      |\n| Version mismatch       | Run `/unity-cli-status` to check version info. Update the package if protocol differs      |\n\n\n---\n\n## License\n\n[Apache-2.0](LICENSE)\n\n---\n\nIf this plugin saves you time, consider giving it a star. It helps others find it.","funding_links":[],"categories":["Open Source Repositories"],"sub_categories":["Editor"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniqibiao%2Funity-cli-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniqibiao%2Funity-cli-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniqibiao%2Funity-cli-plugin/lists"}