Unity CLI
Treat installed help as authoritative. The CLI is experimental. Syntax changes.
Identify and inspect
command -v unity
unity --version
unity --help
Confirm this is the standalone Unity CLI. Not:
- Unity Editor arguments.
- Deprecated Unity Hub CLI or
-- --headless.
- Unity Gaming Services CLI (
ugs).
- Unity Version Control (
cm).
- Package Manager.
- Third-party
unity tools.
Before each command:
- Detect OS and architecture.
- Check
unity --version and relevant help.
- Use the complete nested path:
unity projects clone --help.
- Classify the operation: read-only or state-changing.
- Check platform support and experimental notices.
Use generated references only for discovery. Confirm locally with --help.
Execute
- Start with the narrowest read-only inspection.
- Resolve aliases, versions, paths, architectures, modules, and required values from installed help.
- Use preview or dry-run only when that command exposes it.
- In automation, build separate argv. Never interpolate discovered values into shell code.
- Before mutations: explain target and effect; get required authorization.
- Check exit code. Verify state with a read-only command.
Automation
- Use only help-confirmed structured formats.
- Separate stdout and stderr. Parse stdout; retain stderr.
- Always check exit code. Never parse animated progress.
- Avoid CI prompts. Use non-interactive flags only when exposed by help.
- Pin CLI and Editor versions when reproducibility matters.
- Never log credentials, tokens, serials, offline licenses, or service-account secrets.
- Never copy flags across platforms without checking each platform's help.
Mutations
Mutations include:
- Install, upgrade, or uninstall CLI/Editor/modules.
- Register Editors; change defaults or global paths.
- Create, import, clone, link, unlink, delete, or upgrade projects.
- Change credentials, authentication, licenses, caches, proxy, language, analytics, or persistent config.
Require explicit authorization before license activation/return, credential removal, project deletion/upgrade, cache clearing, uninstall, or global-path changes. First inspect the complete command path with --help.
Troubleshoot
- Capture OS, architecture, executable path, version, exact argv, exit code, stdout, and stderr.
- Check the complete command path with
--help.
- Use help-exposed read-only diagnostics.
- Check PATH, permissions, network/proxy, credential store, non-interactive settings, Editor/version/module resolution, and platform support.
- Redact secrets and user paths.
- Stop on incomplete help, unexpected output shape, or unexpected mutation risk.
References
- Unclear identity/scope: overview.md
- Install, upgrade, platform handling: installation-and-upgrade.md
- Automation, streams, formats, CI: output-and-automation.md
- Before auth/license work: authentication-and-licensing.md
- Before changing Hub CLI scripts: migration-from-hub-cli.md
- Diagnostics: troubleshooting.md
- Generated command discovery: command-index.md
- Provenance: sources.md
1---2name: unity-cli3description: Use when installing, configuring, automating, troubleshooting, or migrating workflows involving the standalone Unity CLI, including Unity Editor installations, modules, projects, authentication, licensing, structured output, and CI.4---56# Unity CLI78Treat installed help as authoritative. The CLI is experimental. Syntax changes.910## Identify and inspect1112```bash13command -v unity14unity --version15unity --help16```1718Confirm this is the standalone Unity CLI. Not:1920- Unity Editor arguments.21- Deprecated Unity Hub CLI or `-- --headless`.22- Unity Gaming Services CLI (`ugs`).23- Unity Version Control (`cm`).24- Package Manager.25- Third-party `unity` tools.2627Before each command:28291. Detect OS and architecture.302. Check `unity --version` and relevant help.313. Use the complete nested path: `unity projects clone --help`.324. Classify the operation: read-only or state-changing.335. Check platform support and experimental notices.3435Use generated references only for discovery. Confirm locally with `--help`.3637## Execute3839- Start with the narrowest read-only inspection.40- Resolve aliases, versions, paths, architectures, modules, and required values from installed help.41- Use preview or dry-run only when that command exposes it.42- In automation, build separate argv. Never interpolate discovered values into shell code.43- Before mutations: explain target and effect; get required authorization.44- Check exit code. Verify state with a read-only command.4546## Automation4748- Use only help-confirmed structured formats.49- Separate stdout and stderr. Parse stdout; retain stderr.50- Always check exit code. Never parse animated progress.51- Avoid CI prompts. Use non-interactive flags only when exposed by help.52- Pin CLI and Editor versions when reproducibility matters.53- Never log credentials, tokens, serials, offline licenses, or service-account secrets.54- Never copy flags across platforms without checking each platform's help.5556## Mutations5758Mutations include:5960- Install, upgrade, or uninstall CLI/Editor/modules.61- Register Editors; change defaults or global paths.62- Create, import, clone, link, unlink, delete, or upgrade projects.63- Change credentials, authentication, licenses, caches, proxy, language, analytics, or persistent config.6465Require explicit authorization before license activation/return, credential removal, project deletion/upgrade, cache clearing, uninstall, or global-path changes. First inspect the complete command path with `--help`.6667## Troubleshoot68691. Capture OS, architecture, executable path, version, exact argv, exit code, stdout, and stderr.702. Check the complete command path with `--help`.713. Use help-exposed read-only diagnostics.724. Check PATH, permissions, network/proxy, credential store, non-interactive settings, Editor/version/module resolution, and platform support.735. Redact secrets and user paths.746. Stop on incomplete help, unexpected output shape, or unexpected mutation risk.7576## References7778- Unclear identity/scope: [overview.md](references/overview.md)79- Install, upgrade, platform handling: [installation-and-upgrade.md](references/installation-and-upgrade.md)80- Automation, streams, formats, CI: [output-and-automation.md](references/output-and-automation.md)81- Before auth/license work: [authentication-and-licensing.md](references/authentication-and-licensing.md)82- Before changing Hub CLI scripts: [migration-from-hub-cli.md](references/migration-from-hub-cli.md)83- Diagnostics: [troubleshooting.md](references/troubleshooting.md)84- Generated command discovery: [command-index.md](references/command-index.md)85- Provenance: [sources.md](references/sources.md)