{"id":20137,"plugin_id":"plugins_6aa1c02597c081918e358d72f65bd772","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T23:16:01.740Z","digest":"aa73026bcc9b1645c14137a48b536850e588a0f37b0e76422a93e3f7a60b2770","against":null,"payload":{"description":"Use when interacting with Unity CLI from the terminal, or to control a running/connected Unity Editor from the command line — create or modify GameObjects, edit scenes and assets, inspect the hierarchy, and run C# in a live Editor instead of hand-editing scene or asset files. Also install, upgrade or uninstall editors, create, list or open projects, manage modules, manage licenses, check auth status, read logs, browse Unity releases, build/test projects, configure the Unity MCP server for AI agents, or run any other Unity CLI operation. For a guided idea-to-running-project flow for a brand-new game, use the new-unity-project skill instead.","included_files":[{"relative_path":"CHANGELOG.md","size_in_bytes":36800},{"relative_path":"SECURITY.md","size_in_bytes":6142},{"relative_path":"references/auth-license-cloud.md","size_in_bytes":12249},{"relative_path":"references/build-run-test.md","size_in_bytes":34527},{"relative_path":"references/collaboration.md","size_in_bytes":28883},{"relative_path":"references/config-hub.md","size_in_bytes":6151},{"relative_path":"references/diagnostics-maintenance.md","size_in_bytes":24861},{"relative_path":"references/editors-install.md","size_in_bytes":15324},{"relative_path":"references/integration-advanced.md","size_in_bytes":41036},{"relative_path":"references/projects-templates.md","size_in_bytes":44247},{"relative_path":"references/version-control.md","size_in_bytes":22411}],"name":"unity-cli","skill_md_contents":"---\nname: unity-cli\ndescription: Use when interacting with Unity CLI from the terminal, or to control a running/connected Unity Editor from the command line — create or modify GameObjects, edit scenes and assets, inspect the hierarchy, and run C# in a live Editor instead of hand-editing scene or asset files. Also install, upgrade or uninstall editors, create, list or open projects, manage modules, manage licenses, check auth status, read logs, browse Unity releases, build/test projects, configure the Unity MCP server for AI agents, or run any other Unity CLI operation. For a guided idea-to-running-project flow for a brand-new game, use the new-unity-project skill instead.\nallowed-tools:\n  - Bash\n---\n\n# Unity CLI\n\n## Drive a running Unity Editor (if one is open)\n\n**If a Unity Editor is open on this machine, this CLI can control it live** — create and modify GameObjects, edit scenes and assets, inspect the hierarchy, and run arbitrary C# — through the project's **Pipeline** package (`com.unity.pipeline`). This runs entirely on your local machine, in your own user account, against your own open Editor: it is not remote access and grants no privilege you don't already have at your own terminal. When an Editor is available, drive it instead of hand-editing scene or asset files.\n\n```bash\nunity status                    # confirm a connected Editor (look for state \"ready\")\nunity command                   # list the commands the Editor exposes\nunity command editor_play       # run one — e.g. enter Play mode\n# Run arbitrary C# — e.g. add a GameObject named \"Joe\" — when the Editor exposes eval:\nunity command eval --caller plugin --skill unity-cli 'new UnityEngine.GameObject(\"Joe\");'\n```\n\n**Pass `--caller plugin --skill <name>` on every `unity command` invocation.** `--skill` is the\nskill whose instructions produced the call, so a task skill that sends you here passes its own name\nrather than `unity-cli`. The flags are inert to the command itself; they only label the invocation.\n\n### More than one Editor open? Pass `--project-path`\n\nEvery Editor-driving command takes `--project-path <path>`. **Pass it whenever more than one Editor may be running** — without it the CLI targets the Editor whose project contains the current directory, so the target follows the shell's cwd:\n\n```bash\nunity command editor_play --project-path /path/to/MyProject\n```\n\nA `unity status` instance's `project` field is what `--project-path` takes. For `unity command`/`list`/`job`/`mcp`, matching no running project fails with `AMBIGUOUS_EDITOR` and lists the candidates. [Details](references/integration-advanced.md#targeting-one-of-several-running-editors).\n\nRequires the project's `com.unity.pipeline` package (Unity 6.0+) — add it once with `unity pipeline install`. Full details — launching a headless Editor to drive, `unity list` tool discovery, and authoring custom `[CliCommand]` tools — are in [integration-advanced.md](references/integration-advanced.md).\n\nThe package also ships a deeper `unity-pipeline` agent skill, invisible to clients inside `Library/PackageCache` — in a project with the package, run `unity skill install <client> --local` once to mirror it beside this skill.\n\n> **Can't connect / commands time out? Check for Safe Mode first.** When a project has C# compile errors, the Editor boots into **Safe Mode**, where the Pipeline package doesn't load — so `unity command`, `unity status`, and `unity list` can't connect at all. Don't fall back to blind file-editing: run `unity pipeline list` to confirm, then fix the compile errors and restart Unity. Full recovery loop in [integration-advanced.md → Recovering from Safe Mode](references/integration-advanced.md#recovering-from-safe-mode-connection-fails-because-of-compile-errors).\n\n> **Running as a sandboxed coding agent and `unity status` reports no instances?** A restrictive sandbox can hide an Editor that is genuinely running from this CLI's view of it — don't treat that alone as proof the Editor is down. Full detail in [integration-advanced.md → Sandboxed agent tooling can hide a running Editor](references/integration-advanced.md#sandboxed-agent-tooling-can-hide-a-running-editor).\n\n## Install the CLI (if not already installed)\n\nFirst check if the CLI is available:\n\n```bash\nwhich unity && unity --version\n```\n\nIf not found, install it:\n\n**macOS / Linux**\n```bash\ncurl -fsSL https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.sh | UNITY_CLI_CHANNEL=beta bash\n```\n\n**Windows (PowerShell)**\n```powershell\n$env:UNITY_CLI_CHANNEL='beta'; irm https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.ps1 | iex\n```\n\nAfter installing, open a new shell so `unity` is on PATH, then verify with `unity --version`. If the install script fails or the binary is still not found, tell the user and stop; if the command itself fails with a permissions error or crash, the installation may be broken — suggest re-running the install script.\n\n---\n\n## Global flags\n\nThese work on every command:\n\n| Flag | Description |\n|---|---|\n| `--format <fmt>` | Output format: `human` (default), `json`, `tsv`, `ndjson`, `github`. Also via `UNITY_FORMAT` env var. |\n| `--json` | Global shorthand for `--format json`, accepted on every command (e.g. `unity status --json`, `unity doctor --json`). `--format` takes precedence when both are supplied. |\n| `--no-banner` | Suppress the branded header — use in scripts |\n| `--no-pager` | Turn off paging. Governs both pagers: the external one over the long listings (`unity command`, `releases`, `editors`, `changelog`, `logs`) and the interactive one in `unity projects list`. Also via `UNITY_NO_PAGER` (presence-based — any value, including `0`, disables it). |\n| `--non-interactive` | Disable all interactive prompts — use in CI |\n| `--quiet` | Suppress non-essential output |\n| `--verbose` | Print full error details (stack trace + cause chain) on failure. Also via `UNITY_VERBOSE`. |\n| `--proxy <url>` | HTTP/HTTPS/SOCKS/PAC proxy URL for this invocation. Also via `UNITY_PROXY`. Takes precedence over standard `HTTPS_PROXY`/`HTTP_PROXY`/`ALL_PROXY` env vars and the persisted `proxy.json` setting. |\n| `--proxy-disable` | Disable proxy for this invocation, ignoring all sources (env vars, persisted config, system settings). |\n| `--log-proxy` | Log one redacted entry per outbound request to `proxy-request.json` — for reproducing proxy issues. Also via `UNITY_LOG_PROXY=1` or the `proxyRequestLogging` setting. |\n| `--no-log-proxy` | Opt a single invocation out of proxy request logging when it's enabled globally. |\n| `--color <auto\\|always\\|never>` | Control colored output for this invocation, overriding `NO_COLOR`/`FORCE_COLOR` and TTY auto-detection. Governs every ANSI-emitting surface (help, tables, spinners, errors), not just `human` output. |\n| `--no-color` | Shorthand for `--color never`. Whichever of `--color`/`--no-color` appears last on the line wins. |\n\n**Always use `--format json` when you need to parse output programmatically.**\n\n**`unity projects list` is the only command that pages IN-PROCESS.** It shows 10 projects per screen and waits for a keypress between screens, and only when stdout is a terminal. Paging is off for redirected stdout, under `--format json` and `--format ndjson`, and under `--all`, `--watch`, or `--no-pager` / `UNITY_NO_PAGER`.\n\n**Not every machine format bypasses that one.** Only `json` and `ndjson` get their own non-interactive rendering; on a terminal, `--format tsv` and `--format github` fall through to the human table and page like `human` does — so `--format tsv` on a TTY yields neither TSV nor unpaged output. Redirect stdout (the usual case for a machine format) or pass `--no-pager`. Note this is the **opposite** of the external pager below, which is `human`-only: the two mechanisms differ here, and `projects list` is the surprising one.\n\n**The long listings page through an external pager, like `git log`.** `unity command` (the bare listing), `unity releases`, `unity editors`, `unity changelog`, and `unity logs` pipe human output through `less -RFX` on a terminal — colors kept, no screen clear, and `-F` quits by itself when the output already fits one screen, so short listings show no pager UI. `$UNITY_PAGER` then `$PAGER` override the choice and run through a shell, so `PAGER=\"less -S\"` works; a blank value is ignored rather than treated as an opt-out. Quitting with `q` exits cleanly with the command's own exit code. Unlike `projects list`'s pager this one is **`human`-only**, and it never engages for redirected stdout, any machine format (`json`, `tsv`, `ndjson`, `github`), `--quiet`, `TERM=dumb`, the streaming modes (`editors --watch`, `logs --follow`), a named `unity command <name>`, or inside `unity shell`. A broken pager costs the paging, not the output: a `$PAGER` naming something that is not there is resolved before anything spawns, and one that spawns and then dies has its output reprinted to the terminal, decided from the pager's exit status (a clean exit is a normal `q` and discards; a failure status reprints). The exception is a pager that exits *successfully* without reading — `PAGER=true`, or anything that lingers and then exits 0 — which nothing distinguishes from a `q`, and which `git` loses too. A pager that starts and merely *waits* is not treated as broken, so the CLI waits with it.\n\nA branded Unity header (logo, wordmark, CLI version) renders on the landing surfaces — bare `unity`, `unity --help` / `-h`, `unity help`, and above the first-run consent prompt. It's shown only on a TTY, prints at most once, and degrades to compact, uncolored text on narrow terminals, without Unicode, or under `NO_COLOR`. Piped output is unaffected. Use `--no-banner` to suppress it in scripts. Bare `unity` prints usage and exits 0.\n\n## Environment variables\n\nAll CLI env vars use the `UNITY_` prefix. A CLI flag always overrides the corresponding env var.\n\n| Variable | Mirrors flag | Description |\n|---|---|---|\n| `UNITY_FORMAT` | `--format` | Output format (`human`, `json`, `tsv`, `ndjson`, `github`). `HUB_FORMAT` is a deprecated alias. |\n| `UNITY_EDITOR_VERSION` | `--editor-version` | Editor version (e.g. `2023.3.0f1`, `latest`, `lts`). |\n| `UNITY_ARCHITECTURE` | `--architecture` | Chip architecture (`x86_64`, `arm64`). |\n| `UNITY_PROJECT_PATH` | path argument | Project path — used by `open`, and also honored by `status` and the cloud commands. |\n| `UNITY_QUIET` | `--quiet` | Suppress non-essential output. |\n| `UNITY_VERBOSE` | `--verbose` | Show full error details on failure. |\n| `UNITY_NON_INTERACTIVE` | `--non-interactive` | Disable interactive prompts. |\n| `UNITY_NO_BANNER` | `--no-banner` | Suppress the branded banner. |\n| `UNITY_NO_PAGER` | `--no-pager` | Turn off paging — both the external pager over the long listings and `unity projects list`'s interactive one. Presence-based: any value counts, including `0`. |\n| `UNITY_PAGER` | — | The pager to use for the long listings, overriding `$PAGER` and the `less -RFX` default. Runs through a shell, so flags work (`less -S`). A blank value is ignored, not an opt-out. |\n| `PAGER` | — | Same as `UNITY_PAGER`, consulted only when that is unset or blank. |\n| `LESS` / `LV` / `LESSCHARSET` / `MORE` | — | Passed to the pager only when you have not set them, defaulting to `FRX`, `-c`, `utf-8`, and `FRX`. `LESSCHARSET` keeps multi-byte glyphs readable where the locale does not declare UTF-8; `MORE` exists because `more` on macOS/BSD is `less` under another name and reads `$MORE`, so without it `PAGER=more` waits for a keypress even for one line. |\n| `UNITY_RUN_TIMEOUT` | `--timeout` | Timeout for `unity run` in seconds. |\n| `UNITY_TEST_TIMEOUT` | `--timeout` | Timeout for `unity test` in seconds. |\n| `UNITY_CLOUD_ORG` | `--cloud-org` | Active Unity Cloud organization id or name for a single call. |\n| `UNITY_SERVICE_ACCOUNT_ID` | — | Service account client ID for non-interactive (CI) auth. |\n| `UNITY_SERVICE_ACCOUNT_SECRET` | — | Service account client secret for non-interactive (CI) auth. |\n| `UNITY_PROXY` | `--proxy` | HTTP/HTTPS/SOCKS/PAC proxy URL. Takes precedence over `HTTPS_PROXY`/`HTTP_PROXY`/`ALL_PROXY` and the persisted `proxy.json` setting. |\n| `UNITY_NO_UPDATE_CHECK` | — | Disable the background \"update available\" check (see `unity config update-check`). |\n| `UNITY_NO_CONSENT_PROMPT` | — | Suppress the one-time first-run analytics consent prompt *without* recording a choice — for wrapper scripts on an interactive terminal that must never absorb the prompt. Analytics stay off until you run `unity analytics opt-in`. Unlike `UNITY_NON_INTERACTIVE`, it changes nothing else about command behavior. |\n| `UNITY_NO_CRASH_REPORT` | — | Disable anonymous crash/error reporting (Sentry) entirely. |\n| `UNITY_LOG_PROXY` | `--log-proxy` | Log one redacted entry per outbound request to `proxy-request.json`. Truthy values: `1`, `true`. |\n| `UNITY_NO_ELEVATE` | `--no-elevate` | Windows: skip the elevated (UAC) install helper for `install` / `install-modules`, so the install service runs unelevated. The Editor's NSIS installer still asks for elevation on demand if Windows requires it for your account — an administrator token always does; a standard user never does. |\n| `UNITY_INSTALL_RETRIES` | `--retries` | Number of times `install-modules` retries a module whose download/validation fails. `0` disables retries. |\n\n**CI service account auth:** Set both `UNITY_SERVICE_ACCOUNT_ID` and `UNITY_SERVICE_ACCOUNT_SECRET` to skip the browser OAuth flow — this keeps the secret out of the process argument list and shell history. These map to the `--client-id` / `--secret-from-stdin` inputs of `unity auth login`, but reading the credentials from the environment isn't a full login: it doesn't run the interactive flow or persist credentials to the keyring.\n\n## Getting help\n\nAppend `-h` or `--help` to any command or subcommand, at any level: `unity --help`, `unity projects create --help`.\n\n## Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | Success |\n| 1 | General error |\n| 2 | Bad arguments |\n| 3 | Authentication failure |\n| 4 | Precondition not met (e.g. no license active, floating server not configured) |\n| 6 | Command-specific failure |\n| 8 | `unity test` only — the tests ran and one or more **failed**. Every other way a test run fails (compile error, unavailable license, editor crash, `--timeout`) keeps `6`, so CI can retry an infrastructure failure and never retry a failing test. |\n| 130 | Interrupted — Ctrl+C / SIGINT (128 + 2) |\n| 143 | Terminated by SIGTERM (128 + 15) — e.g. `kill` or a CI/runner timeout. Emitted by long-running commands that install a signal handler to clean up first (currently `unity build`, which scrubs the temporary Android keystore). |\n\nThe `cloud` and `auth` commands map an authentication failure (expired/missing session, rejected sign-in) to `3`, and any other operational failure (network, server error) to `6` — so scripts can reliably tell \"sign in again\" apart from a genuine command failure.\n\n---\n\n## Commands\n\nThe full per-command reference — syntax, flags, and examples — lives in grouped files under\n[`references/`](references/). **Read the file for the command group you need**; all the global\nflags, environment variables, and exit codes above apply throughout. Every command also supports\n`-h` / `--help` (see [Getting help](#getting-help)).\n\n| Commands | Reference file |\n|---|---|\n| `auth` (login / logout / status / list / switch / default / consumers / revoke), `license` (activate / return / server), `cloud` (org / project) | [auth-license-cloud.md](references/auth-license-cloud.md) |\n| `editors` (list / running / add / default / path / install-path / info / upgrade / prune / verify / module), `install`, `uninstall`, `modules`, `install-modules` | [editors-install.md](references/editors-install.md) |\n| `projects` (list / create / new / clone / open / link / require / upgrade / export / import / pin / size / clean / exec), `releases`, `templates` (list / info / create / pack / delete) | [projects-templates.md](references/projects-templates.md) |\n| `config` (proxy / update-check / get / set / list / unset), `hub install` | [config-hub.md](references/config-hub.md) |\n| `run`, `test`, `build` | [build-run-test.md](references/build-run-test.md) |\n| `logs`, `doctor`, `env`, `version`, `cache`, `ci init`, `analytics`, `changelog`, `language`, `completion`, `bug`, `self-update`, `self-uninstall`, `diagnose proxy` | [diagnostics-maintenance.md](references/diagnostics-maintenance.md) |\n| `mcp` (+ `configure`), `skill` (install / refresh / show), `plugin` (install / remove / upgrade / list / changelog), connected editors (`pipeline` / `command` / `status` / `list`), `shell` | [integration-advanced.md](references/integration-advanced.md) |\n| `vcs` — `setup` / `status` / `sync` / `switch` / `doctor` / `providers` / `merge-setup` / `conflicts` / `explain` / `resolve` / `diff` / `blame` / `summarize` / `affected` / `hooks`, `vcs git` (`migrate-lfs` / `worktree`), `vcs uvcs` (`locks` / `changesets` / `review`) | [version-control.md](references/version-control.md) |\n| `collaboration` (alias `collab`) — `annotations` / `attachments` / `thumbnail` / `reactions` / `read` / `subscribe` / `jira` | [collaboration.md](references/collaboration.md) |\n\n## Common workflows\n\n### Edit a scene, GameObject, or asset — `unity status` first\n\n**Before editing any scene, GameObject, prefab, or asset, run `unity status` to detect a connected Editor.** If one is reachable, drive it with live commands instead of touching project files — the Editor applies changes to the *actual active scene* and keeps its in-memory state in sync.\n\n```bash\nunity status                       # is an Editor connected? (look for state \"ready\")\nunity command                      # discover the scene/GameObject commands THIS Editor exposes\n# then drive it with the commands it lists — for example, if your Editor exposes them:\nunity command create_gameobject    # act on the live, active scene\nunity command save_scene           # persist the active scene\n```\n\nCommand names are defined by the Editor, so run `unity command` (or `unity list`) to see the exact set — don't assume a name.\n\n> **Never hand-edit `.unity`, `.prefab`, or `.asset` YAML while a live Editor is reachable.** Raw-file edits are:\n> - **error-prone** — fileIDs and GUIDs are assigned by hand and easy to get wrong;\n> - **invisible** to the running Editor until a reimport, so the change silently fails to take effect; and\n> - **prone to hitting the wrong file** — e.g. writing to `SampleScene.unity` while the Editor's active scene is actually `Demo2.unity`, producing valid-looking YAML that changes nothing the user sees.\n\n**Rule out two false negatives before concluding no Editor is reachable — both look identical to a genuinely closed Editor, and both are easy to get wrong under time pressure:**\n\n- **Safe Mode.** If an Editor *is* running for this project but `unity status` / `unity command` won't connect, it may be stuck in **Safe Mode** from a compile error rather than genuinely absent. Run `unity pipeline list` — if it reports Safe Mode, editing the C# source to fix the compile errors (and then restarting Unity) *is* the correct move, not a fallback. See [integration-advanced.md → Recovering from Safe Mode](references/integration-advanced.md#recovering-from-safe-mode-connection-fails-because-of-compile-errors).\n- **A sandboxed agent shell.** If your own shell commands run inside a restrictive sandbox — the normal case for a coding agent like this one — the sandbox can hide a genuinely running Editor from `unity status` the same way. This applies to **every** scene/GameObject/prefab/asset task that reaches this preflight, not only ones that obviously need a live Editor: a task you could otherwise finish without any CLI involvement (e.g. generating an asset through ordinary Editor APIs) can still get funneled into \"no Editor\" here and derailed. Don't treat \"no instances\" as proof the Editor is down, and don't quietly improvise a third path — like driving a separate headless Editor process to approximate what a live connection would have done — as a substitute for a disclosed file edit. Say plainly that your sandbox may be blocking your view of a real Editor, and ask whether one is actually open before falling back. Full detail: [integration-advanced.md → Sandboxed agent tooling can hide a running Editor](references/integration-advanced.md#sandboxed-agent-tooling-can-hide-a-running-editor).\n\nOnly fall back to editing files directly once you've ruled out both of the above — and say so explicitly (\"no live Editor detected, editing the file directly\").\n\n### Bootstrap a new project from scratch\n\n> For a **guided** end-to-end experience — concept questions, installing the Editor in the\n> background while you plan, package selection, and monetization handoff — use the\n> **`new-unity-project`** skill. This section is the raw CLI recipe that skill builds on; use it\n> directly when you just want the commands.\n\nTake an idea to a running, version-controlled project using only the CLI. Decide the **target\nplatforms first** — they determine which Editor modules you install in step 2. You can add\nmodules later (`unity install-modules`), but a project can't build for a platform until that\nplatform's module is installed, so it's simplest to decide up front.\n\n```bash\n# 1. Confirm the CLI works and you're signed in and licensed (see references/auth-license-cloud.md).\nunity --version\nunity auth status --format json      # if signed out:      unity auth login\nunity license status --format json   # if none active:      unity license activate\n\n# 2. Pick and install an Editor with the modules your target platforms need.\n#    Default to the latest LTS (most stable, ~2 years of patches). Reach for a Tech-stream\n#    release (--stream tech) only for a feature not yet in LTS; treat --stream beta/alpha as\n#    evaluation-only, never for a project you intend to ship. A deadline argues for LTS.\n#    (lts / latest aliases work wherever a version is accepted.)\nunity releases --stream lts --limit 5 --format json\nunity install lts --module android --module ios --yes --accept-eula   # add --module webgl, etc.\nunity editors --installed --format json                               # confirm it landed\n\n# 3. List the real template ids this Editor offers — don't guess them.\nunity templates list --editor lts --format json\n#    Common ids: com.unity.template.3d, com.unity.template.2d, and a URP template (id varies by version).\n\n# 4. Create the project. The first positional arg is the NAME; --path sets the parent directory.\n#    All options supplied, so it won't prompt; add --non-interactive in CI.\nunity projects create \"MyGame\" --path ~/UnityProjects \\\n  --editor-version lts --template com.unity.template.3d\n```\n\n**Source control — let the user choose.** The CLI publishes the new project to a fresh remote in\none step for any provider. **Always pass tokens on stdin** (`--git-token-stdin`) so secrets never\nland in shell history or the process list. Pick based on the project — don't default to one:\n\n- **Git — GitHub / GitLab** (`--vcs github` / `--vcs gitlab`). Ubiquitous. For asset-heavy games\n  add **Git LFS** (`--git-lfs`) so large binaries don't bloat history.\n- **Unity Version Control — UVCS** (`--vcs uvcs`). Unity's own VCS, built for large binary game\n  assets: it handles them natively (**no LFS needed**) and supports file locking — often the\n  better fit for art-heavy projects or larger teams. Auth uses your Unity sign-in; `--vcs-region`\n  selects the region.\n\n```bash\n# Git (GitHub) — drop --git-lfs if the game isn't asset-heavy. Add --no-initial-commit if you\n# want to add packages/assets BEFORE the first commit (see the new-unity-project flow).\nunity projects create \"MyGame\" --path ~/UnityProjects \\\n  --editor-version lts --template com.unity.template.3d \\\n  --vcs github --git-namespace my-org --git-repo my-game \\\n  --git-visibility private --git-default-branch main --git-token-stdin --git-lfs\n\n# Unity Version Control (UVCS) — handles binaries natively, so no LFS:\nunity projects create \"MyGame\" --path ~/UnityProjects \\\n  --editor-version lts --template com.unity.template.3d \\\n  --vcs uvcs --git-namespace my-org --git-repo my-game --vcs-region <region>\n```\n\nFeed the token to `--git-token-stdin` from a secret store, never a literal — e.g.\n`… --git-token-stdin <<<\"$GIT_TOKEN\"` where `$GIT_TOKEN` comes from your CI/secret manager\n(UVCS uses your Unity sign-in, so no token is needed).\n\n**Working with a UVCS workspace day to day: a few wrapped reads, everything else straight through\nto `cm`.** The split is deliberate and worth teaching, because guessing wrong wastes a user's time:\n\n- **`unity vcs uvcs <verb>`** wraps the reads that **join `cm`'s data to your project** —\n  `locks` (who holds a lock, *and which locks cover files you have already changed*),\n  `changesets`, and `review`. Those joins are the thing `cm` cannot do for you, and they come in a\n  stable envelope, so prefer them whenever something *parses* the output.\n- **`unity uvcs <args>`** forwards the whole command line to `cm` verbatim, `--help` and\n  `--format` included. That is the supported route, not a workaround: `cm` owns and versions this\n  vocabulary, so wrapping it would pin a paraphrase that goes stale. Reach for it for **partial\n  checkout**, **shelves**, and **taking or releasing a lock**, and when a human reads the output.\n\n```bash\nunity vcs uvcs locks                       # who holds what, and what collides with your changes\nunity uvcs lock list                       # the raw listing, cm's own flags and output\nunity uvcs partial update /Assets/Levels   # cm's own vocabulary, unchanged\nunity uvcs shelve -c \"wip: lighting pass\"\n```\n\nEvery verb, flag and trap: [version-control.md](references/version-control.md).\n\n`unity cm <args>` is the same passthrough under cm's own name. Both need the `cm` client; install\nit with `unity plugin install plastic` if a command says it is missing.\n\n**Beyond setup, the `vcs` group covers the whole day-2 loop** — `status`, `sync`, `switch`,\n`merge-setup`, `conflicts` / `explain` / `resolve`, `diff`, `blame`, `summarize`, `affected`,\n`hooks`, `doctor`, `providers` — and the Unity semantics are the reason to reach for it over raw\n`git`. Full reference, with the flags and the traps:\n[version-control.md](references/version-control.md).\n\n**Git tokens belong to the user's credential manager, not the CLI.** When no token flag or env var\nis given, the CLI asks `git credential fill` and uses whatever the configured helper returns; it\nstores nothing it is passed or told. Don't suggest the CLI can save a Git token, and don't reach for\na token flag when the user already has a working credential helper. If they want a different token\nper organization, that is `git config --global credential.useHttpPath true` plus a multi-account\nhelper such as [Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager).\nThe CLI passes the full repo URL so the helper can discriminate, but it never installs or\nreconfigures a helper. `UNITY_GITHUB_TOKEN` / `UNITY_GITLAB_TOKEN` are one token per provider, so a\nCI job spanning several orgs should pass `--git-token-stdin` per invocation instead. See\n[references/projects-templates.md](references/projects-templates.md) for the full\nsource-control flag set. For a purely local Git repository instead, initialize git with a\nUnity-appropriate ignore so the multi-GB `Library/` and other generated folders are never committed:\n\n```bash\ncd ~/UnityProjects/MyGame\ngit init -b main\n# Download (do not pipe to a shell) a maintained Unity .gitignore:\ncurl -fsSL https://raw.githubusercontent.com/github/gitignore/main/Unity.gitignore -o .gitignore\n\n# Asset-heavy game? Keep large binaries out of git history with Git LFS:\ngit lfs install\ngit lfs track \"*.psd\" \"*.fbx\" \"*.wav\" \"*.mp3\" \"*.png\"   # adjust to your asset types\ngit add .gitattributes\n\ngit add -A\ngit status                             # sanity-check: Library/ Temp/ obj/ Build/ must NOT be staged\ngit commit -m \"Initial Unity project: MyGame\"\ngit ls-files | grep -c '^Library/'     # must print 0\n```\n\n**What the CLI does and doesn't cover.** The CLI handles editor, project, and source control.\nIt does **not** manage UPM (Unity Package Manager) packages — to add packages beyond the\ntemplate headlessly, use the **`unity-package-management`** skill (C# PackageManager Client\nAPI). For monetization/backend, hand off to the dedicated skills: `implement-in-app-purchases`\n(IAP), `levelplay-unity-integration` (ads), or `build-live-game` (accounts, cloud save,\neconomy, remote config, leaderboards). Open the project to start working:\n`unity open ~/UnityProjects/MyGame`.\n\n### Find and install a missing editor\n\n```bash\n# 1. Check what's installed\nunity editors --installed --format json\n\n# 2. Browse available LTS versions\nunity releases --lts --limit 5 --format json\n\n# 3. Install\nunity install 6000.0.47f1 --yes --accept-eula\n```\n\n### Open a project with the correct editor\n\n```bash\n# 1. Check the project's required editor version\nunity projects info /path/to/MyProject --format json\n# Look at \"editorVersion\" in the result\n\n# 2. Confirm that editor is installed\nunity editors --installed --format json\n\n# 3. Open (warns if the editor version is missing)\nunity open /path/to/MyProject\n```\n\n### CI: activate a license, then build\n\n```bash\n# 1. Sign in non-interactively with a service account\nunity auth login --client-id \"$UNITY_SERVICE_ACCOUNT_ID\" --secret-from-stdin <<<\"$UNITY_SERVICE_ACCOUNT_SECRET\"\n\n# 2. Activate the entitlement license (or use --serial / --floating)\nunity license activate\n\n# 3. Build\nunity build /path/to/MyProject \\\n  --editor-version 6000.0.47f1 \\\n  --target StandaloneLinux64 \\\n  --execute-method Builder.PerformBuild \\\n  --allow-install\necho \"Exit code: $?\"\n\n# 4. Return the seat when done (floating/assigned)\nunity license return --yes\n```\n\n### CI: headless build\n\nPrefer the dedicated `unity build` command (handles batch mode, logging, and CI flags):\n\n```bash\nunity build /path/to/MyProject \\\n  --editor-version 6000.0.47f1 \\\n  --target StandaloneLinux64 \\\n  --execute-method Builder.PerformBuild \\\n  --allow-install\necho \"Exit code: $?\"\n```\n\nOr use `unity run` (batch mode is automatic — never pass `-batchmode`/`-quit`):\n\n```bash\nunity run /path/to/MyProject \\\n  --editor-version 6000.0.47f1 \\\n  --allow-install \\\n  -- -executeMethod Builder.PerformBuild -logFile build.log\necho \"Exit code: $?\"\n```\n\n### CI: run tests and publish results\n\n```bash\nunity test /path/to/MyProject \\\n  --editor-version 6000.0.47f1 \\\n  --mode EditMode \\\n  --report-format junit \\\n  --output ./test-results.xml \\\n  --allow-install \\\n  --timeout 600\ncase $? in\n  0) echo \"All tests passed\" ;;\n  8) echo \"Tests failed — report to developers, do not retry\" ;;\n  *) echo \"Run did not complete — infrastructure failure, safe to retry\" ;;\nesac\n```\n\nExit `8` means the run finished and reported failing tests; any other non-zero code means it never produced a verdict. Under `--format json` the same split is `errors[0].code`: `TESTS_FAILED` versus `TEST_RUN_ERROR` / `TEST_TIMED_OUT`.\n\n`--report-format junit` makes `--output` a JUnit-schema report, which GitHub Actions and GitLab ingest as native test results with no converter step. It is written even when tests fail. Drop the flag for the NUnit3 default, or use `--report-format nunit,junit` to get both from one run. Add `--coverage` to collect coverage via the Unity Code Coverage package — it warns and carries on if the project doesn't have the package. See [build-run-test.md](references/build-run-test.md).\n\n### Debug the CLI\n\n```bash\n# Check auth + installed editors + recent errors in one command\nunity doctor --format json\n\n# Follow live logs during an install\nunity logs --follow --level info\n```\n\n---\n\n## Notes\n\n- `--non-interactive` and `--yes` together suppress all prompts — use both in CI.\n- `--format json` always produces machine-readable output; prefer it over parsing human text. Error envelopes are pretty-printed with the same 2-space indent as success envelopes.\n- **Read failures from stdout, not stderr.** A failed command still writes a complete document to stdout: under `--format json` an envelope with `success: false` and a populated `errors` array (`errors[0].code` is the stable token to branch on); under `--format ndjson` the usual terminal `{\"type\":\"result\",\"success\":false,…}` frame. **Branch on `success`, never on `data`** — `data` is usually `null` on a failure, but not always: a partial `unity editors add` failure carries a row per path, and an ambiguous `unity auth switch` carries `data.candidates` for you to disambiguate with. Check `success` and the exit code — never treat empty stdout as a failure signal, and do not parse stderr, which carries only human diagnostics in these formats. A handful of commands have not migrated yet and still print `{\"error\": \"…\"}` to stderr with empty stdout; if stdout is empty on a non-zero exit, that is a known bug in that command rather than a shape you should code against.\n- `unity <version> [path]` is a shorthand for `unity open [path] --editor-version <version>`. Works with `lts`, `latest`, or a full version string like `6000.0.47f1`.\n- The CLI supports kubectl-style plugins: any `unity-<name>` binary on PATH is callable as `unity <name>`.\n- Terminal output is hardened against control-character / escape-sequence injection from server-provided values (project titles, editor versions, module names) — C0 controls and non-SGR escape sequences are stripped from table/list/tree output, and now also from Commander usage errors, the `unity bug` log-archive warning, and `unity projects add`/`remove` machine (tsv) output, while SGR color/style codes are preserved.\n- The CLI reports anonymous crashes and errors via Sentry to help fix bugs (no IP address or hostname; home-directory paths and token-like values scrubbed before send), aligned with the Unity Hub. Opting in to analytics additionally attaches an anonymized machine id; opted-out users stay fully anonymous. Set `UNITY_NO_CRASH_REPORT` to disable reporting entirely. Separately again, every run sends one anonymous `cli telemetry` usage ping regardless of analytics/consent state — see [diagnostics-maintenance.md](references/diagnostics-maintenance.md#analytics--usagetelemetry-consent).\n- The CLI is currently in **beta** (latest: `1.0.0-beta.9`). It moved to 1.0 versioning at `1.0.0-beta.1`; it's still a beta, so keep `UNITY_CLI_CHANNEL=beta` in the install command until GA ships, after which that part can be dropped.\n- As of `0.1.0-beta.8` the CLI checks in the background for a newer version and prints an unobtrusive \"update available\" notice (interactive sessions only; never delays a command). Turn it off with `unity config update-check off` or the `UNITY_NO_UPDATE_CHECK` env var.\n- Outbound HTTP from every CLI command honors the resolved proxy (see `unity config proxy`). An invalid `--proxy` value (malformed URL or unsupported scheme) fails with a usage error (exit 2) instead of being silently ignored. Inspect what the CLI actually resolved with `unity env --format json` or `unity doctor --format json` — both surface the active proxy URL, its source, and auth source.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}