- 概述
- 关于 UiPath CLI
- 新增功能
- 版本控制和稳定性
- 开始使用
- 概念
- 使用 UiPath CLI
- 操作指南
- CI/CD 方法
- 命令参考
- 迁移
- 参考与支持
版本控制和稳定性
Semantic versioning contract for UiPath CLI, covering what changes at MAJOR, MINOR, and PATCH, and how to freeze the CLI, tool, and skills versions.
UiPath CLI 遵循语义版本控制( MAJOR.MINOR.PATCH ),在版本 1.197.0 中正式发布。这将替换旧版.NET CLI 使用的基于日历的方案(2023.10、2024.10、2025.10)。此页面是合同 — 从一个版本到下一个版本您可以依赖的内容、可以更改的内容,以及主机和工具版本如何保持同步。
语义化版本在实践中的含义
| 嵌入 | 当它发生时 | 哪些内容可能会发生变化 |
|---|---|---|
主要( 1.x.x → 2.0.0 ) | 对命令名称、标志语义或 JSON 信封的重大更改。 | 命令可能会被重命名或删除;标志可能已重命名或含义发生变化;信封的顶级字段可能会更改形状。发布任何主要版本之前,都有一个完整的弃用周期——已弃用的命令在上一个主要版本的最终次要版本中继续运行。 |
次要( 1.0.x → 1.1.0 ) | 新命令、新工具、新标志、新子命令。 | 仅在命令界面具有附加性。但是,JSON 信封内的Data的形式是特定于命令的,并且可能会发生变化— 添加了新字段,偶尔会重命名或嵌套字段。解析特定字段名称的脚本应在出现轻微变化时重新验证。 |
修补( 1.0.0 → 1.0.1 ) | 错误修复。 | 无记录的行为变化。更改行为的补丁将被视为补丁本身的错误报告。 |
没有--preview标志(与 Azure CLI 不同)。预览状态的命令已在其参考页面中标记,在次要版本中可能会发生变化,不会发出警告 — 请参阅下面的每个命令的稳定性。
稳定合同
以下内容在 MINOR 或 PATCH 版本中不会发生变化。根据这些概念自由编写脚本。
信封字段
每个命令都会在标准输出上发出一个信封,其中包含以下顶级字段:
| 字段 | 稳定性 | 意义 |
|---|---|---|
Result | 稳定 | Success、 Failure 、 ConfigError 、 AuthenticationError 、 ValidationError 、 TimeoutError 。 |
Code | 在“MAJOR”内稳定 | 特定于命令的成功标识符( FolderList 、 SolutionPack等)。新代码可能会出现在新命令的次要版本中。 |
Data | 特定于命令 | 每个命令定义的有效负载形状。可能会在次要版本中添加字段。在极少数情况下,字段可能会在 MINOR 中重命名 — 查看发布说明。 |
Message, Instructions | 稳定 | 人类可读的错误文本。内容可能会因版本而异;状态和角色不会更改。 |
Context, Log | 稳定 | 可选字段。状态稳定。 |
详细信息请参阅信封输出格式。
退出代码
五层退出代码合同(0/1/2/3/4,加上用于用户取消的130 )在主要版本中保持稳定。今天,几个长时间运行的命令(包括uip tm run 、 uip tm testsets clone和uip tm perf-scenario execute --wait在超时时发出4 ;更多长时间运行的命令可能会采用它,因此请将其处理为“超时”。
全局选项
--output 、 --output-filter 、 --log-level 、 --log-file — 这四个标志在 MINOR 颠倒过程中保持稳定。可能会添加新的全局选项;如果没有主要版本,现有版本将不会被重命名或删除。
标准输出/标准错误分隔
标准输出是信封; STderr 是日志、进度和面向人的错误文本。这种分离情况适用于每个命令、每种格式和每个版本。
主机和工具版本
主机( @uipath/cli 、 uip可执行文件)和每个工具(例如@uipath/orchestrator-tool )作为独立的 npm 包发布,每个包都有自己的语义版本。它们经过协调,以便1.0.x版本的主机可以运行1.0.x的工具。
默认版本解决方案
当您在没有显式版本的情况下运行uip tools install <alias>时,主机会选择 MAJOR.MINOR 与 CLI 当前的 MAJOR.MINOR 行匹配的最新工具版本。将 CLI 从1.0.x升级到1.1.0 ,然后运行uip tools update会将每个已安装的工具转到1.1.x行。
npm install -g @uipath/cli@1.1.0
uip tools update # all tools → latest 1.1.x
npm install -g @uipath/cli@1.1.0
uip tools update # all tools → latest 1.1.x
您可以覆盖特定工具的默认值:
uip tools install orchestrator-tool@1.0.2
uip tools install orchestrator-tool@1.0.2
uip tools update has no version option. A freeze holds tools at exact versions; see Freezing versions.
固定为何重要
工具通过受版本控制的 TypeScript 合同与主机通信(命令注册、输出格式化、遥测、上下文)。如果合同在次要版本之间发生更改,则主机和工具必须一起移动。版本固定默认值可以确保它们执行,而用户不必考虑。
更新渠道
主机及其工具解析到的内部版本由频道管理——这是一个 CLI 主机级别的设置,而不是在安装命令中传递的每个工具的 npm 标签。存在三个渠道:stable(默认)、preview 和隐藏的 dev。使用 uip config 进行设置:
uip config set updateChannel preview # persistent, affects every uip invocation
uip update --channel preview # one invocation only
uip config set updateChannel stable # back to stable
uip config set updateChannel preview # persistent, affects every uip invocation
uip update --channel preview # one invocation only
uip config set updateChannel stable # back to stable
每个渠道都映射到一个真实的 npm dist-标签:
| 频道 | 发布时间 | 注册表 | 距离标签 |
|---|---|---|---|
stable | 手动发布运行时间 release/* | npmjs | latest (对于低于 previous 的向后移植,则为 latest) |
preview | 推送到 release/* | npmjs,已镜像到 GitHub 包 | preview |
dev | 推送到 main | 仅限 GitHub 包 | dev |
系统接受 dev (uip config set updateChannel dev),但系统会有意将 --help 和“有效值”排除在外列表 — 其存在,是因为 -dev.* CLI 在自己的行中解析工具,而不是作为选择加入的频道。
Pinning an exact prerelease version directly still works for a one-off (uip tools install maestro-tool@1.0.0-preview.1), but updateChannel is what governs ongoing resolution — an unpinned uip tools update or auto-install always re-resolves against the channel, not a tag you passed once.
See uip config for the updateChannel key.
自动更新
如果放任不管,uip 会不断地使自身处于最新状态 — 这默认情况下会发生,无需选择加入。
每日 CLI 同步
每天一次,第一个符合条件的命令会在已解析的频道上检查较新的 CLI 版本,安装该版本,刷新技能,并在新版本上重新执行原始命令— 以透明方式在调用中进行。它仅写入到 标准错误 (交互式终端上的微调框) 中,而永远不会更改命令的退出代码。手动 uip update 永远不会受到此每日门限的限制。
它永远不会在无人值守的情况下跨越“主要”版本。在没有版本固定的情况下,每日同步上限为其已在运行的“主要”版本 — 将 2.0.0 发布到 latest 不会在一夜之间静默升级 1.x 安装。它会宣布其拒绝的新版本,以便您可以有意选择加入:
uip update # explicit, unrestricted — crosses the major
uip config freeze # or stay on the version installed now
uip update # explicit, unrestricted — crosses the major
uip config freeze # or stay on the version installed now
The sync skips certain contexts automatically (CI env-var auth, a monorepo checkout, a Studio-bundled install, the update/login/logout/mcp/completion/config/skills/help verbs, --version/--help, a frozen config) and can be turned off entirely with:
export UIPATH_CLI_DISABLE_VERSION_SYNC=true
export UIPATH_CLI_DISABLE_VERSION_SYNC=true
Where a versions block exists, UIPATH_CLI_DISABLE_VERSION_SYNC is ignored, with one stderr line a day: the block decides what is installed. State is tracked in ~/.uipath/version-sync.json; uip login never touches it.
每个工具的每日检查
Separately, the first time a tool verb runs each day, the CLI does one registry lookup for that tool on the running CLI's major.minor line and installs the newest matching build before the tool loads — no re-exec, since tools load lazily in the same process.
This check fails closed: if the lookup or install fails, the command does not run at all (a Failure result asks you to check connectivity and retry) rather than risk running a stale tool. UIPATH_CLI_DISABLE_VERSION_SYNC and UIPATH_CLI_DISABLE_AUTOINSTALL both skip this check; so does a frozen config.
基于命令的稳定性
单个命令和标志带有三个稳定性标签之一。它们可以在每个命令的参考页面的顶部找到。
| 标签 | 意义 |
|---|---|
| GA (默认;未标记) | 该命令包含在上述语义化版本合同中。它不会在主要版本中重命名或删除。 |
| 预览 | 该命令正在积极开发中。标志、默认值和输出形状可以在没有重大变化的情况下发生变化,不过重大变化的情况很少见,并且会在发布说明中宣布。仅当您准备在每个版本上重新验证时在生产中使用。 |
| 已弃用 | 计划在下一个主要版本中删除该命令。它会在 1.x 版本中继续运行,并在 STDERR 上发出警告。使用弃用说明中列出的后备方案。 |
这与 gcloud 使用的约定相同。UiPath CLI 不会将“预览”命令门控在“选择加入”标志后面,它们在--help中可见且可调用。
Freezing versions
Installing a version with npm does not hold it. The daily CLI sync moves the CLI to the newest release, and the per-tool daily check moves each tool to the newest build on the CLI line.
A freeze holds the versions: a versions block in .uipath/config.json pins the CLI, each tool, and the skills. Freezing needs CLI 1.207.0 or later, because older CLIs do not read the block.
uip config freeze writes the block from what is installed now and installs nothing. uip config unfreeze removes it. The block has this shape:
{
"versions": {
"cli": "1.207.1",
"skills": "1.207.0",
"tools": { "@uipath/orchestrator-tool": "1.207.3" }
}
}
{
"versions": {
"cli": "1.207.1",
"skills": "1.207.0",
"tools": { "@uipath/orchestrator-tool": "1.207.3" }
}
}
What a freeze does at run time
Where the config the CLI reads has a versions block:
- The daily CLI sync and the per-tool daily check do not run.
- A CLI that is not on
versions.clirefuses normal commands, and the message namesuip update.uip update,uip config,uip help,uip tools list,--help, and--versionstill run. - A pinned tool that is not installed installs on its pin at first use. A pinned tool installed at another version makes the command refuse until
uip updateruns. - A tool that the block does not list does not run, also when the block pins only the CLI.
uip updateputs the CLI, each pinned tool, and the skills on their pins, up or down.uip tools updatedoes the same for the tools.uip skills install,update,list,search, andshowfollowversions.skills.- The Studio-bundled CLI ignores
versions.cliandversions.tools, with one stderr line, and followsversions.skills.
uip --version shows a freeze. Before its one stdout line, it writes frozen at <versions.cli> to stderr, so $(uip --version) still gives only the version.
In uip tools list, a tool the freeze lists has the status frozen at its pin and off freeze at another version. A tool the freeze does not list is off freeze too.
Freezing a CI pipeline
A fresh runner has no tools, so without a freeze each one installs at the newest patch on the CLI line. The pins come from a machine where the chosen CLI version is installed.
The freeze runs right after the install, before any other command: until the machine is frozen, the first normal command runs the daily sync, which can move the CLI to the newest version. uip config commands do not run the sync.
In a repo with no config file yet, an empty .uipath/config.json makes the freeze go to the repo instead of the home config:
npm install -g @uipath/cli@<version>
mkdir -p .uipath && touch .uipath/config.json # only when the repo has no config file
uip config freeze --all # pins the CLI, every tool and the skills
git add .uipath/config.json
npm install -g @uipath/cli@<version>
mkdir -p .uipath && touch .uipath/config.json # only when the repo has no config file
uip config freeze --all # pins the CLI, every tool and the skills
git add .uipath/config.json
--all pins every tool without running it. Plain uip config freeze pins only the installed tools, and refuses when none is installed.
Freeze changes only the versions block and core.updateChannel. Every other key in the file goes into the repo too, and a review of the file before the commit catches keys that do not belong there.
In the pipeline, the job installs the pinned CLI and runs uip update from inside the repo:
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
npm install -g "@uipath/cli@$CLI_PIN"
uip update
uip skills install --agent <agent> # only on a runner with no skills
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
npm install -g "@uipath/cli@$CLI_PIN"
uip update
uip skills install --agent <agent> # only on a runner with no skills
The || exit 1 stops the job when the config file is missing or is not valid JSON. Without it, the install spec becomes @uipath/cli@, which npm installs as latest with exit 0.
uip update puts the CLI and each pinned tool on their pins, and moves installed skills to the skills pin. It does not install skills on a runner that has none. At its end, it reads the CLI and each pinned tool from disk again, and exits 1 when one is still off its pin.
The pipeline installs the pinned CLI, not latest. When the pin names a CLI older than 1.207.0, uip update from a newer CLI installs it with exit 0, and later jobs run unfrozen. The pinned CLI shows this at once: uip --version prints no frozen at line.
Moving or removing a freeze
| 目标 | 命令 |
|---|---|
| Move to the newest CLI, tools, and skills on the channel, and write the new pins | uip update --force |
| Move to a chosen CLI version | npm install -g @uipath/cli@<version>, then uip config freeze --force right away, then uip update |
| Re-pin what is installed now | uip config freeze --force |
| Add or change one tool pin | uip tools install <tool>[@<version>] --force |
| Remove a tool and its pin | uip tools uninstall <tool> --force |
| Copy the freeze to a repo with no shared history | uip config export --output-file <path>, then uip config import --input <path> on the other side |
| Remove the freeze | uip config unfreeze |
When the CLI moves to a new minor, uip config freeze --force keeps the pinned tools and moves each one to the newest version on the new line. uip update then installs them.
Limits
- The CLI and each tool are one install per machine. Two frozen repos with different pins on one machine share that install, so the second repo refuses its commands. One runner holds one freeze at a time.
- A freeze holds only when every config on the machine is frozen. A command under a config without a
versionsblock runs the daily sync, which can move the shared install off the pins of every frozen config. versions.skillsholds only for skills thatuip skills installoruip updateinstalled. Skills added another way, such as a Claude Code plugin added straight from GitHub, follow the skills repo and ignore the pin.- The npm dependencies of the tools are not frozen: some tools install them with version ranges.
For a developer workstation, no freeze is needed: the daily sync keeps the CLI, tools, and skills current. Inside a frozen repo, the repo pins apply.
弃用周期
当命令或标志消失时,路径为:
- 已宣布弃用— 该命令在其参考页面中标记为
Deprecated,并且引入弃用的次要版本的发行说明中列出了该命令。记录了替换操作。 - runtime 警告—
uip <deprecated-command> ...继续工作,但在标准错误 (stderr) 上发出警告。使用标准输出的脚本不受影响。 - 在下一个主要版本中删除—将在下一个主要版本提升时删除该命令。在弃用和删除之间至少有一个完整的主要周期— 对于受支持生命周期中的任何管道来说,该周期足够长。
运行uip <command> --help以查看某个命令是否已弃用;标签将显示在摘要中。
数据形状发生变化时
由于Data是特定于命令的,并且可能在 MINOR 版本中进行更改,因此提取特定字段 ( --output-filter "Jobs[0].Key" ) 的管道是最受 MINOR 影响的管道。两种缓解措施:
- Freeze the versions in CI (see Freezing versions). You choose when to validate new shapes.
- Query defensively — prefer JMESPath expressions that tolerate missing fields (
Data.Jobs[0].Key || '') when you can; check the release notes before upgrading.
MINOR 中很少出现破坏性的Data形状更改,在更改的命令下的发行说明中标记为[Data shape] 。
观察变更位置
- 发行说明— 每个版本添加的命令、更改的标志和形状变化的摘要。
uip --version和uip tools list— 计算机上当前安装的内容。跨环境进行比较,以捕获偏差。- npm — 发布者上每个工具的包都会在其中列出分布式标签和发布历史记录。
另请参阅
- 输出格式— 合同描述的信封形状。
- 退出代码— 五层合同。
- 工具(插件) — 版本固定支持的主机工具模型。
- 发行说明— 更改内容和时间。
- 从旧版 .NET CLI 迁移— 如果您使用
2025.10或更早版本