UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

uip solution projects

Syntax and options for `uip solution projects`, which manages the projects listed in a `.uipx` solution manifest, plus cloud-project publish and sync.

uip solution projects manages the projects listed inside a .uipx solution manifest — RPA processes, tests, agents, Maestro flows, case and BPMN projects, coded apps, functions, API workflows, and other buildable project types. A library is not a project — publish it on its own, then attach it with uip solution resources add --source remote --kind Library.

备注:

This group was previously documented as project (singular). The singular form still works — it's kept registered as a hidden, deprecated alias for back-compat — but projects is canonical going forward.

子命令用途
add注册一个已位于解决方案目录中的项目文件夹。
import将外部项目文件夹复制到解决方案目录中,然后注册。
remove.uipx中取消注册项目(不会删除磁盘上的文件)。
listList the projects registered in the local .uipx.
publishPublish a cloud solution project as a solution package.
resyncSync or reset a cloud solution project.

add, import, remove, and list operate on local files only — no authentication required. publish and resync operate on a cloud solution project and require an active session.

大纲

uip solution projects add <project-path> [solutionFile]
uip solution projects import <source> [--solutionFile <path>]
uip solution projects remove <project-path> [solutionFile]
uip solution projects list [--solution-folder <path>]
uip solution projects publish --project-name <name> --package-name <name> --package-version <version> [--folder-name <name>] [--description <text>] [--release-notes <text>] [-t <tenant-name>]
uip solution projects resync [project-name] [--project-name <name>] [--sync-option <Sync|Reset>] [-t <tenant-name>]
uip solution projects add <project-path> [solutionFile]
uip solution projects import <source> [--solutionFile <path>]
uip solution projects remove <project-path> [solutionFile]
uip solution projects list [--solution-folder <path>]
uip solution projects publish --project-name <name> --package-name <name> --package-version <version> [--folder-name <name>] [--description <text>] [--release-notes <text>] [-t <tenant-name>]
uip solution projects resync [project-name] [--project-name <name>] [--sync-option <Sync|Reset>] [-t <tenant-name>]

每个子命令都遵循全局选项,并返回标准退出代码

Common behaviour (add / import / remove)

  • The target project folder must contain a project.uiproj, legacy project.json, or uipath.json descriptor. The command auto-detects which one.
  • When [solutionFile] is omitted, the command searches upward from the project path (or the current directory, for import) for the nearest .uipx. If none is found, or if multiple .uipx files live in the same folder, the command fails and exits with 1.
  • 系统会为添加到清单文件的每个项目条目生成唯一的Id (UUID)。

添加

注册已驻留在解决方案目录中的项目文件夹。项目文件夹的相对路径记录在.uipx中,且系统会在解决方案的内部资源构建器中配置匹配的条目。

参数

  • <project-path> (required) — Path to the project folder. Must contain project.uiproj, project.json, or uipath.json.
  • [solutionFile] (可选).uipx解决方案清单文件的路径。如果省略,则通过从<project-path>向上遍历来找到最近的.uipx

示例

uip solution projects add ./my-solution/my-project ./my-solution/my-solution.uipx

# Auto-detect the .uipx
uip solution projects add ./my-solution/my-project
uip solution projects add ./my-solution/my-project ./my-solution/my-solution.uipx

# Auto-detect the .uipx
uip solution projects add ./my-solution/my-project

数据形状(--输出 json)

{
  "Code": "ProjectAdd",
  "Data": {
    "Status": "Added successfully",
    "Project": "my-project/project.uiproj",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}
{
  "Code": "ProjectAdd",
  "Data": {
    "Status": "Added successfully",
    "Project": "my-project/project.uiproj",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}

故障模式

  • 项目位于解决方案文件夹之外。该命令使用指向projects import的指针拒绝添加,这会复制外部项目。
  • Project is already registered. Exits with 1 and a message naming the existing project path.

import

外部项目文件夹复制到解决方案目录中(保留其文件夹名称),然后在.uipx中将其注册。当要包含的项目尚未在解决方案根目录下时,请使用此选项。

参数

  • <source> (required) — Path to the external project folder to import. Must be a directory containing project.uiproj, project.json, or uipath.json. This is a positional argument, not a flag — earlier docs on this page showed it as --source <path>, which is wrong.

选项

默认描述
--solutionFile路径nearest .uipx above the current directoryPath to the .uipx solution manifest.

示例

uip solution projects import ./external-project \
  --solutionFile ./my-solution/my-solution.uipx

# From inside the solution directory (auto-detect .uipx)
cd ./my-solution
uip solution projects import ../shared-library
uip solution projects import ./external-project \
  --solutionFile ./my-solution/my-solution.uipx

# From inside the solution directory (auto-detect .uipx)
cd ./my-solution
uip solution projects import ../shared-library

数据形状(--输出 json)

{
  "Code": "ProjectImport",
  "Data": {
    "Status": "Imported successfully",
    "Project": "external-project/project.uiproj",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}
{
  "Code": "ProjectImport",
  "Data": {
    "Status": "Imported successfully",
    "Project": "external-project/project.uiproj",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}

故障模式和回滚

  • 目标文件夹已存在。命令拒绝覆盖;请先重命名源文件夹或删除现有目标。
  • 项目已在.uipx清单中存储。在复制任何文件之前拒绝。
  • 复制、写入或构建器步骤失败。命令回滚 — 复制的目录将被删除,并且.uipx将还原为其原始内容。

remove

Unregister a project from the .uipx solution manifest and remove its entry from the internal resource builder. Files on disk are not deleted. Refuses to remove the last project in a solution (an empty Projects[] is only valid immediately after init) — the one exception is a project of an unsupported type, which can always be removed to unblock pack.

参数

  • <project-path> (必填) — 要删除的项目文件夹的路径。当前必须在.uipx中注册。
  • [solutionFile] (可选).uipx解决方案清单文件的路径。默认为从<project-path>向上遍历找到的最近的.uipx

示例

uip solution projects remove ./my-solution/my-project ./my-solution/my-solution.uipx
uip solution projects remove ./my-solution/my-project ./my-solution/my-solution.uipx

数据形状(--输出 json)

{
  "Code": "ProjectRemove",
  "Data": {
    "Status": "Removed successfully",
    "Project": "my-project",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}
{
  "Code": "ProjectRemove",
  "Data": {
    "Status": "Removed successfully",
    "Project": "my-project",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}

故障模式

  • 项目位于解决方案文件夹之外。相对路径不得以..开头。
  • 项目不在清单中。1退出并将相对路径用于搜索。
  • Project is the only one left in the solution. Refused unless it's of an unsupported project type.

列表

List the projects registered in the local .uipx solution manifest. Reads only on-disk metadata — no backend call.

选项

默认描述
--solution-folder路径当前目录Path to the solution root folder.

示例

uip solution projects list
uip solution projects list

数据形状(--输出 json)

{
  "Code": "SolutionProjectsList",
  "Data": [
    {
      "Name": "MyProject",
      "Type": "Process",
      "Id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "ProjectRelativePath": "MyProject/project.uiproj",
      "ProjectFilePath": "/workspace/my-solution/MyProject/project.uiproj"
    }
  ]
}
{
  "Code": "SolutionProjectsList",
  "Data": [
    {
      "Name": "MyProject",
      "Type": "Process",
      "Id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "ProjectRelativePath": "MyProject/project.uiproj",
      "ProjectFilePath": "/workspace/my-solution/MyProject/project.uiproj"
    }
  ]
}

发布

Publish a cloud solution project (one already living in Automation Cloud, not a local .uipx project) as a solution package, and wait for the publish operation to complete.

选项

默认描述
--project-nametextRequired. Cloud solution project name to publish.
--package-nametextRequired. Solution package name to create.
--package-versiontextRequired. Solution package version to create.
--folder-nametextRoot folder name to store in the solution package.
--descriptiontextSolution package description.
--release-notestextSolution package release notes.
-t, --tenantname会话默认值Tenant.
--timeout360Publish-polling timeout.
--poll-intervalms5000Milliseconds between publish status polls.
--login-validity分钟10Minimum minutes before token expiration to trigger a refresh.

示例

uip solution projects publish --project-name MyProject \
  --package-name my-package --package-version 1.0.0 \
  --folder-name MySolution
uip solution projects publish --project-name MyProject \
  --package-name my-package --package-version 1.0.0 \
  --folder-name MySolution

数据形状(--输出 json)

{
  "Code": "SolutionProjectPublish",
  "Data": {
    "ProjectName": "MyProject",
    "PackageName": "my-package",
    "PackageVersion": "1.0.0",
    "Status": "Completed"
  }
}
{
  "Code": "SolutionProjectPublish",
  "Data": {
    "ProjectName": "MyProject",
    "PackageName": "my-package",
    "PackageVersion": "1.0.0",
    "Status": "Completed"
  }
}

resync

Sync or reset a cloud solution project, and wait for the operation to complete. Sync reconciles the project with its source; Reset discards local cloud changes.

参数

  • [project-name] (optional) — Cloud solution project name to sync. Can also be provided with --project-name; providing both with different values is an error.

选项

默认描述
--project-nametextCloud solution project name to sync (alternative to the positional argument).
--sync-optionSync | ResetSyncWhich sync operation to run.
-t, --tenantname会话默认值Tenant.
--timeout360Sync-polling timeout.
--poll-intervalms5000Milliseconds between sync status polls.
--login-validity分钟10Minimum minutes before token expiration to trigger a refresh.

示例

uip solution projects resync --project-name MyProject --sync-option Sync

# Positional form, reset instead of sync
uip solution projects resync MyProject --sync-option Reset
uip solution projects resync --project-name MyProject --sync-option Sync

# Positional form, reset instead of sync
uip solution projects resync MyProject --sync-option Reset

数据形状(--输出 json)

{
  "Code": "SolutionProjectResync",
  "Data": {
    "ProjectName": "MyProject",
    "Status": "Successful",
    "SyncOption": "Sync",
    "SyncErrors": []
  }
}
{
  "Code": "SolutionProjectResync",
  "Data": {
    "ProjectName": "MyProject",
    "Status": "Successful",
    "SyncOption": "Sync",
    "SyncErrors": []
  }
}

On failure, Instructions lists each sync error by service name and affected resource keys.


另请参阅

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新