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

UIP 编码应用程序包

“uip codedapp pack”的语法和选项,可将构建的编码应用程序打包到“.nupkg”存档中以供发布。

uip codedapp pack将构建的编码应用程序打包到.nupkg存档中,准备发布。它会读取<dist>目录,应用提供的包元数据,并将存档写入--output-dir (默认为./.uipath )。使用--dry-run检查包配置并预览输出路径,无需将任何内容写入磁盘。这是未经身份验证的本地打包步骤 — 它不接受登录/身份验证覆盖标志;仅适用于push / pull / publish / deploy 。

大纲​

uip codedapp pack <dist> [options]
uip codedapp pack <dist> [options]
  • <dist> — path to the dist folder containing the built application. The folder must contain index.html at its root; only static builds are supported.

包 ID​

The package ID is derived from --name: the name is lowercased, spaces and underscores become hyphens, other characters outside a-z, 0-9, and - are removed, repeated hyphens collapse to one, and leading or trailing hyphens are trimmed. For example, --name "My App" produces the package ID my-app. When the name changes, the CLI prints a warning that names the sanitized value. The display title keeps the name as typed unless you pass --display-name.

当在交互式终端中省略--name时,命令会提示输入 。在非交互式运行中,缺少名称将无法执行命令。

选项​

标记描述
-n, --name <name>Package name. The package ID is derived from it (refer to Package ID).
--display-name <name>UiPath 中显示的人类可读应用程序标题。默认为输入的 --name。
-v, --version <version>包版本。默认值: 1.0.0 。
--output-dir <dir>输出目录。默认值: ./.uipath 。
--author <author>包作者。默认值: UiPath Developer 。
--description <desc>包描述。
--main-file <file>主条目文件。默认值: index.html 。
--content-type <type>内容类型: webapp 、 library或process 。默认值: webapp 。
--repository-url <url>源存储库 URL,记录在包中以便追踪。
--repository-commit <sha>记录源存储库提交哈希值,以便追踪。
--repository-branch <branch>源存储库分支。
--repository-type <type>源存储库类型。如果设置 git,则默认为 --repository-url。
--release-notes <text>参阅包的发行说明。
--project-url <url>Automation Hub 概念 URL。
--dry-runShow what would be packaged without creating the package or writing any file.

示例​

# Default — writes ./.uipath/myapp.1.0.0.nupkg
uip codedapp pack ./dist --name "MyApp" --version "1.0.0"

# Custom output directory and author
uip codedapp pack ./dist \
    --name "MyApp" --version "2.0.0" \
    --output-dir ./packages \
    --author "Contoso Ltd."

# Separate display title — package id stays my-app
uip codedapp pack ./dist --name "my-app" --display-name "My App" --version "1.0.0"

# Check the package configuration without writing anything to disk
uip codedapp pack ./dist --name "MyApp" --version "1.0.0" --dry-run

# Write the .nupkg into a directory other than ./.uipath
uip codedapp pack ./dist --name "MyApp" --version "1.0.0" --output-dir ./out
# Default — writes ./.uipath/myapp.1.0.0.nupkg
uip codedapp pack ./dist --name "MyApp" --version "1.0.0"

# Custom output directory and author
uip codedapp pack ./dist \
    --name "MyApp" --version "2.0.0" \
    --output-dir ./packages \
    --author "Contoso Ltd."

# Separate display title — package id stays my-app
uip codedapp pack ./dist --name "my-app" --display-name "My App" --version "1.0.0"

# Check the package configuration without writing anything to disk
uip codedapp pack ./dist --name "MyApp" --version "1.0.0" --dry-run

# Write the .nupkg into a directory other than ./.uipath
uip codedapp pack ./dist --name "MyApp" --version "1.0.0" --output-dir ./out

数据形状(--输出 json)​

{
  "Code": "PackCompleted",
  "Data": {
    "Message": "Package created successfully.",
    "Package": "myapp@1.0.0",
    "Output": ".uipath/myapp.1.0.0.nupkg"
  }
}
{
  "Code": "PackCompleted",
  "Data": {
    "Message": "Package created successfully.",
    "Package": "myapp@1.0.0",
    "Output": ".uipath/myapp.1.0.0.nupkg"
  }
}

A dry run (--dry-run) returns a different code and message, and Output shows the path the package would take:

{
  "Code": "PackDryRunCompleted",
  "Data": {
    "DryRun": true,
    "Message": "Dry run - no package created.",
    "Package": "myapp@1.0.0",
    "Output": ".uipath/myapp.1.0.0.nupkg"
  }
}
{
  "Code": "PackDryRunCompleted",
  "Data": {
    "DryRun": true,
    "Message": "Dry run - no package created.",
    "Package": "myapp@1.0.0",
    "Output": ".uipath/myapp.1.0.0.nupkg"
  }
}

A failed pack returns Result: "Failure" with Message: "Pack failed" and the cause in Instructions.

另请参阅​

此页面有帮助吗?

连接

需要帮助? 支持(opens in new window)

想要了解详细内容? UiPath Academy(opens in new window)

有问题? UiPath 论坛(opens in new window)

保持更新