- 发行说明
- 简介
- 监管
- 源代码控件
- CI/CD 管道
- 订阅源管理
- 日志记录

Automation Ops 用户指南
关于 UiPath CLI
UiPath™ 提供命令行界面 (CLI),允许您执行某些预定义任务,以管理和测试 RPA 包。 UiPath CLI 的目的是轻松地将这些功能与第三方工具(如 GitLab、Jenkins 等)集成,而无需插件。
UiPath CLI 可与通过 Automation Cloud™、Automation Suite 部署的 Orchestrator 一起使用,或独立使用。
UiPath CLI 的常见用例包括:
- 将 Studio 项目打包到 NuGet 包中。
- 正在将 NuGet 包部署到 Orchestrator。
- 在 Orchestrator 中运行作业。
- 在 Orchestrator 中运行测试集。
UiPath CLI 包含两种类型:
-
UiPath.CLI.Windows
- 仅在 Windows 设备上运行。
- 构建 Windows - Legacy、Windows和 跨平台 项目。
-
UiPath.CLI
- 仅在 Linux 设备上运行。
- 仅构建 跨平台 项目。
在这里,您可以验证 CLI 版本、所需的 .NET 版本和目标机器人版本之间的兼容性。
CLI 版本 |
需要 .NET 版本 |
已构建自动化的目标 Robot 版本 |
---|---|---|
24.10 |
.NET 8 |
2024.10 及更高版本 |
23.10 |
.NET 6 |
2023.10 及更高版本 |
23.4 |
.NET 6 |
2023.4 及更高版本 |
uipcli.exe
(对于 UiPath.CLI.Windows)或uipcli.dll
(对于 UiPath.CLI),位于tools
文件夹中。
您用于创建项目的 UiPath Studio 版本需要与 UiPath.CLI.Windows 的版本匹配。
图例: - 兼容;
- 不兼容。
Orchestrator |
项目类型 |
UiPath.CLI.Windows 23.10 |
UiPath.CLI.Windows 23.6 |
UiPath.CLI.Windows 22.10 |
---|---|---|---|---|
版本 2023.10.x PaaS | Windows - 旧版 |
|
|
|
版本 2023.10.x PaaS | Windows |
|
|
|
版本 2023.10.x PaaS | 跨平台 |
|
|
|
2021.10.x内部部署 |
Windows - 旧版 |
|
|
|
2021.10.x内部部署 |
Windows |
|
|
|
2021.10.x内部部署 |
跨平台 |
|
|
|
2021.10.xPaaS |
Windows - 旧版 |
|
|
|
2021.10.xPaaS |
Windows |
|
|
|
2021.10.xPaaS |
跨平台 |
|
|
|
2022.4.x |
Windows - 旧版 |
|
|
|
2022.4.x |
Windows |
|
|
|
2022.4.x |
跨平台 |
|
|
|
2022.10.x |
Windows - 旧版 |
|
|
|
2022.10.x |
Windows |
|
|
|
2022.10.x |
跨平台 |
|
|
|
2023.4.x | Windows - 旧版 |
|
|
|
2023.4.x | Windows |
|
|
|
2023.4.x | 跨平台 |
|
|
|
Cloud |
Windows - 旧版 |
|
|
|
Cloud |
Windows |
|
|
|
Cloud |
跨平台 |
|
|
|
您用于创建项目的 UiPath Studio 的版本需要与 UiPath.CLI 的版本匹配。 例如,如果您使用 UiPath Studio 2021.10 创建项目, 您需要使用 21.10 版本的 UiPath.CLI。
图例: - 兼容;
- 不兼容。
Orchestrator | 项目类型 | UiPath.CLI 23.10 | UiPath.CLI 23.6 | UiPath.CLI 22.10 | UiPath.CLI 22.4 | UiPath.CLI 21.10 |
---|---|---|---|---|---|---|
版本 2023.10.x PaaS | Windows - 旧版 |
|
|
|
|
|
版本 2023.10.x PaaS | Windows |
|
|
|
|
|
版本 2023.10.x PaaS | 跨平台 |
|
|
|
|
|
2021.10.x内部部署 |
Windows - 旧版 |
|
|
|
|
|
2021.10.x内部部署 |
Windows |
|
|
|
|
|
2021.10.x内部部署 |
跨平台 |
|
|
|
|
|
2021.10.xPaaS |
Windows - 旧版 |
|
|
|
|
|
2021.10.xPaaS |
Windows |
|
|
|
|
|
2021.10.xPaaS |
跨平台 |
|
|
|
|
|
2022.4.x |
Windows - 旧版 |
|
|
|
|
|
2022.4.x |
Windows |
|
|
|
|
|
2022.4.x |
跨平台 |
|
|
|
|
|
2022.10.x |
Windows - 旧版 |
|
|
|
|
|
2022.10.x |
Windows |
|
|
|
|
|
2022.10.x |
跨平台 |
|
|
|
|
|
2023.4.x | Windows - 旧版 |
|
|
|
|
|
2023.4.x | Windows |
|
|
|
|
|
2023.4.x | 跨平台 |
|
|
|
|
|
Cloud |
Windows - 旧版 |
|
|
|
|
|
Cloud |
Windows |
|
|
|
|
|
Cloud |
跨平台 |
|
|
|
|
|
本节介绍如何管理内置 NuGet 订阅源。 此外,它还提供有关如何根据特定项目要求使用自定义 NuGet 订阅源的信息。
uipcli
在以下内置订阅源中搜索依赖项:
-
C:\Program Files\Microsoft SDKs\NuGetPackages
(如果此路径位于当前代理上) -
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages
(如果此路径位于当前代理上)
--disableBuiltInNugetFeeds
参数来指定uipcli
不使用内置订阅源。 此参数可用于以下任务: analyze
、 pack
和test run
。使用配置文件运行uipcli
时,请设置"disableBuiltInNugetFeeds": true
。
打包自动化时可以使用自定义订阅源。
在 UiPath CLI 中使用自定义 nuget.config
要使用自定义订阅源,请执行以下步骤:
-
使用以下格式创建自定义
nuget.config
文件: -
将自定义
nuget.config
文件放置在缓存uipcli
的文件夹中:
在 Azure DevOps 中使用自定义 nuget.config
InstallPlatform
步骤之后,您需要更新配置并将nuget.config
复制到$(Agent.ToolsDirectory)/uipcli
,如以下示例所示:
trigger:
- main
pool:
vmImage: ubuntu-latest
stages:
- stage: Demo
jobs:
- job: Demo
steps:
- task: UiPathInstallPlatform@4
inputs:
cliVersion: 'X_23.6.8581.19168'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: 'nuget.config'
TargetFolder: '$(Agent.ToolsDirectory)/uipcli'
- task: UiPathPack@4
inputs:
versionType: 'AutoVersion'
projectJsonPath: '$(Build.SourcesDirectory)/AutomationProjects/CrossPlatform/VB/ProjectWithCustomLibraryFromOrchestrator_CrossPlatform_VB/project.json'
outputPath: '$(Build.ArtifactStagingDirectory)/Output'
traceLevel: 'Information'
trigger:
- main
pool:
vmImage: ubuntu-latest
stages:
- stage: Demo
jobs:
- job: Demo
steps:
- task: UiPathInstallPlatform@4
inputs:
cliVersion: 'X_23.6.8581.19168'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: 'nuget.config'
TargetFolder: '$(Agent.ToolsDirectory)/uipcli'
- task: UiPathPack@4
inputs:
versionType: 'AutoVersion'
projectJsonPath: '$(Build.SourcesDirectory)/AutomationProjects/CrossPlatform/VB/ProjectWithCustomLibraryFromOrchestrator_CrossPlatform_VB/project.json'
outputPath: '$(Build.ArtifactStagingDirectory)/Output'
traceLevel: 'Information'
在 Jenkins 中使用自定义 nuget.config
InstallPlatform
步骤之后,您需要更新配置并将nuget.config
复制到${WORKSPACE}/CLI
,如以下示例所示:
pipeline {
agent {
label 'plugins-jenkins-lts-agent-01'
}
stages {
stage('Clone') {
steps {
git (
branch: 'main',
url: 'https://github.com/al3xandru-uipath-qa/CI-Plugins-Customer-Support.git'
)
}
}
stage('Install Platform') {
steps {
UiPathInstallPlatform (
traceLevel: 'Information'
)
}
}
stage('Copy nuget.config') {
steps {
bat 'copy nuget.config CLI\\nuget.config'
}
}
stage('Pack') {
steps {
UiPathPack (
outputPath: '${WORKSPACE}/Output',
projectJsonPath: '${WORKSPACE}/AutomationProjects/CrossPlatform/VB/ProjectWithCustomLibraryFromOrchestrator_CrossPlatform_VB/project.json',
traceLevel: 'Information',
version: AutoVersion()
)
}
}
}
}
pipeline {
agent {
label 'plugins-jenkins-lts-agent-01'
}
stages {
stage('Clone') {
steps {
git (
branch: 'main',
url: 'https://github.com/al3xandru-uipath-qa/CI-Plugins-Customer-Support.git'
)
}
}
stage('Install Platform') {
steps {
UiPathInstallPlatform (
traceLevel: 'Information'
)
}
}
stage('Copy nuget.config') {
steps {
bat 'copy nuget.config CLI\\nuget.config'
}
}
stage('Pack') {
steps {
UiPathPack (
outputPath: '${WORKSPACE}/Output',
projectJsonPath: '${WORKSPACE}/AutomationProjects/CrossPlatform/VB/ProjectWithCustomLibraryFromOrchestrator_CrossPlatform_VB/project.json',
traceLevel: 'Information',
version: AutoVersion()
)
}
}
}
}
本节将指导您在计划从在线转换为离线环境时获取自动化依赖项。如果自动化使用自定义库,则需要手动将其传输到目标环境。
UiPath CLI 提供了一种自动化的方法,可以保护依赖项 NuGet 包并将其上传到目标环境。
在继续之前,请确保您满足以下先决条件:
-
确保使用最新版本的 UiPath CLI(至少为 24.12)。
-
如果适用,请确保安装 .NET 8。
-
创建具有以下应用程序作用域(非用户作用域)的外部应用程序:
有关设置外部应用程序的更多详细信息,请参阅Automation Ops - 执行任务。OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring
OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring
具备先决条件后,请按照以下步骤将自动化依赖项转换到离线“离线”环境:
-
使用
restore
命令。您必须提供项目文件夹、依赖项下载位置和安全身份验证信息,才能访问 Orchestrator 库订阅源,如以下示例所示:uipcli package restore "C:\Users\Test_User\OneDrive - UiPath\Documents\UiPath\MathAutomation" --restoreFolder "C:\restoredPackages" --libraryOrchestratorUrl "https://cloud.uipath.com/" --libraryOrchestratorTenant "TENANT_NAME" -A "ORGANIZATION_NAME" -I "EXTERNAL_APPLICATION_ID" -S "EXTERNAL_APPLICATION_SECRET" --libraryOrchestratorApplicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring"
uipcli package restore "C:\Users\Test_User\OneDrive - UiPath\Documents\UiPath\MathAutomation" --restoreFolder "C:\restoredPackages" --libraryOrchestratorUrl "https://cloud.uipath.com/" --libraryOrchestratorTenant "TENANT_NAME" -A "ORGANIZATION_NAME" -I "EXTERNAL_APPLICATION_ID" -S "EXTERNAL_APPLICATION_SECRET" --libraryOrchestratorApplicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring"重要提示:请注意,如果无法从租户订阅源中获取一个包,则不会下载任何包。
-
使用
deploy
命令。此命令会将包上传到租户库订阅源中。您必须提供包含 NuGet 包的文件夹以及 Orchestrator 库订阅源的身份验证详细信息,如以下示例所示:
uipcli.exe package deploy "C:\restoredPackages" "https://alpha.uipath.com/" "TENANT_NAME" -A "ORGANIZATION_NAME" -I "EXTERNAL_APPLICATION_ID" -S "EXTERNAL_APPLICATION_SECRET" --applicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" -o "BusStop" --ignoreLibraryDeployConflict
uipcli.exe package deploy "C:\restoredPackages" "https://alpha.uipath.com/" "TENANT_NAME" -A "ORGANIZATION_NAME" -I "EXTERNAL_APPLICATION_ID" -S "EXTERNAL_APPLICATION_SECRET" --applicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" -o "BusStop" --ignoreLibraryDeployConflict在执行deploy
命令期间,您可能会遇到 “任务已取消”错误消息,如以下示例所示:System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Threading.Tasks.Task.GetExceptions(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at UiPath.CommandLine.Core.AppRunner.Run(String[] args, Func`2 containerBuilderFactory) in C:\ao-ag-eb2c89c4-we\_work\1\s\UiPath.Extensions.CommandLine.Core\AppRunner.cs:line 23 at UiPath.CommandLine.Program.Main(String[] args) in C:\ao-ag-eb2c89c4-we\_work\1\s\UiPath.Extensions.CommandLine\Program.cs:line 10 --- End of stack trace from previous location --- An error was encountered. Please check if everything was configured correctly by visiting https://docs.uipath.com/automation-ops/automation-cloud/latest/user-guide/uipath-command-line-interface
System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Threading.Tasks.Task.GetExceptions(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at UiPath.CommandLine.Core.AppRunner.Run(String[] args, Func`2 containerBuilderFactory) in C:\ao-ag-eb2c89c4-we\_work\1\s\UiPath.Extensions.CommandLine.Core\AppRunner.cs:line 23 at UiPath.CommandLine.Program.Main(String[] args) in C:\ao-ag-eb2c89c4-we\_work\1\s\UiPath.Extensions.CommandLine\Program.cs:line 10 --- End of stack trace from previous location --- An error was encountered. Please check if everything was configured correctly by visiting https://docs.uipath.com/zh-CN/automation-ops/automation-cloud/latest/user-guide/uipath-command-line-interface如果遇到此错误,请重试该命令。通常,该命令在第二次尝试时有效。