automation-ops
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

Automation Ops 用户指南

上次更新日期 2025年3月10日

关于 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 包含两种类型:

  1. UiPath.CLI.Windows

    • 仅在 Windows 设备上运行。
    • 构建 Windows - LegacyWindows跨平台 项目。
  2. UiPath.CLI

    • 仅在 Linux 设备上运行。
    • 仅构建 跨平台 项目。
备注:
  • 注意:UiPath CLI 不支持 SSO 连接。

  • UiPath CLI 不能用于构建使用本地触发器的项目。

  • UiPath CLI 缺少对包进行签名的功能,而从 Studio 发布包时可以使用此功能。 在这种情况下,唯一的选项是在使用 UiPath CLI 构建包后对包进行签名。 有关详细信息,请参阅签名命令。 此签名选项也适用于 Azure DevOps 和 Jenkins。

先决条件

在这里,您可以验证 CLI 版本、所需的 .NET 版本和目标机器人版本之间的兼容性。

CLI 版本

需要 .NET 版本

已构建自动化的目标 Robot 版本

24.10

.NET 8

2024.10 及更高版本

23.10

.NET 6

2023.10 及更高版本

23.4

.NET 6

2023.4 及更高版本

对于UiPath.CLI.Windows ,您还必须安装附带 .NET SDK 的.NET Desktop Runtime

下载 UiPath CLI

  1. 转到 UiPath 官方公共订阅源
  2. 在“ 按关键字筛选” 搜索栏中,键入uipath.cli
  3. 选择以下任一选项:
    • UiPath.CLI - 专为 Linux 设备设计的 UiPath CLI
    • UiPath.CLI.Windows - 专为 Windows 设备设计的 UiPath CLI
  4. 转到“ 版本 ” 选项卡,然后选择要下载的 CLI 版本。
  5. 选择“ 下载”
  6. 打开下载 NUPKG 文件的文件夹,右键单击该文件夹,然后将文件提取到文件夹中。
结果:系统将创建一个与 NUPKG 文件同名的文件夹。 此文件夹包含 UiPath CLI 的内容。 所有操作的入口点为uipcli.exe (对于 UiPath.CLI.Windows)或uipcli.dll (对于 UiPath.CLI),位于tools文件夹中。

UiPath.CLI.Windows 兼容性列表

您用于创建项目的 UiPath Studio 版本需要与 UiPath.CLI.Windows 的版本匹配。

图例available - 兼容;不可用 - 不兼容。

Orchestrator

项目类型

UiPath.CLI.Windows 23.10

UiPath.CLI.Windows 23.6

UiPath.CLI.Windows 22.10

版本 2023.10.x PaaS

Windows - 旧版

available

available

available

版本 2023.10.x PaaS

Windows

available

available

available

版本 2023.10.x PaaS

跨平台

available

available

available

2021.10.x内部部署

Windows - 旧版

available

available

available

2021.10.x内部部署

Windows

available

available

available

2021.10.x内部部署

跨平台

available

available

available

2021.10.xPaaS

Windows - 旧版

available

available

available

2021.10.xPaaS

Windows

available

available

available

2021.10.xPaaS

跨平台

available

available

available

2022.4.x

Windows - 旧版

available

available

available

2022.4.x

Windows

available

available

available

2022.4.x

跨平台

available

available

available

2022.10.x

Windows - 旧版

available

available

available

2022.10.x

Windows

available

available

available

2022.10.x

跨平台

available

available

available

2023.4.xWindows - 旧版

available

available

available

2023.4.xWindows

available

available

available

2023.4.x跨平台

available

available

available

Cloud

Windows - 旧版

available

available

available

Cloud

Windows

available

available

available

Cloud

跨平台

available

available

available

UiPath.CLI 兼容性列表

您用于创建项目的 UiPath Studio 的版本需要与 UiPath.CLI 的版本匹配。 例如,如果您使用 UiPath Studio 2021.10 创建项目, 您需要使用 21.10 版本的 UiPath.CLI。

图例available - 兼容;不可用 - 不兼容。

Orchestrator项目类型UiPath.CLI 23.10UiPath.CLI 23.6UiPath.CLI 22.10UiPath.CLI 22.4UiPath.CLI 21.10

版本 2023.10.x PaaS

Windows - 旧版

不可用

不可用

不可用

不可用

不可用

版本 2023.10.x PaaS

Windows

不可用

不可用

不可用

不可用

不可用

版本 2023.10.x PaaS

跨平台

available

available

available

available

available

2021.10.x内部部署

Windows - 旧版

不可用

不可用

不可用

available

available

2021.10.x内部部署

Windows

不可用

不可用

不可用

不可用

不可用

2021.10.x内部部署

跨平台

available

available

available

available

available

2021.10.xPaaS

Windows - 旧版

不可用

不可用

不可用

available

available

2021.10.xPaaS

Windows

不可用

不可用

不可用

不可用

不可用

2021.10.xPaaS

跨平台

available

available

available

available

available

2022.4.x

Windows - 旧版

不可用

不可用

不可用

available

available

2022.4.x

Windows

不可用

不可用

不可用

不可用

不可用

2022.4.x

跨平台

available

available

available

available

available

2022.10.x

Windows - 旧版

不可用

不可用

不可用

available

available

2022.10.x

Windows

不可用

不可用

不可用

不可用

不可用

2022.10.x

跨平台

available

available

available

available

available

2023.4.xWindows - 旧版

不可用

不可用

不可用

available

available

2023.4.xWindows

不可用

不可用

不可用

不可用

不可用

2023.4.x跨平台

available

available

available

available

available

Cloud

Windows - 旧版

不可用

不可用

不可用

available

available

Cloud

Windows

不可用

不可用

不可用

不可用

不可用

Cloud

跨平台

available

available

available

available

available

管理 NuGet 订阅源

本节介绍如何管理内置 NuGet 订阅源。 此外,它还提供有关如何根据特定项目要求使用自定义 NuGet 订阅源的信息。

禁用内置 NuGet 订阅源

默认情况下, uipcli在以下内置订阅源中搜索依赖项: 您可以通过设置--disableBuiltInNugetFeeds参数来指定uipcli不使用内置订阅源。 此参数可用于以下任务: analyzepacktest run 。使用配置文件运行uipcli时,请设置"disableBuiltInNugetFeeds": true
docs image
docs image

使用自定义 NuGet 订阅源

打包自动化时可以使用自定义订阅源。

在 UiPath CLI 中使用自定义 nuget.config

要使用自定义订阅源,请执行以下步骤:

  1. 使用以下格式创建自定义nuget.config文件:
     
    
      
        
      
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <add key="test custom feed" value="custom_feed_url" />
      </packageSources>
    </configuration>
  2. 将自定义nuget.config文件放置在缓存uipcli的文件夹中:
    docs image

在 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。

  • 创建具有以下应用程序作用域(非用户作用域)的外部应用程序:

     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.MonitoringOR.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
    有关设置外部应用程序的更多详细信息,请参阅Automation Ops - 执行任务

具备先决条件后,请按照以下步骤将自动化依赖项转换到离线“离线”环境:

  1. 使用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"
    重要提示:

    请注意,如果无法从租户订阅源中获取一个包,则不会下载任何包。

  2. 使用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" --ignoreLibraryDeployConflictuipcli.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-interfaceSystem.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

    如果遇到此错误,请重试该命令。通常,该命令在第二次尝试时有效。

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo White
© 2005-2025 UiPath。保留所有权利。