nccgs 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/.claude/agents/nccgs-accessibility-specialist.md +26 -0
  2. package/.claude/agents/nccgs-adversarial-reviewer.md +26 -0
  3. package/.claude/agents/nccgs-ai-programmer.md +26 -0
  4. package/.claude/agents/nccgs-analytics-engineer.md +26 -0
  5. package/.claude/agents/nccgs-art-direction-lead.md +26 -0
  6. package/.claude/agents/nccgs-audio-direction-lead.md +26 -0
  7. package/.claude/agents/nccgs-creative-director.md +26 -0
  8. package/.claude/agents/nccgs-documentation-manager.md +26 -0
  9. package/.claude/agents/nccgs-economy-designer.md +26 -0
  10. package/.claude/agents/nccgs-engine-programmer.md +26 -0
  11. package/.claude/agents/nccgs-game-design-lead.md +26 -0
  12. package/.claude/agents/nccgs-game-designer.md +26 -0
  13. package/.claude/agents/nccgs-gameplay-programmer.md +26 -0
  14. package/.claude/agents/nccgs-level-designer.md +26 -0
  15. package/.claude/agents/nccgs-live-ops-designer.md +26 -0
  16. package/.claude/agents/nccgs-localization-lead.md +26 -0
  17. package/.claude/agents/nccgs-narrative-lead.md +26 -0
  18. package/.claude/agents/nccgs-network-programmer.md +26 -0
  19. package/.claude/agents/nccgs-performance-analyst.md +26 -0
  20. package/.claude/agents/nccgs-producer.md +26 -0
  21. package/.claude/agents/nccgs-production-coordinator.md +23 -0
  22. package/.claude/agents/nccgs-programming-lead.md +26 -0
  23. package/.claude/agents/nccgs-prototyper.md +26 -0
  24. package/.claude/agents/nccgs-qa-engineer.md +26 -0
  25. package/.claude/agents/nccgs-qa-lead.md +26 -0
  26. package/.claude/agents/nccgs-release-engineer.md +26 -0
  27. package/.claude/agents/nccgs-release-lead.md +26 -0
  28. package/.claude/agents/nccgs-security-engineer.md +26 -0
  29. package/.claude/agents/nccgs-sound-designer.md +26 -0
  30. package/.claude/agents/nccgs-systems-designer.md +26 -0
  31. package/.claude/agents/nccgs-technical-architect.md +26 -0
  32. package/.claude/agents/nccgs-technical-artist.md +26 -0
  33. package/.claude/agents/nccgs-technical-director.md +26 -0
  34. package/.claude/agents/nccgs-tools-programmer.md +26 -0
  35. package/.claude/agents/nccgs-ui-programmer.md +26 -0
  36. package/.claude/agents/nccgs-unity-build-specialist.md +26 -0
  37. package/.claude/agents/nccgs-unity-content-specialist.md +26 -0
  38. package/.claude/agents/nccgs-unity-implementer.md +26 -0
  39. package/.claude/agents/nccgs-unity-rendering-specialist.md +26 -0
  40. package/.claude/agents/nccgs-unity-systems-specialist.md +26 -0
  41. package/.claude/agents/nccgs-unity-ui-specialist.md +26 -0
  42. package/.claude/agents/nccgs-ux-designer.md +26 -0
  43. package/.claude/agents/nccgs-verification-engineer.md +26 -0
  44. package/.claude/agents/nccgs-world-builder.md +26 -0
  45. package/.claude/agents/nccgs-writer.md +26 -0
  46. package/.claude/nccgs/THIRD_PARTY_NOTICES.md +13 -0
  47. package/.claude/nccgs/VERSION +1 -0
  48. package/.claude/nccgs/constitution.md +131 -0
  49. package/.claude/nccgs/hooks/agent-audit.mjs +10 -0
  50. package/.claude/nccgs/hooks/common.mjs +41 -0
  51. package/.claude/nccgs/hooks/post-compact.mjs +1 -0
  52. package/.claude/nccgs/hooks/pre-compact.mjs +8 -0
  53. package/.claude/nccgs/hooks/protect-git.mjs +22 -0
  54. package/.claude/nccgs/hooks/protect-write.mjs +17 -0
  55. package/.claude/nccgs/hooks/session-start.mjs +15 -0
  56. package/.claude/nccgs/hooks/session-stop.mjs +7 -0
  57. package/.claude/nccgs/protocols/agent-contract.md +34 -0
  58. package/.claude/nccgs/protocols/context-packets.md +13 -0
  59. package/.claude/nccgs/protocols/evidence.md +15 -0
  60. package/.claude/nccgs/protocols/model-routing.md +22 -0
  61. package/.claude/nccgs/protocols/orchestration.md +26 -0
  62. package/.claude/nccgs/protocols/unity-boundary.md +11 -0
  63. package/.claude/nccgs/settings.fragment.json +77 -0
  64. package/.claude/nccgs/studio.json +347 -0
  65. package/.claude/nccgs/tools/configure-models.mjs +39 -0
  66. package/.claude/nccgs/unity-skills-manifest.json +727 -0
  67. package/.claude/nccgs/workflow-catalog.json +317 -0
  68. package/.claude/rules/nccgs-canonical-docs.md +19 -0
  69. package/.claude/rules/nccgs-editor-tools.md +12 -0
  70. package/.claude/rules/nccgs-localization.md +12 -0
  71. package/.claude/rules/nccgs-networking.md +13 -0
  72. package/.claude/rules/nccgs-performance.md +14 -0
  73. package/.claude/rules/nccgs-rendering.md +16 -0
  74. package/.claude/rules/nccgs-security.md +13 -0
  75. package/.claude/rules/nccgs-tests.md +18 -0
  76. package/.claude/rules/nccgs-ui.md +14 -0
  77. package/.claude/rules/nccgs-unity-assets.md +21 -0
  78. package/.claude/rules/nccgs-unity-code.md +22 -0
  79. package/.claude/skills/accessibility-review/SKILL.md +14 -0
  80. package/.claude/skills/architecture-decision/SKILL.md +14 -0
  81. package/.claude/skills/asset-audit/SKILL.md +14 -0
  82. package/.claude/skills/audit/SKILL.md +16 -0
  83. package/.claude/skills/audit/references/dimensions.md +46 -0
  84. package/.claude/skills/balance-review/SKILL.md +14 -0
  85. package/.claude/skills/bug-triage/SKILL.md +14 -0
  86. package/.claude/skills/build-live-game/SKILL.md +317 -0
  87. package/.claude/skills/build-live-game/references/achievements.md +779 -0
  88. package/.claude/skills/build-live-game/references/apis.md +280 -0
  89. package/.claude/skills/build-live-game/references/authentication.md +437 -0
  90. package/.claude/skills/build-live-game/references/battlepass.md +860 -0
  91. package/.claude/skills/build-live-game/references/cloud-code.md +563 -0
  92. package/.claude/skills/build-live-game/references/cloud-save.md +474 -0
  93. package/.claude/skills/build-live-game/references/deployment.md +216 -0
  94. package/.claude/skills/build-live-game/references/player-account.md +813 -0
  95. package/.claude/skills/build-live-game/references/remote-config.md +96 -0
  96. package/.claude/skills/build-live-game/references/tooling.md +431 -0
  97. package/.claude/skills/closure/SKILL.md +14 -0
  98. package/.claude/skills/code-review/SKILL.md +14 -0
  99. package/.claude/skills/compatibility-review/SKILL.md +14 -0
  100. package/.claude/skills/context-pack/SKILL.md +14 -0
  101. package/.claude/skills/dependency-review/SKILL.md +14 -0
  102. package/.claude/skills/design/SKILL.md +20 -0
  103. package/.claude/skills/design-review/SKILL.md +14 -0
  104. package/.claude/skills/evidence-review/SKILL.md +14 -0
  105. package/.claude/skills/hotfix/SKILL.md +14 -0
  106. package/.claude/skills/implement-in-app-purchases/README.md +233 -0
  107. package/.claude/skills/implement-in-app-purchases/SKILL.md +158 -0
  108. package/.claude/skills/implement-in-app-purchases/references/api-notes.md +562 -0
  109. package/.claude/skills/implement-in-app-purchases/references/codeless-catalog.md +331 -0
  110. package/.claude/skills/implement-in-app-purchases/references/convert-adapty.md +268 -0
  111. package/.claude/skills/implement-in-app-purchases/references/convert-essentialkit.md +239 -0
  112. package/.claude/skills/implement-in-app-purchases/references/convert-revenuecat.md +275 -0
  113. package/.claude/skills/implement-in-app-purchases/references/convert-unipay.md +145 -0
  114. package/.claude/skills/implement-in-app-purchases/references/migration-v4-to-v5.md +204 -0
  115. package/.claude/skills/implement-in-app-purchases/references/path-add-iap-to-new-project.md +198 -0
  116. package/.claude/skills/implement-in-app-purchases/references/path-convert-native-google-billing.md +356 -0
  117. package/.claude/skills/implement-in-app-purchases/references/path-convert-native-storekit.md +446 -0
  118. package/.claude/skills/implement-in-app-purchases/references/path-implement-iap-d2c.md +680 -0
  119. package/.claude/skills/implement-in-app-purchases/references/platform-notes.md +204 -0
  120. package/.claude/skills/implement-in-app-purchases/references/pre-check.md +205 -0
  121. package/.claude/skills/incident-recovery/SKILL.md +14 -0
  122. package/.claude/skills/initialize-ai-navigation/SKILL.md +95 -0
  123. package/.claude/skills/initialize-ai-navigation/references/navigation-system.md +794 -0
  124. package/.claude/skills/levelplay-unity-integration/CHANGELOG.md +57 -0
  125. package/.claude/skills/levelplay-unity-integration/README.md +74 -0
  126. package/.claude/skills/levelplay-unity-integration/SKILL.md +1126 -0
  127. package/.claude/skills/levelplay-unity-integration/references/banner-api.md +920 -0
  128. package/.claude/skills/levelplay-unity-integration/references/best-practices.md +536 -0
  129. package/.claude/skills/levelplay-unity-integration/references/ilrd-api.md +337 -0
  130. package/.claude/skills/levelplay-unity-integration/references/initialization-api.md +630 -0
  131. package/.claude/skills/levelplay-unity-integration/references/interstitial-api.md +899 -0
  132. package/.claude/skills/levelplay-unity-integration/references/ios-setup.md +491 -0
  133. package/.claude/skills/levelplay-unity-integration/references/migration-sdk-9.md +666 -0
  134. package/.claude/skills/levelplay-unity-integration/references/privacy-settings.md +608 -0
  135. package/.claude/skills/levelplay-unity-integration/references/rewarded-api.md +902 -0
  136. package/.claude/skills/localization/SKILL.md +135 -0
  137. package/.claude/skills/localization/references/api-notes.md +76 -0
  138. package/.claude/skills/localization/resources/L10nBatchProcessor.cs +69 -0
  139. package/.claude/skills/localization/resources/LocalizedFontAsset.cs +18 -0
  140. package/.claude/skills/localize-game/SKILL.md +14 -0
  141. package/.claude/skills/migrate-project/SKILL.md +21 -0
  142. package/.claude/skills/migrate-project/references/procedure.md +63 -0
  143. package/.claude/skills/milestone-review/SKILL.md +14 -0
  144. package/.claude/skills/new-unity-project/SKILL.md +179 -0
  145. package/.claude/skills/optimize-audio/SKILL.md +199 -0
  146. package/.claude/skills/optimize-audio/resources/audio-import-api.md +146 -0
  147. package/.claude/skills/optimize-audio/resources/platform-settings.md +48 -0
  148. package/.claude/skills/optimize-text-mesh-pro/SKILL.md +182 -0
  149. package/.claude/skills/optimize-web/SKILL.md +393 -0
  150. package/.claude/skills/optimize-web/resources/WebOptimizer.cs +21 -0
  151. package/.claude/skills/optimize-web/resources/toktx-examples.sh +11 -0
  152. package/.claude/skills/performance-audit/SKILL.md +14 -0
  153. package/.claude/skills/physics-3d-collision/SKILL.md +442 -0
  154. package/.claude/skills/physics-3d-collision/references/troubleshooting.md +41 -0
  155. package/.claude/skills/physics-3d-collision/resources/CollisionDebugger.cs +33 -0
  156. package/.claude/skills/plan-feature/SKILL.md +14 -0
  157. package/.claude/skills/playtest/SKILL.md +14 -0
  158. package/.claude/skills/project-stage/SKILL.md +14 -0
  159. package/.claude/skills/prototype-feature/SKILL.md +14 -0
  160. package/.claude/skills/qa-plan/SKILL.md +14 -0
  161. package/.claude/skills/release/SKILL.md +18 -0
  162. package/.claude/skills/release-readiness/SKILL.md +14 -0
  163. package/.claude/skills/retrospective/SKILL.md +14 -0
  164. package/.claude/skills/review/SKILL.md +16 -0
  165. package/.claude/skills/security-audit/SKILL.md +14 -0
  166. package/.claude/skills/setup-multiplayer-services/SKILL.md +39 -0
  167. package/.claude/skills/setup-multiplayer-services/references/dgs-entrypoint.md +79 -0
  168. package/.claude/skills/setup-multiplayer-services/references/entrypoints.md +213 -0
  169. package/.claude/skills/setup-multiplayer-services/references/examples.md +33 -0
  170. package/.claude/skills/setup-multiplayer-services/references/implementation-fit.md +30 -0
  171. package/.claude/skills/setup-multiplayer-services/references/underlying-services.md +11 -0
  172. package/.claude/skills/setup-multiplayer-services/references/workflows-prerequisites.md +17 -0
  173. package/.claude/skills/setup-vivox-voice-chat/SKILL.md +118 -0
  174. package/.claude/skills/setup-vivox-voice-chat/evals/.env.example +6 -0
  175. package/.claude/skills/setup-vivox-voice-chat/evals/README.md +101 -0
  176. package/.claude/skills/setup-vivox-voice-chat/evals/promptfooconfig.yaml +32 -0
  177. package/.claude/skills/setup-vivox-voice-chat/evals/tests/init-and-login.yaml +76 -0
  178. package/.claude/skills/setup-vivox-voice-chat/evals/tests/text-chat.yaml +65 -0
  179. package/.claude/skills/setup-vivox-voice-chat/evals/tests/voice-channels.yaml +74 -0
  180. package/.claude/skills/setup-vivox-voice-chat/references/events-and-participants.md +79 -0
  181. package/.claude/skills/setup-vivox-voice-chat/references/init-and-login.md +92 -0
  182. package/.claude/skills/setup-vivox-voice-chat/references/text-chat.md +93 -0
  183. package/.claude/skills/setup-vivox-voice-chat/references/troubleshooting.md +47 -0
  184. package/.claude/skills/setup-vivox-voice-chat/references/voice-channels.md +90 -0
  185. package/.claude/skills/shader-graph-create-custom-node/SKILL.md +25 -0
  186. package/.claude/skills/shader-graph-create-custom-node/resources/all_hints.hlsl +182 -0
  187. package/.claude/skills/sprint-plan/SKILL.md +14 -0
  188. package/.claude/skills/sprite-editor/SKILL.md +66 -0
  189. package/.claude/skills/sprite-editor/references/api_reference.md +151 -0
  190. package/.claude/skills/sprite-editor/references/background.md +112 -0
  191. package/.claude/skills/sprite-editor/references/templates.md +72 -0
  192. package/.claude/skills/sprite-editor/scripts/AutomaticSliceTexture.cs +40 -0
  193. package/.claude/skills/sprite-editor/scripts/GenerateNewSpriteRects.cs +200 -0
  194. package/.claude/skills/sprite-editor/scripts/GetTextureSourceImageSize.cs +32 -0
  195. package/.claude/skills/sprite-editor/scripts/GetTextureToSlice.cs +55 -0
  196. package/.claude/skills/sprite-editor/scripts/GridSliceTexture.cs +40 -0
  197. package/.claude/skills/sprite-editor/scripts/IsometricSliceTexture.cs +141 -0
  198. package/.claude/skills/sprite-editor/scripts/README.md +134 -0
  199. package/.claude/skills/sprite-editor/scripts/SetPivotExample.cs +58 -0
  200. package/.claude/skills/sprite-editor/scripts/SpriteToPng.cs +88 -0
  201. package/.claude/skills/status/SKILL.md +16 -0
  202. package/.claude/skills/story-readiness/SKILL.md +14 -0
  203. package/.claude/skills/test/SKILL.md +16 -0
  204. package/.claude/skills/ui/SKILL.md +142 -0
  205. package/.claude/skills/ui-imgui/SKILL.md +186 -0
  206. package/.claude/skills/ui-imgui/references/gui-elements.md +156 -0
  207. package/.claude/skills/ui-imgui/references/templates.md +141 -0
  208. package/.claude/skills/ui-review/SKILL.md +14 -0
  209. package/.claude/skills/ui-ugui/SKILL.md +282 -0
  210. package/.claude/skills/ui-ugui/references/scrollview-setup.md +29 -0
  211. package/.claude/skills/ui-uitk/SKILL.md +235 -0
  212. package/.claude/skills/ui-uitk/references/common-issues.md +74 -0
  213. package/.claude/skills/ui-uitk/references/custom-elements.md +241 -0
  214. package/.claude/skills/ui-uitk/references/painter2d.md +282 -0
  215. package/.claude/skills/ui-uitk/references/pointermanipulator-guide.md +94 -0
  216. package/.claude/skills/ui-uitk/references/svg-icons.md +136 -0
  217. package/.claude/skills/ui-uitk/references/ui-runtime-binding.md +234 -0
  218. package/.claude/skills/ui-uitk/references/uss-guide.md +138 -0
  219. package/.claude/skills/unity-cli/CHANGELOG.md +233 -0
  220. package/.claude/skills/unity-cli/SECURITY.md +22 -0
  221. package/.claude/skills/unity-cli/SKILL.md +414 -0
  222. package/.claude/skills/unity-cli/references/auth-license-cloud.md +146 -0
  223. package/.claude/skills/unity-cli/references/build-run-test.md +349 -0
  224. package/.claude/skills/unity-cli/references/collaboration.md +472 -0
  225. package/.claude/skills/unity-cli/references/config-hub.md +103 -0
  226. package/.claude/skills/unity-cli/references/diagnostics-maintenance.md +326 -0
  227. package/.claude/skills/unity-cli/references/editors-install.md +327 -0
  228. package/.claude/skills/unity-cli/references/integration-advanced.md +472 -0
  229. package/.claude/skills/unity-cli/references/projects-templates.md +574 -0
  230. package/.claude/skills/unity-package-management/SKILL.md +304 -0
  231. package/.claude/skills/unity-package-management/references/select-packages.md +108 -0
  232. package/.claude/skills/urp-postprocessing/SKILL.md +188 -0
  233. package/.claude/skills/urp-postprocessing/references/code-templates.md +119 -0
  234. package/.claude/skills/urp-postprocessing/references/effect-reference.md +86 -0
  235. package/.claude/skills/validate-urp-render-graph-renderer-feature/SKILL.md +269 -0
  236. package/.claude/skills/work/SKILL.md +36 -0
  237. package/.claude/skills/work/references/classification.md +41 -0
  238. package/.claude/skills/work/references/closure.md +50 -0
  239. package/.claude/skills/work/references/feature-contracts.md +32 -0
  240. package/.claude/skills/work/references/verification.md +26 -0
  241. package/CLAUDE.md +6 -0
  242. package/LICENSE +21 -0
  243. package/README.md +162 -0
  244. package/THIRD_PARTY_NOTICES.md +23 -0
  245. package/UPGRADING.md +32 -0
  246. package/VERSION +1 -0
  247. package/docs/ARCHITECTURE.md +73 -0
  248. package/docs/HUONG-DAN-MIGRATE-VA-SU-DUNG.md +324 -0
  249. package/docs/MIGRATION-MATRIX.md +23 -0
  250. package/docs/PROJECT-POLICY.md +67 -0
  251. package/docs/WORKFLOWS.md +61 -0
  252. package/package-assets/setup-vivox-voice-chat-evals.gitignore +7 -0
  253. package/package.json +41 -0
  254. package/scaffold/.nccgs/bugs/.gitkeep +1 -0
  255. package/scaffold/.nccgs/closures/.gitkeep +1 -0
  256. package/scaffold/.nccgs/context/.gitkeep +1 -0
  257. package/scaffold/.nccgs/decisions/.gitkeep +1 -0
  258. package/scaffold/.nccgs/evidence/.gitkeep +1 -0
  259. package/scaffold/.nccgs/features/.gitkeep +1 -0
  260. package/scaffold/.nccgs/migrations/.gitkeep +1 -0
  261. package/scaffold/.nccgs/playtests/.gitkeep +1 -0
  262. package/scaffold/.nccgs/project.yaml +103 -0
  263. package/scaffold/.nccgs/requirements.yaml +10 -0
  264. package/scaffold/.nccgs/reviews/.gitkeep +1 -0
  265. package/scaffold/.nccgs/state.md +40 -0
  266. package/scaffold/.nccgs/templates/agent-handoff.md +25 -0
  267. package/scaffold/.nccgs/templates/architecture-decision.md +27 -0
  268. package/scaffold/.nccgs/templates/closure-record.md +51 -0
  269. package/scaffold/.nccgs/templates/context-packet.yaml +17 -0
  270. package/scaffold/.nccgs/templates/evidence-record.md +23 -0
  271. package/scaffold/.nccgs/templates/feature-contract.md +35 -0
  272. package/scaffold/.nccgs/templates/migration-plan.md +40 -0
  273. package/scaffold/.nccgs/templates/waiver.md +11 -0
  274. package/scripts/cli.mjs +56 -0
  275. package/scripts/install.mjs +267 -0
  276. package/scripts/sync-unity-skills.mjs +126 -0
  277. package/scripts/validate.mjs +205 -0
  278. package/tests/framework.test.mjs +121 -0
@@ -0,0 +1,414 @@
1
+ ---
2
+ name: unity-cli
3
+ 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.
4
+ allowed-tools:
5
+ - Bash
6
+ ---
7
+
8
+ # Unity CLI
9
+
10
+ ## Drive a running Unity Editor (if one is open)
11
+
12
+ **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.
13
+
14
+ ```bash
15
+ unity status # confirm a connected Editor (look for state "ready")
16
+ unity command # list the commands the Editor exposes
17
+ unity command editor_play # run one — e.g. enter Play mode
18
+ # Run arbitrary C# — e.g. add a GameObject named "Joe" — when the Editor exposes eval:
19
+ unity command eval 'new UnityEngine.GameObject("Joe");'
20
+ ```
21
+
22
+ Requires 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).
23
+
24
+ > **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).
25
+
26
+ ## Step 1: Install the CLI (if not already installed)
27
+
28
+ First check if the CLI is available:
29
+
30
+ ```bash
31
+ which unity && unity --version
32
+ ```
33
+
34
+ If not found, install it:
35
+
36
+ **macOS / Linux**
37
+ ```bash
38
+ curl -fsSL https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.sh | UNITY_CLI_CHANNEL=beta bash
39
+ ```
40
+
41
+ **Windows (PowerShell)**
42
+ ```powershell
43
+ $env:UNITY_CLI_CHANNEL='beta'; irm https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.ps1 | iex
44
+ ```
45
+
46
+ After installing, open a new shell so `unity` is on PATH, then verify:
47
+
48
+ ```bash
49
+ unity --version
50
+ ```
51
+
52
+ If the install script fails or the binary is still not found, tell the user and stop.
53
+
54
+ ## Step 2: Verify it works
55
+
56
+ ```bash
57
+ unity --version
58
+ ```
59
+
60
+ If this fails with a permissions error or crash, the CLI installation may be broken. Suggest re-running the install script.
61
+
62
+ ---
63
+
64
+ ## Global flags
65
+
66
+ These work on every command:
67
+
68
+ | Flag | Description |
69
+ |---|---|
70
+ | `--format <fmt>` | Output format: `human` (default), `json`, `tsv`, `ndjson`, `github`. Also via `UNITY_FORMAT` env var. |
71
+ | `--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. |
72
+ | `--no-banner` | Suppress the branded header — use in scripts |
73
+ | `--no-pager` | Disable the pager for long human output. Also via `UNITY_NO_PAGER` (presence-based — any value, including `0`, disables it). |
74
+ | `--non-interactive` | Disable all interactive prompts — use in CI |
75
+ | `--quiet` | Suppress non-essential output |
76
+ | `--verbose` | Print full error details (stack trace + cause chain) on failure. Also via `UNITY_VERBOSE`. |
77
+ | `--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. |
78
+ | `--proxy-disable` | Disable proxy for this invocation, ignoring all sources (env vars, persisted config, system settings). |
79
+ | `--log-proxy` | Log one redacted entry per outbound request (host-only URL, resolved proxy, auth source, status, duration) to `proxy-request.json` — for reproducing proxy issues for support. Also via `UNITY_LOG_PROXY=1` or the persisted `proxyRequestLogging` setting. |
80
+ | `--no-log-proxy` | Opt a single invocation out of proxy request logging when it's enabled globally. |
81
+
82
+ **Always use `--format json` when you need to parse output programmatically.**
83
+
84
+ **Long human output is paged, on the `git log` model.** The long listing surfaces — `unity command`, `unity releases`, `unity editors`, `unity changelog`, `unity logs` — route stdout through a pager. The default is `less -RFX`, which quits immediately when the content fits one screen, so short output shows no pager UI at all. Resolution order is `$UNITY_PAGER` → `$PAGER` → `less -RFX` → `more.com` on Windows; when none can be spawned, output falls back to a direct write.
85
+
86
+ **It never pages when output isn't a human reading a terminal**, so scripts need no special handling: paging is off for non-TTY stdout (pipes, redirects), for every machine format (`json`, `tsv`, `ndjson`), under `--quiet`, under `--no-pager` / `UNITY_NO_PAGER`, when `TERM=dumb`, and inside `unity shell`. Quitting the pager early (`q`) is silent and leaves the command's exit code untouched.
87
+
88
+ A 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.
89
+
90
+ ## Environment variables
91
+
92
+ All CLI env vars use the `UNITY_` prefix. A CLI flag always overrides the corresponding env var.
93
+
94
+ | Variable | Mirrors flag | Description |
95
+ |---|---|---|
96
+ | `UNITY_FORMAT` | `--format` | Output format (`human`, `json`, `tsv`, `ndjson`, `github`). `HUB_FORMAT` is a deprecated alias. |
97
+ | `UNITY_EDITOR_VERSION` | `--editor-version` | Editor version (e.g. `2023.3.0f1`, `latest`, `lts`). |
98
+ | `UNITY_ARCHITECTURE` | `--architecture` | Chip architecture (`x86_64`, `arm64`). |
99
+ | `UNITY_PROJECT_PATH` | path argument | Project path — used by `open`, and also honored by `status` and the cloud commands. |
100
+ | `UNITY_QUIET` | `--quiet` | Suppress non-essential output. |
101
+ | `UNITY_VERBOSE` | `--verbose` | Show full error details on failure. |
102
+ | `UNITY_NON_INTERACTIVE` | `--non-interactive` | Disable interactive prompts. |
103
+ | `UNITY_NO_BANNER` | `--no-banner` | Suppress the branded banner. |
104
+ | `UNITY_NO_PAGER` | `--no-pager` | Disable the pager for long human output. Presence-based: any value disables it, including `0`. |
105
+ | `UNITY_PAGER` | — | Pager command to use, taking precedence over `$PAGER` (e.g. `less -S`). Honors flags and quoting; falls back to `less -RFX`, then `more.com` on Windows. |
106
+ | `UNITY_RUN_TIMEOUT` | `--timeout` | Timeout for `unity run` in seconds. |
107
+ | `UNITY_TEST_TIMEOUT` | `--timeout` | Timeout for `unity test` in seconds. |
108
+ | `UNITY_CLOUD_ORG` | `--cloud-org` | Active Unity Cloud organization id or name for a single call. |
109
+ | `UNITY_SERVICE_ACCOUNT_ID` | — | Service account client ID for non-interactive (CI) auth. |
110
+ | `UNITY_SERVICE_ACCOUNT_SECRET` | — | Service account client secret for non-interactive (CI) auth. |
111
+ | `UNITY_PROXY` | `--proxy` | HTTP/HTTPS/SOCKS/PAC proxy URL. Takes precedence over `HTTPS_PROXY`/`HTTP_PROXY`/`ALL_PROXY` and the persisted `proxy.json` setting. |
112
+ | `UNITY_NO_UPDATE_CHECK` | — | Disable the background "update available" check (see `unity config update-check`). |
113
+ | `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. |
114
+ | `UNITY_NO_CRASH_REPORT` | — | Disable anonymous crash/error reporting (Sentry) entirely. |
115
+ | `UNITY_LOG_PROXY` | `--log-proxy` | Log one redacted entry per outbound request to `proxy-request.json`. Truthy values: `1`, `true`. |
116
+ | `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. |
117
+ | `UNITY_INSTALL_RETRIES` | `--retries` | Number of times `install-modules` retries a module whose download/validation fails. `0` disables retries. |
118
+
119
+ **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.
120
+
121
+ ## Getting help
122
+
123
+ If a command fails or you're unsure of the available options, append `-h` or `--help` to any command or subcommand:
124
+
125
+ ```bash
126
+ unity --help
127
+ unity install --help
128
+ unity projects --help
129
+ unity projects create --help
130
+ ```
131
+
132
+ This works at every level of the command hierarchy.
133
+
134
+ ## Exit codes
135
+
136
+ | Code | Meaning |
137
+ |---|---|
138
+ | 0 | Success |
139
+ | 1 | General error |
140
+ | 2 | Bad arguments |
141
+ | 3 | Authentication failure |
142
+ | 4 | Precondition not met (e.g. no license active, floating server not configured) |
143
+ | 6 | Command-specific failure |
144
+ | 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. |
145
+ | 130 | Interrupted — Ctrl+C / SIGINT (128 + 2) |
146
+ | 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). |
147
+
148
+ The `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.
149
+
150
+ ---
151
+
152
+ ## Commands
153
+
154
+ The full per-command reference — syntax, flags, and examples — lives in grouped files under
155
+ [`references/`](references/). **Read the file for the command group you need**; all the global
156
+ flags, environment variables, and exit codes above apply throughout. Every command also supports
157
+ `-h` / `--help` (see [Getting help](#getting-help)).
158
+
159
+ | Commands | Reference file |
160
+ |---|---|
161
+ | `auth` (login / logout / status / list / switch / default), `license` (activate / return / server), `cloud` (org / project) | [auth-license-cloud.md](references/auth-license-cloud.md) |
162
+ | `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) |
163
+ | `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) |
164
+ | `config` (proxy / update-check), `hub install` | [config-hub.md](references/config-hub.md) |
165
+ | `run`, `test`, `build` | [build-run-test.md](references/build-run-test.md) |
166
+ | `logs`, `doctor`, `env`, `cache`, `analytics`, `changelog`, `language`, `completion`, `bug`, `upgrade`, `self-uninstall`, `diagnose proxy` | [diagnostics-maintenance.md](references/diagnostics-maintenance.md) |
167
+ | `mcp` (+ `configure`), `skill` (install / refresh), connected editors (`pipeline` / `command` / `status` / `list`), `shell` | [integration-advanced.md](references/integration-advanced.md) |
168
+ | `collaboration` (alias `collab`) — `annotations` / `attachments` / `thumbnail` / `reactions` / `read` / `subscribe` / `jira` | [collaboration.md](references/collaboration.md) |
169
+
170
+ ## Common workflows
171
+
172
+ ### Edit a scene, GameObject, or asset — `unity status` first
173
+
174
+ **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.
175
+
176
+ ```bash
177
+ unity status # is an Editor connected? (look for state "ready")
178
+ unity command # discover the scene/GameObject commands THIS Editor exposes
179
+ # then drive it with the commands it lists — for example, if your Editor exposes them:
180
+ unity command create_gameobject # act on the live, active scene
181
+ unity command save_scene # persist the active scene
182
+ ```
183
+
184
+ Command names are defined by the Editor, so run `unity command` (or `unity list`) to see the exact set — don't assume a name.
185
+
186
+ > **Never hand-edit `.unity`, `.prefab`, or `.asset` YAML while a live Editor is reachable.** Raw-file edits are:
187
+ > - **error-prone** — fileIDs and GUIDs are assigned by hand and easy to get wrong;
188
+ > - **invisible** to the running Editor until a reimport, so the change silently fails to take effect; and
189
+ > - **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.
190
+
191
+ Only fall back to editing files directly when `unity status` shows **no** reachable Editor — and say so explicitly ("no live Editor detected, editing the file directly").
192
+
193
+ **One exception worth ruling out first:** 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).
194
+
195
+ ### Bootstrap a new project from scratch
196
+
197
+ > For a **guided** end-to-end experience — concept questions, installing the Editor in the
198
+ > background while you plan, package selection, and monetization handoff — use the
199
+ > **`new-unity-project`** skill. This section is the raw CLI recipe that skill builds on; use it
200
+ > directly when you just want the commands.
201
+
202
+ Take an idea to a running, version-controlled project using only the CLI. Decide the **target
203
+ platforms first** — they determine which Editor modules you install in step 2. You can add
204
+ modules later (`unity install-modules`), but a project can't build for a platform until that
205
+ platform's module is installed, so it's simplest to decide up front.
206
+
207
+ ```bash
208
+ # 1. Confirm the CLI works and you're signed in and licensed (see references/auth-license-cloud.md).
209
+ unity --version
210
+ unity auth status --format json # if signed out: unity auth login
211
+ unity license status --format json # if none active: unity license activate
212
+
213
+ # 2. Pick and install an Editor with the modules your target platforms need.
214
+ # Default to the latest LTS (most stable, ~2 years of patches). Reach for a Tech-stream
215
+ # release (--stream tech) only for a feature not yet in LTS; treat --stream beta/alpha as
216
+ # evaluation-only, never for a project you intend to ship. A deadline argues for LTS.
217
+ # (lts / latest aliases work wherever a version is accepted.)
218
+ unity releases --stream lts --limit 5 --format json
219
+ unity install lts --module android --module ios --yes --accept-eula # add --module webgl, etc.
220
+ unity editors --installed --format json # confirm it landed
221
+
222
+ # 3. List the real template ids this Editor offers — don't guess them.
223
+ unity templates list --editor lts --format json
224
+ # Common ids: com.unity.template.3d, com.unity.template.2d, and a URP template (id varies by version).
225
+
226
+ # 4. Create the project. The first positional arg is the NAME; --path sets the parent directory.
227
+ # All options supplied, so it won't prompt; add --non-interactive in CI.
228
+ unity projects create "MyGame" --path ~/UnityProjects \
229
+ --editor-version lts --template com.unity.template.3d
230
+ ```
231
+
232
+ **Source control — let the user choose.** The CLI publishes the new project to a fresh remote in
233
+ one step for any provider. **Always pass tokens on stdin** (`--git-token-stdin`) so secrets never
234
+ land in shell history or the process list. Pick based on the project — don't default to one:
235
+
236
+ - **Git — GitHub / GitLab** (`--vcs github` / `--vcs gitlab`). Ubiquitous. For asset-heavy games
237
+ add **Git LFS** (`--git-lfs`) so large binaries don't bloat history.
238
+ - **Unity Version Control — UVCS** (`--vcs uvcs`). Unity's own VCS, built for large binary game
239
+ assets: it handles them natively (**no LFS needed**) and supports file locking — often the
240
+ better fit for art-heavy projects or larger teams. Auth uses your Unity sign-in; `--vcs-region`
241
+ selects the region.
242
+
243
+ ```bash
244
+ # Git (GitHub) — drop --git-lfs if the game isn't asset-heavy. Add --no-initial-commit if you
245
+ # want to add packages/assets BEFORE the first commit (see the new-unity-project flow).
246
+ unity projects create "MyGame" --path ~/UnityProjects \
247
+ --editor-version lts --template com.unity.template.3d \
248
+ --vcs github --git-namespace my-org --git-repo my-game \
249
+ --git-visibility private --git-default-branch main --git-token-stdin --git-lfs
250
+
251
+ # Unity Version Control (UVCS) — handles binaries natively, so no LFS:
252
+ unity projects create "MyGame" --path ~/UnityProjects \
253
+ --editor-version lts --template com.unity.template.3d \
254
+ --vcs uvcs --git-namespace my-org --git-repo my-game --vcs-region <region>
255
+ ```
256
+
257
+ Feed the token to `--git-token-stdin` from a secret store, never a literal — e.g.
258
+ `… --git-token-stdin <<<"$GIT_TOKEN"` where `$GIT_TOKEN` comes from your CI/secret manager
259
+ (UVCS uses your Unity sign-in, so no token is needed).
260
+
261
+ **Git tokens belong to the user's credential manager, not the CLI.** When no token flag or env var
262
+ is given, the CLI asks `git credential fill` and uses whatever the configured helper returns; it
263
+ stores nothing it is passed or told. Don't suggest the CLI can save a Git token, and don't reach for
264
+ a token flag when the user already has a working credential helper. If they want a different token
265
+ per organization, that is `git config --global credential.useHttpPath true` plus a multi-account
266
+ helper such as [Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager).
267
+ The CLI passes the full repo URL so the helper can discriminate, but it never installs or
268
+ reconfigures a helper. `UNITY_GITHUB_TOKEN` / `UNITY_GITLAB_TOKEN` are one token per provider, so a
269
+ CI job spanning several orgs should pass `--git-token-stdin` per invocation instead. See
270
+ [references/projects-templates.md](references/projects-templates.md) for the full
271
+ source-control flag set. For a purely local Git repository instead, initialize git with a
272
+ Unity-appropriate ignore so the multi-GB `Library/` and other generated folders are never committed:
273
+
274
+ ```bash
275
+ cd ~/UnityProjects/MyGame
276
+ git init -b main
277
+ # Download (do not pipe to a shell) a maintained Unity .gitignore:
278
+ curl -fsSL https://raw.githubusercontent.com/github/gitignore/main/Unity.gitignore -o .gitignore
279
+
280
+ # Asset-heavy game? Keep large binaries out of git history with Git LFS:
281
+ git lfs install
282
+ git lfs track "*.psd" "*.fbx" "*.wav" "*.mp3" "*.png" # adjust to your asset types
283
+ git add .gitattributes
284
+
285
+ git add -A
286
+ git status # sanity-check: Library/ Temp/ obj/ Build/ must NOT be staged
287
+ git commit -m "Initial Unity project: MyGame"
288
+ git ls-files | grep -c '^Library/' # must print 0
289
+ ```
290
+
291
+ **What the CLI does and doesn't cover.** The CLI handles editor, project, and source control.
292
+ It does **not** manage UPM (Unity Package Manager) packages — to add packages beyond the
293
+ template headlessly, use the **`unity-package-management`** skill (C# PackageManager Client
294
+ API). For monetization/backend, hand off to the dedicated skills: `implement-in-app-purchases`
295
+ (IAP), `levelplay-unity-integration` (ads), or `build-live-game` (accounts, cloud save,
296
+ economy, remote config, leaderboards). Open the project to start working:
297
+ `unity open ~/UnityProjects/MyGame`.
298
+
299
+ ### Find and install a missing editor
300
+
301
+ ```bash
302
+ # 1. Check what's installed
303
+ unity editors --installed --format json
304
+
305
+ # 2. Browse available LTS versions
306
+ unity releases --lts --limit 5 --format json
307
+
308
+ # 3. Install
309
+ unity install 6000.0.47f1 --yes --accept-eula
310
+ ```
311
+
312
+ ### Open a project with the correct editor
313
+
314
+ ```bash
315
+ # 1. Check the project's required editor version
316
+ unity projects info /path/to/MyProject --format json
317
+ # Look at "editorVersion" in the result
318
+
319
+ # 2. Confirm that editor is installed
320
+ unity editors --installed --format json
321
+
322
+ # 3. Open (warns if the editor version is missing)
323
+ unity open /path/to/MyProject
324
+ ```
325
+
326
+ ### CI: activate a license, then build
327
+
328
+ ```bash
329
+ # 1. Sign in non-interactively with a service account
330
+ unity auth login --client-id "$UNITY_SERVICE_ACCOUNT_ID" --secret-from-stdin <<<"$UNITY_SERVICE_ACCOUNT_SECRET"
331
+
332
+ # 2. Activate the entitlement license (or use --serial / --floating)
333
+ unity license activate
334
+
335
+ # 3. Build
336
+ unity build /path/to/MyProject \
337
+ --editor-version 6000.0.47f1 \
338
+ --target StandaloneLinux64 \
339
+ --execute-method Builder.PerformBuild \
340
+ --allow-install
341
+ echo "Exit code: $?"
342
+
343
+ # 4. Return the seat when done (floating/assigned)
344
+ unity license return --yes
345
+ ```
346
+
347
+ ### CI: headless build
348
+
349
+ Prefer the dedicated `unity build` command (handles batch mode, logging, and CI flags):
350
+
351
+ ```bash
352
+ unity build /path/to/MyProject \
353
+ --editor-version 6000.0.47f1 \
354
+ --target StandaloneLinux64 \
355
+ --execute-method Builder.PerformBuild \
356
+ --allow-install
357
+ echo "Exit code: $?"
358
+ ```
359
+
360
+ Or use `unity run` (batch mode is automatic — never pass `-batchmode`/`-quit`):
361
+
362
+ ```bash
363
+ unity run /path/to/MyProject \
364
+ --editor-version 6000.0.47f1 \
365
+ --allow-install \
366
+ -- -executeMethod Builder.PerformBuild -logFile build.log
367
+ echo "Exit code: $?"
368
+ ```
369
+
370
+ ### CI: run tests and publish results
371
+
372
+ ```bash
373
+ unity test /path/to/MyProject \
374
+ --editor-version 6000.0.47f1 \
375
+ --mode EditMode \
376
+ --report-format junit \
377
+ --output ./test-results.xml \
378
+ --allow-install \
379
+ --timeout 600
380
+ case $? in
381
+ 0) echo "All tests passed" ;;
382
+ 8) echo "Tests failed — report to developers, do not retry" ;;
383
+ *) echo "Run did not complete — infrastructure failure, safe to retry" ;;
384
+ esac
385
+ ```
386
+
387
+ Exit `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`.
388
+
389
+ `--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).
390
+
391
+ ### Debug the CLI
392
+
393
+ ```bash
394
+ # Check auth + installed editors + recent errors in one command
395
+ unity doctor --format json
396
+
397
+ # Follow live logs during an install
398
+ unity logs --follow --level info
399
+ ```
400
+
401
+ ---
402
+
403
+ ## Notes
404
+
405
+ - `--non-interactive` and `--yes` together suppress all prompts — use both in CI.
406
+ - `--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.
407
+ - **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.
408
+ - `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`.
409
+ - The CLI supports kubectl-style plugins: any `unity-<name>` binary on PATH is callable as `unity <name>`.
410
+ - 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.
411
+ - 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.
412
+ - The CLI is currently in **beta** (latest: `1.0.0-beta.6`). 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.
413
+ - 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.
414
+ - 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.
@@ -0,0 +1,146 @@
1
+ # Auth, license & cloud — unity-cli command reference
2
+
3
+ Part of the **`unity-cli`** skill. See that skill's `SKILL.md` for CLI install, global flags,
4
+ environment variables, exit codes, and common workflows. All global flags (`--format json`,
5
+ `--non-interactive`, `--yes`, `--proxy`, …) apply to every command below.
6
+
7
+ ---
8
+
9
+ ### Auth
10
+
11
+ ```bash
12
+ # Check login status
13
+ unity auth status --format json
14
+
15
+ # Login (opens browser for OAuth)
16
+ unity auth login
17
+
18
+ # Login with service account credentials (CI — skips browser)
19
+ # Preferred: read secret from stdin to avoid shell-history and process-list exposure
20
+ unity auth login --client-id <id> --secret-from-stdin
21
+
22
+ # A --client-secret flag also exists, but passing a secret as a
23
+ # command-line argument exposes it in shell history and the process list.
24
+ # Avoid it — use --secret-from-stdin (above) or the
25
+ # UNITY_SERVICE_ACCOUNT_ID / UNITY_SERVICE_ACCOUNT_SECRET env vars instead.
26
+
27
+ # Login without persisting credentials to the keyring (ephemeral CI)
28
+ unity auth login --client-id <id> --secret-from-stdin --no-store
29
+
30
+ # Logout (clears both service-account and OAuth credential slots)
31
+ unity auth logout
32
+
33
+ # Log a specific stored account out, rather than the active one
34
+ unity auth logout user@example.com
35
+
36
+ # Skip the confirmation prompt
37
+ unity auth logout --yes
38
+ ```
39
+
40
+ #### Multiple accounts
41
+
42
+ The CLI stores more than one signed-in account and keeps one of them *active*. `unity auth login` adds an account; these three manage the set.
43
+
44
+ ```bash
45
+ # List stored accounts; "*" marks the active one
46
+ unity auth list
47
+ unity auth ls # alias
48
+ unity auth list --format json
49
+
50
+ # Make a stored account active (by email or id) — no browser round-trip
51
+ unity auth switch user@example.com
52
+
53
+ # Show the account a project uses for cloud commands
54
+ unity auth default
55
+
56
+ # Pin this project to an account, regardless of which one is active
57
+ unity auth default user@example.com
58
+
59
+ # Target a project other than the current directory
60
+ unity auth default user@example.com --project ./MyGame
61
+
62
+ # Remove the pin; the project follows the active account again
63
+ unity auth default --clear
64
+ ```
65
+
66
+ Three behaviors worth knowing before scripting these:
67
+
68
+ - **A project pin beats the active account.** If a project has a default set, commands run inside it keep using that account even after `unity auth switch` — the switch reports this rather than failing silently. Use `auth default --clear` to hand the project back to the active account.
69
+ - **Service-account credentials outrank both.** When `UNITY_SERVICE_ACCOUNT_ID` / `UNITY_SERVICE_ACCOUNT_SECRET` are set (or a service account is signed in), they take precedence over every stored account and `auth switch` says so instead of appearing to work. Unset them, or `unity auth logout`, before switching.
70
+ - **`auth switch` is ambiguity-aware.** Given a string matching several stored accounts it fails rather than guessing, and under `--format json` carries the candidates in `data.candidates` so a script can disambiguate. Pass the full email or the account id.
71
+
72
+ `unity auth default` resolves the project from the current directory unless `--project` is given, and errors if that path isn't a Unity project. Passing both an account and `--clear` is rejected.
73
+
74
+ **Separate sign-in from Hub.** As of `0.1.0-beta.8`, the CLI and the GUI Hub store their sign-in credentials **separately** — signing in to one no longer signs you out of (or overwrites the account of) the other, so each can stay signed in as a different account. (In earlier betas they shared a single keyring session.)
75
+
76
+ **Service-account credentials via env vars** (`UNITY_SERVICE_ACCOUNT_ID` + `UNITY_SERVICE_ACCOUNT_SECRET`) mint bearer tokens automatically for the duration of the process — no browser round-trip, no keyring write. If only one of the two is set, the CLI prints a warning on stderr instead of silently falling back to the keyring/OAuth identity.
77
+
78
+ The interactive `unity auth login` flow prints the sign-in URL to the terminal **before** attempting to launch the browser, which unblocks remote/headless sessions (SSH, containers, dev VMs) where `xdg-open` / `open` has no graphical session to attach to. With `--format json`, an `auth_url=…` progress frame is emitted so machine consumers can capture the URL without parsing human text.
79
+
80
+ `unity auth status` reflects real session state (including an explicit "session expired" message), not optimistic local assumptions. `unity doctor` and `unity cloud status` report the same real session state.
81
+
82
+ ---
83
+
84
+ ### License — list, activate, return
85
+
86
+ ```bash
87
+ # List the Unity licenses active on this machine
88
+ unity license
89
+ unity license list # explicit form, identical output
90
+ unity license --format json # machine-readable
91
+
92
+ # Summary: active license(s) + sign-in state
93
+ unity license status
94
+
95
+ # Activate a license — choose exactly one mode (default = signed-in subscription)
96
+ unity license activate # signed-in user's subscription (entitlement) licenses
97
+ unity license activate --serial SC-… # serial-based (ULF) activation, no sign-in needed
98
+ unity license activate --personal --accept-eula # free Unity Personal license (must accept the EULA)
99
+ unity license activate --floating # lease a seat from the configured floating server
100
+ unity license activate --file ./Unity_lic.ulf # offline activation from a .ulf / .xml file
101
+ unity license activate --generate-request ./req.alf # write an offline activation request (air-gapped)
102
+
103
+ # Return the active licenses — assigned/subscription AND serial-activated (prompts to confirm; --yes skips)
104
+ unity license return
105
+ unity license return --yes
106
+
107
+ # Floating (network) license server
108
+ unity license server list # the configured floating license server(s)
109
+ unity license server status # reachability + available seats
110
+ ```
111
+
112
+ `list` columns: product, license type (`Floating` / `Assigned` / `ULF`), organization, and expiry. `status` prints a one-glance summary — the active license(s) and whether you're signed in — and exits non-zero (`4`) when no license is active, so it works as a scriptable health check. The first licensing command downloads the Unity licensing client on demand; as of `0.1.0-beta.8`, if the client is unavailable `list` reports a clear error and exits non-zero (matching `status`), rather than printing an empty list.
113
+
114
+ `activate` takes a single mode flag (combining them is a usage error). The default (no flag) and `--personal` activate the signed-in user's entitlements — sign in first with `unity auth login`. `--personal` also requires `--accept-eula` to acknowledge the Unity Personal license terms. `--serial` / `--file` work offline without sign-in. `--floating` requires a configured floating license server (exit `4` if none is set). `--generate-request` writes a `.alf` request for air-gapped activation instead of activating. `return` returns the active licenses, prompting for confirmation first — pass `--yes` to skip (required in non-interactive shells and with `--json`). All honor `--json` / `--format` and exit non-zero on failure (`2` bad usage, `3` sign-in required, `4` floating not configured, `6` licensing-client error).
115
+
116
+ **Service accounts.** The `license` commands recognize service-account sessions (`UNITY_SERVICE_ACCOUNT_ID` / `UNITY_SERVICE_ACCOUNT_SECRET`, or `unity auth login --client-id`): `unity license status` reports `Signed in: yes (service account)` and includes the auth mode in JSON. Unity's licensing backend does **not** accept service-account tokens for license activation, so with a service-account session the default entitlement mode and `--personal` fail up front — before contacting the licensing client — with guidance toward the unattended options (`--floating`, `--file`, `--generate-request`, or a perpetual `--serial`). `unity license return` lists and returns serial-activated licenses too (not just assigned/subscription seats) — important for CI machines that activate per run — and returns each license individually, so when only some can be freed it reports what succeeded (in text and in the JSON `returned` / `failed` fields) instead of an all-or-nothing failure.
117
+
118
+ `unity license server list` shows the configured floating license server (from the `licensingServiceBaseUrl` machine setting; a pure settings read, no client download). `unity license server status` contacts that server and reports reachability plus available seats — exit `4` when no server is configured, `6` when configured but unreachable.
119
+
120
+ ---
121
+
122
+ ### Cloud — Unity Cloud organizations and projects
123
+
124
+ Requires being signed in (`unity auth login`).
125
+
126
+ ```bash
127
+ # Show cloud sign-in state and active organization
128
+ unity cloud status --format json
129
+
130
+ # Organizations
131
+ unity cloud org list --format json
132
+ unity cloud org current # print the active default org id
133
+ unity cloud org set-default <id-or-name> # set active default org
134
+ unity cloud org clear-default # revert to "All Organizations"
135
+
136
+ # Projects in the active organization
137
+ unity cloud project list --format json
138
+
139
+ # Override the active organization for a single call
140
+ unity cloud project list --cloud-org <id-or-name> # also via UNITY_CLOUD_ORG env var
141
+ ```
142
+
143
+ **Exit codes.** The `cloud` and `auth` commands map an authentication failure (expired or missing session, rejected sign-in) to `3`, and any other operational failure (network, server error) to `6` — so scripts can distinguish "sign in again" from a genuine command failure. `unity auth status` / `logout` follow the same convention.
144
+
145
+ ---
146
+