unity-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUnity CLI
Unity CLI
Step 1: Install the CLI (if not already installed)
步骤1:安装CLI(如果尚未安装)
First check if the CLI is available:
bash
which unity && unity --versionIf not found, install it:
macOS / Linux
bash
curl -fsSL https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.sh | UNITY_CLI_CHANNEL=beta bashWindows (PowerShell)
powershell
$env:UNITY_CLI_CHANNEL='beta'; irm https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.ps1 | iexAfter installing, open a new shell so is on PATH, then verify:
unitybash
unity --versionIf the install script fails or the binary is still not found, tell the user and stop.
首先检查CLI是否可用:
bash
which unity && unity --version如果未找到,请安装:
macOS / Linux
bash
curl -fsSL https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.sh | UNITY_CLI_CHANNEL=beta bashWindows (PowerShell)
powershell
$env:UNITY_CLI_CHANNEL='beta'; irm https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.ps1 | iex安装完成后,打开新的Shell窗口,确保已加入PATH,然后验证:
unitybash
unity --version如果安装脚本失败或仍无法找到二进制文件,请告知用户并停止操作。
Step 2: Verify it works
步骤2:验证功能正常
bash
unity --versionIf this fails with a permissions error or crash, the CLI installation may be broken. Suggest re-running the install script.
bash
unity --version如果因权限错误或崩溃导致失败,说明CLI安装可能损坏。建议重新运行安装脚本。
Global flags
全局标志
These work on every command:
| Flag | Description |
|---|---|
| Output format: |
| Suppress the branded header — use in scripts |
| Disable all interactive prompts — use in CI |
| Suppress non-essential output |
| Print full error details (stack trace + cause chain) on failure. Also via |
| HTTP/HTTPS/SOCKS/PAC proxy URL for this invocation. Also via |
| Disable proxy for this invocation, ignoring all sources (env vars, persisted config, system settings). |
| Log one redacted entry per outbound request (host-only URL, resolved proxy, auth source, status, duration) to |
| Opt a single invocation out of proxy request logging when it's enabled globally. |
Always use when you need to parse output programmatically.
--format jsonA branded Unity header (logo, wordmark, CLI version) renders on the landing surfaces — bare , / , , 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 . Piped output is unaffected. Use to suppress it in scripts. Bare prints usage and exits 0.
unityunity --help-hunity helpNO_COLOR--no-bannerunity这些标志适用于所有命令:
| 标志 | 描述 |
|---|---|
| 输出格式: |
| 隐藏品牌化头部——在脚本中使用 |
| 禁用所有交互式提示——在CI环境中使用 |
| 抑制非必要输出 |
| 失败时打印完整错误详情(堆栈跟踪+原因链)。也可通过 |
| 本次调用使用的HTTP/HTTPS/SOCKS/PAC代理URL。也可通过 |
| 禁用本次调用的代理,忽略所有来源(环境变量、持久化配置、系统设置)。 |
| 将每个出站请求的一条脱敏记录(仅主机URL、解析后的代理、认证来源、状态、时长)记录到 |
| 当全局启用代理请求日志时,让单次调用跳过日志记录。 |
当需要以编程方式解析输出时,请始终使用。
--format json在以下场景会显示Unity品牌化头部(Logo、标识、CLI版本):直接执行、/、,以及首次运行的同意提示上方。仅在TTY环境下显示,最多显示一次,在窄终端、无Unicode或开启时会降级为紧凑的无颜色文本。管道输出不受影响。在脚本中使用可隐藏它。直接执行会打印用法并以0状态码退出。
unityunity --help-hunity helpNO_COLOR--no-bannerunityEnvironment variables
环境变量
All CLI env vars use the prefix. A CLI flag always overrides the corresponding env var.
UNITY_| Variable | Mirrors flag | Description |
|---|---|---|
| | Output format ( |
| | Editor version (e.g. |
| | Chip architecture ( |
| path argument | Project path for the |
| | Suppress non-essential output. |
| | Show full error details on failure. |
| | Disable interactive prompts. |
| | Suppress the branded banner. |
| | Timeout for |
| | Timeout for |
| | Active Unity Cloud organization id or name for a single call. |
| — | Service account client ID for non-interactive (CI) auth. |
| — | Service account client secret for non-interactive (CI) auth. |
| | HTTP/HTTPS/SOCKS/PAC proxy URL. Takes precedence over |
| — | Disable the background "update available" check (see |
| | Log one redacted entry per outbound request to |
| | Windows: skip the elevated (UAC) install helper for |
| | Number of times |
CI service account auth: Set both and to skip the browser OAuth flow — this keeps the secret out of the process argument list and shell history. These map to the / inputs of , 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.
UNITY_SERVICE_ACCOUNT_IDUNITY_SERVICE_ACCOUNT_SECRET--client-id--secret-from-stdinunity auth login所有CLI环境变量均以为前缀。CLI标志始终覆盖对应的环境变量。
UNITY_| 变量 | 对应标志 | 描述 |
|---|---|---|
| | 输出格式( |
| | 编辑器版本(例如 |
| | 芯片架构( |
| 路径参数 | |
| | 抑制非必要输出。 |
| | 失败时显示完整错误详情。 |
| | 禁用交互式提示。 |
| | 隐藏品牌化头部。 |
| | |
| | |
| | 单次调用使用的Unity Cloud组织ID或名称。 |
| — | 非交互式(CI)认证使用的服务账户客户端ID。 |
| — | 非交互式(CI)认证使用的服务账户客户端密钥。 |
| | HTTP/HTTPS/SOCKS/PAC代理URL。优先级高于 |
| — | 禁用后台“可用更新”检查(参见 |
| | 将每个出站请求的一条脱敏记录写入 |
| | Windows系统:跳过 |
| | |
CI服务账户认证: 同时设置和可跳过浏览器OAuth流程——这样可避免密钥出现在进程参数列表和Shell历史中。这些对应的/输入,但从环境读取凭证并非完整登录:不会运行交互式流程,也不会将凭证持久化到密钥环。
UNITY_SERVICE_ACCOUNT_IDUNITY_SERVICE_ACCOUNT_SECRETunity auth login--client-id--secret-from-stdinGetting help
获取帮助
If a command fails or you're unsure of the available options, append or to any command or subcommand:
-h--helpbash
unity --help
unity install --help
unity projects --help
unity projects create --helpThis works at every level of the command hierarchy.
如果命令失败或不确定可用选项,可在任何命令或子命令后添加或:
-h--helpbash
unity --help
unity install --help
unity projects --help
unity projects create --help这适用于命令层级的每个级别。
Exit codes
退出码
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Bad arguments |
| 3 | Authentication failure |
| 4 | Precondition not met (e.g. no license active, floating server not configured) |
| 6 | Command-specific failure |
| 130 | Interrupted — Ctrl+C / SIGINT (128 + 2) |
| 143 | Terminated by SIGTERM (128 + 15) — e.g. |
The and commands map an authentication failure (expired/missing session, rejected sign-in) to , and any other operational failure (network, server error) to — so scripts can reliably tell "sign in again" apart from a genuine command failure.
cloudauth36| 代码 | 含义 |
|---|---|
| 0 | 成功 |
| 1 | 通用错误 |
| 2 | 参数错误 |
| 3 | 认证失败 |
| 4 | 前置条件未满足(例如无激活许可证、未配置浮动服务器) |
| 6 | 命令特定错误 |
| 130 | 中断——Ctrl+C / SIGINT(128 + 2) |
| 143 | 被SIGTERM终止(128 + 15)——例如 |
cloudauth36Commands
命令
The full per-command reference — syntax, flags, and examples — lives in grouped files under
. Read the file for the command group you need; all the global
flags, environment variables, and exit codes above apply throughout. Every command also supports
/ (see Getting help).
references/-h--help| Commands | Reference file |
|---|---|
| auth-license-cloud.md |
| editors-install.md |
| projects-templates.md |
| config-hub.md |
| build-run-test.md |
| diagnostics-maintenance.md |
| integration-advanced.md |
完整的命令参考——语法、标志和示例——位于下的分组文件中。请阅读你需要的命令组对应的文件;上述所有全局标志、环境变量和退出码均适用于所有命令。每个命令也支持/(参见获取帮助)。
references/-h--help| 命令 | 参考文件 |
|---|---|
| auth-license-cloud.md |
| editors-install.md |
| projects-templates.md |
| config-hub.md |
| build-run-test.md |
| diagnostics-maintenance.md |
| integration-advanced.md |
Common workflows
常见工作流
Bootstrap a new project from scratch
从零开始引导新项目
For a guided end-to-end experience — concept questions, installing the Editor in the background while you plan, package selection, and monetization handoff — use theskill. This section is the raw CLI recipe that skill builds on; use it directly when you just want the commands.new-unity-project
Take an idea to a running, version-controlled project using only the CLI. Decide the target
platforms first — they determine which Editor modules you install in step 2. You can add
modules later (), but a project can't build for a platform until that
platform's module is installed, so it's simplest to decide up front.
unity install-modulesbash
undefined如果需要引导式端到端体验——包括概念探讨、在你规划时后台安装编辑器、包选择以及变现交接——请使用****技能。本节是该技能基于的原始CLI步骤;当你只需要命令时可直接使用。new-unity-project
仅使用CLI将创意转化为可运行的版本控制项目。首先确定目标平台——它们决定了你在步骤2中需要安装的编辑器模块。你可以稍后添加模块(),但项目在安装对应平台的模块前无法为该平台构建,因此最好提前决定。
unity install-modulesbash
undefined1. Confirm the CLI works and you're signed in and licensed (see references/auth-license-cloud.md).
1. 确认CLI可用,且已登录并获得许可证(参见references/auth-license-cloud.md)。
unity --version
unity auth status --format json # if signed out: unity auth login
unity license status --format json # if none active: unity license activate
unity --version
unity auth status --format json # 如果未登录:unity auth login
unity license status --format json # 如果无激活许可证:unity license activate
2. Pick and install an Editor with the modules your target platforms need.
2. 选择并安装包含目标平台所需模块的编辑器。
Default to the latest LTS (most stable, ~2 years of patches). Reach for a Tech-stream
默认选择最新LTS版本(最稳定,约2年补丁支持)。仅当LTS版本中没有所需功能时才选择技术流版本(--stream tech);将--stream beta/alpha版本仅用于评估,绝不要用于打算发布的项目。有发布期限时优先选择LTS版本。
release (--stream tech) only for a feature not yet in LTS; treat --stream beta/alpha as
(在任何需要版本的地方都可以使用lts/latest别名。)
evaluation-only, never for a project you intend to ship. A deadline argues for LTS.
—
(lts / latest aliases work wherever a version is accepted.)
—
unity releases --stream lts --limit 5 --format json
unity install lts --module android --module ios --yes --accept-eula # add --module webgl, etc.
unity editors --installed --format json # confirm it landed
unity releases --stream lts --limit 5 --format json
unity install lts --module android --module ios --yes --accept-eula # 可添加--module webgl等
unity editors --installed --format json # 确认安装完成
3. List the real template ids this Editor offers — don't guess them.
3. 列出该编辑器提供的真实模板ID——不要猜测。
unity templates list --editor lts --format json
unity templates list --editor lts --format json
Common ids: com.unity.template.3d, com.unity.template.2d, and a URP template (id varies by version).
常见ID:com.unity.template.3d、com.unity.template.2d,以及URP模板(ID因版本而异)。
4. Create the project. The first positional arg is the NAME; --path sets the parent directory.
4. 创建项目。第一个位置参数是项目名称;--path设置父目录。
All options supplied, so it won't prompt; add --non-interactive in CI.
已提供所有选项,因此不会弹出提示;在CI环境中添加--non-interactive。
unity projects create "MyGame" --path ~/UnityProjects
--editor-version lts --template com.unity.template.3d
--editor-version lts --template com.unity.template.3d
**Source control — let the user choose.** The CLI publishes the new project to a fresh remote in
one step for any provider. **Always pass tokens on stdin** (`--git-token-stdin`) so secrets never
land in shell history or the process list. Pick based on the project — don't default to one:
- **Git — GitHub / GitLab** (`--vcs github` / `--vcs gitlab`). Ubiquitous. For asset-heavy games
add **Git LFS** (`--git-lfs`) so large binaries don't bloat history.
- **Unity Version Control — UVCS** (`--vcs uvcs`). Unity's own VCS, built for large binary game
assets: it handles them natively (**no LFS needed**) and supports file locking — often the
better fit for art-heavy projects or larger teams. Auth uses your Unity sign-in; `--vcs-region`
selects the region.
```bashunity projects create "MyGame" --path ~/UnityProjects
--editor-version lts --template com.unity.template.3d
--editor-version lts --template com.unity.template.3d
**版本控制——让用户选择。** CLI可一步将新项目发布到任何提供商的全新远程仓库。**始终通过标准输入传递令牌**(`--git-token-stdin`),这样密钥就不会出现在Shell历史或进程列表中。根据项目选择——不要默认某一种:
- **Git — GitHub / GitLab**(`--vcs github`/`--vcs gitlab`)。应用广泛。对于资产密集型游戏,添加**Git LFS**(`--git-lfs`),避免大型二进制文件膨胀历史记录。
- **Unity版本控制——UVCS**(`--vcs uvcs`)。Unity自研的版本控制系统,专为大型二进制游戏资产设计:原生处理这些资产(**无需LFS**)并支持文件锁定——通常更适合艺术密集型项目或大型团队。认证使用你的Unity登录信息;`--vcs-region`选择区域。
```bashGit (GitHub) — drop --git-lfs if the game isn't asset-heavy. Add --no-initial-commit if you
Git(GitHub)——如果游戏不是资产密集型,可去掉--git-lfs。如果想在首次提交前添加包/资产,添加--no-initial-commit(参见new-unity-project流程)。
want to add packages/assets BEFORE the first commit (see the new-unity-project flow).
—
unity projects create "MyGame" --path ~/UnityProjects
--editor-version lts --template com.unity.template.3d
--vcs github --git-namespace my-org --git-repo my-game
--git-visibility private --git-default-branch main --git-token-stdin --git-lfs
--editor-version lts --template com.unity.template.3d
--vcs github --git-namespace my-org --git-repo my-game
--git-visibility private --git-default-branch main --git-token-stdin --git-lfs
unity projects create "MyGame" --path ~/UnityProjects
--editor-version lts --template com.unity.template.3d
--vcs github --git-namespace my-org --git-repo my-game
--git-visibility private --git-default-branch main --git-token-stdin --git-lfs
--editor-version lts --template com.unity.template.3d
--vcs github --git-namespace my-org --git-repo my-game
--git-visibility private --git-default-branch main --git-token-stdin --git-lfs
Unity Version Control (UVCS) — handles binaries natively, so no LFS:
Unity版本控制(UVCS)——原生处理二进制文件,因此无需LFS:
unity projects create "MyGame" --path ~/UnityProjects
--editor-version lts --template com.unity.template.3d
--vcs uvcs --git-namespace my-org --git-repo my-game --vcs-region <region>
--editor-version lts --template com.unity.template.3d
--vcs uvcs --git-namespace my-org --git-repo my-game --vcs-region <region>
Feed the token to `--git-token-stdin` from a secret store, never a literal — e.g.
`… --git-token-stdin <<<"$GIT_TOKEN"` where `$GIT_TOKEN` comes from your CI/secret manager
(UVCS uses your Unity sign-in, so no token is needed). See
[references/projects-templates.md](references/projects-templates.md) for the full
source-control flag set. For a purely local Git repository instead, initialize git with a
Unity-appropriate ignore so the multi-GB `Library/` and other generated folders are never committed:
```bash
cd ~/UnityProjects/MyGame
git init -b mainunity projects create "MyGame" --path ~/UnityProjects
--editor-version lts --template com.unity.template.3d
--vcs uvcs --git-namespace my-org --git-repo my-game --vcs-region <region>
--editor-version lts --template com.unity.template.3d
--vcs uvcs --git-namespace my-org --git-repo my-game --vcs-region <region>
从密钥库向`--git-token-stdin`提供令牌,绝不要直接写字面量——例如`… --git-token-stdin <<<"$GIT_TOKEN"`,其中`$GIT_TOKEN`来自你的CI/密钥管理器(UVCS使用你的Unity登录信息,因此无需令牌)。完整的版本控制标志集请参见[references/projects-templates.md](references/projects-templates.md)。如果只想创建本地Git仓库,请使用适合Unity的忽略规则初始化Git,避免多GB的`Library/`和其他生成文件夹被提交:
```bash
cd ~/UnityProjects/MyGame
git init -b mainDownload (do not pipe to a shell) a maintained Unity .gitignore:
下载(不要通过管道传递给Shell)维护中的Unity .gitignore文件:
curl -fsSL https://raw.githubusercontent.com/github/gitignore/main/Unity.gitignore -o .gitignore
curl -fsSL https://raw.githubusercontent.com/github/gitignore/main/Unity.gitignore -o .gitignore
Asset-heavy game? Keep large binaries out of git history with Git LFS:
资产密集型游戏?使用Git LFS将大型二进制文件排除在Git历史之外:
git lfs install
git lfs track ".psd" ".fbx" ".wav" ".mp3" "*.png" # adjust to your asset types
git add .gitattributes
git add -A
git status # sanity-check: Library/ Temp/ obj/ Build/ must NOT be staged
git commit -m "Initial Unity project: MyGame"
git ls-files | grep -c '^Library/' # must print 0
**What the CLI does and doesn't cover.** The CLI handles editor, project, and source control.
It does **not** manage UPM (Unity Package Manager) packages — to add packages beyond the
template headlessly, use the **`unity-package-management`** skill (C# PackageManager Client
API). For monetization/backend, hand off to the dedicated skills: `implement-in-app-purchases`
(IAP), `levelplay-unity-integration` (ads), or `build-live-game` (accounts, cloud save,
economy, remote config, leaderboards). Open the project to start working:
`unity open ~/UnityProjects/MyGame`.git lfs install
git lfs track ".psd" ".fbx" ".wav" ".mp3" "*.png" # 根据你的资产类型调整
git add .gitattributes
git add -A
git status # 检查:Library/ Temp/ obj/ Build/ 一定不能被暂存
git commit -m "Initial Unity project: MyGame"
git ls-files | grep -c '^Library/' # 必须输出0
**CLI能处理和不能处理的内容。** CLI处理编辑器、项目和版本控制。它**不**管理UPM(Unity包管理器)包——如果需要在无界面环境下添加模板之外的包,请使用**`unity-package-management`**技能(C# PackageManager Client API)。对于变现/后端功能,请交给专门的技能:`implement-in-app-purchases`(IAP)、`levelplay-unity-integration`(广告)或`build-live-game`(账户、云存档、经济系统、远程配置、排行榜)。打开项目开始开发:`unity open ~/UnityProjects/MyGame`。Find and install a missing editor
查找并安装缺失的编辑器
bash
undefinedbash
undefined1. Check what's installed
1. 检查已安装的编辑器
unity editors --installed --format json
unity editors --installed --format json
2. Browse available LTS versions
2. 浏览可用的LTS版本
unity releases --lts --limit 5 --format json
unity releases --lts --limit 5 --format json
3. Install
3. 安装
unity install 6000.0.47f1 --yes --accept-eula
undefinedunity install 6000.0.47f1 --yes --accept-eula
undefinedOpen a project with the correct editor
使用正确的编辑器打开项目
bash
undefinedbash
undefined1. Check the project's required editor version
1. 检查项目所需的编辑器版本
unity projects info /path/to/MyProject --format json
unity projects info /path/to/MyProject --format json
Look at "editorVersion" in the result
查看结果中的"editorVersion"
2. Confirm that editor is installed
2. 确认该编辑器已安装
unity editors --installed --format json
unity editors --installed --format json
3. Open (warns if the editor version is missing)
3. 打开(如果编辑器版本缺失会发出警告)
unity open /path/to/MyProject
undefinedunity open /path/to/MyProject
undefinedCI: activate a license, then build
CI:激活许可证然后构建
bash
undefinedbash
undefined1. Sign in non-interactively with a service account
1. 使用服务账户非交互式登录
unity auth login --client-id "$UNITY_SERVICE_ACCOUNT_ID" --secret-from-stdin <<<"$UNITY_SERVICE_ACCOUNT_SECRET"
unity auth login --client-id "$UNITY_SERVICE_ACCOUNT_ID" --secret-from-stdin <<<"$UNITY_SERVICE_ACCOUNT_SECRET"
2. Activate the entitlement license (or use --serial / --floating)
2. 激活授权许可证(或使用--serial / --floating)
unity license activate
unity license activate
3. Build
3. 构建
unity build /path/to/MyProject
--editor-version 6000.0.47f1
--target StandaloneLinux64
--execute-method Builder.PerformBuild
--allow-install echo "Exit code: $?"
--editor-version 6000.0.47f1
--target StandaloneLinux64
--execute-method Builder.PerformBuild
--allow-install echo "Exit code: $?"
unity build /path/to/MyProject
--editor-version 6000.0.47f1
--target StandaloneLinux64
--execute-method Builder.PerformBuild
--allow-install echo "Exit code: $?"
--editor-version 6000.0.47f1
--target StandaloneLinux64
--execute-method Builder.PerformBuild
--allow-install echo "Exit code: $?"
4. Return the seat when done (floating/assigned)
4. 完成后归还许可证(浮动/分配式)
unity license return --yes
undefinedunity license return --yes
undefinedCI: headless build
CI:无界面构建
Prefer the dedicated command (handles batch mode, logging, and CI flags):
unity buildbash
unity build /path/to/MyProject \
--editor-version 6000.0.47f1 \
--target StandaloneLinux64 \
--execute-method Builder.PerformBuild \
--allow-install
echo "Exit code: $?"Or use (batch mode is automatic — never pass /):
unity run-batchmode-quitbash
unity run /path/to/MyProject \
--editor-version 6000.0.47f1 \
--allow-install \
-- -executeMethod Builder.PerformBuild -logFile build.log
echo "Exit code: $?"优先使用专用的命令(处理批处理模式、日志和CI标志):
unity buildbash
unity build /path/to/MyProject \
--editor-version 6000.0.47f1 \
--target StandaloneLinux64 \
--execute-method Builder.PerformBuild \
--allow-install
echo "Exit code: $?"或者使用(自动启用批处理模式——绝不要传递/):
unity run-batchmode-quitbash
unity run /path/to/MyProject \
--editor-version 6000.0.47f1 \
--allow-install \
-- -executeMethod Builder.PerformBuild -logFile build.log
echo "Exit code: $?"CI: run tests and publish results
CI:运行测试并发布结果
bash
unity test /path/to/MyProject \
--editor-version 6000.0.47f1 \
--mode EditMode \
--output ./test-results.xml \
--allow-install \
--timeout 600
echo "Exit code: $?" # 0 = pass, 6 = test failuresbash
unity test /path/to/MyProject \
--editor-version 6000.0.47f1 \
--mode EditMode \
--output ./test-results.xml \
--allow-install \
--timeout 600
echo "Exit code: $?" # 0 = 通过,6 = 测试失败Debug the CLI
调试CLI
bash
undefinedbash
undefinedCheck auth + installed editors + recent errors in one command
一次命令检查认证+已安装编辑器+最近错误
unity doctor --format json
unity doctor --format json
Follow live logs during an install
在安装过程中实时查看日志
unity logs --follow --level info
---unity logs --follow --level info
---Notes
注意事项
- and
--non-interactivetogether suppress all prompts — use both in CI.--yes - 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.
--format json - is a shorthand for
unity <version> [path]. Works withunity open [path] --editor-version <version>,lts, or a full version string likelatest.6000.0.47f1 - The CLI supports kubectl-style plugins: any binary on PATH is callable as
unity-<name>.unity <name> - 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, while SGR color/style codes are preserved.
- The CLI is currently in beta (latest: ). It moved to 1.0 versioning at
1.0.0-beta.2; it's still a beta, so keep1.0.0-beta.1in the install command until GA ships, after which that part can be dropped.UNITY_CLI_CHANNEL=beta - As of 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 or the
unity config update-check offenv var.UNITY_NO_UPDATE_CHECK - Outbound HTTP from every CLI command honors the resolved proxy (see ). Inspect what the CLI actually resolved with
unity config proxyorunity env --format json— both surface the active proxy URL, its source, and auth source.unity doctor --format json
- 和
--non-interactive一起使用可抑制所有提示——在CI环境中同时使用这两个标志。--yes - 始终生成机器可读的输出;优先使用它而非解析人类可读文本。错误信息包与成功信息包一样使用2空格缩进进行格式化。
--format json - 是
unity <version> [path]的简写。适用于unity open [path] --editor-version <version>、lts或完整版本字符串如latest。6000.0.47f1 - CLI支持kubectl风格的插件:PATH上的任何二进制文件都可通过
unity-<name>调用。unity <name> - 终端输出已针对服务器提供的值(项目标题、编辑器版本、模块名称)的控制字符/转义序列注入进行加固——C0控制字符和非SGR转义序列会从表格/列表/树输出中移除,而SGR颜色/样式代码会保留。
- CLI目前处于beta阶段(最新版本:)。在
1.0.0-beta.2时开始使用1.0版本号;仍处于beta阶段,因此在正式版发布前,请在安装命令中保留1.0.0-beta.1,之后可移除该部分。UNITY_CLI_CHANNEL=beta - 从beta.8版本开始,CLI会在后台检查更新,并在交互式会话中打印不显眼的“可用更新”通知(绝不会延迟命令执行)。可通过或
unity config update-check off环境变量关闭该功能。UNITY_NO_UPDATE_CHECK - 每个CLI命令的出站HTTP请求都会遵循解析后的代理(参见)。可通过
unity config proxy或unity env --format json查看CLI实际解析的内容——两者都会显示活动代理URL、来源和认证来源。unity doctor --format json