- 概述
- 开始使用
- 概念
- 使用 UiPath CLI
- 操作指南
- CI/CD 方法
- 命令参考
- 迁移
- 参考与支持
UIP 编码应用程序包
“uip codedapp pack”的语法和选项,可将构建的编码应用程序打包到“.nupkg”存档中以供发布。
uip codedapp pack packages a built coded app into a .nupkg archive ready for publication. It reads the <dist> directory, applies the supplied package metadata, and writes the archive to --output-dir (defaults to ./.uipath). Use --dry-run to check the package configuration and preview the output path without writing anything to disk. This is a local, unauthenticated packaging step — it accepts no login/auth-override flags; those only apply to 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 containindex.htmlat its root; only static builds are supported.
Package 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.
When --name is omitted in an interactive terminal, the command prompts for it. In a non-interactive run, a missing name fails the command.
选项
| 标记 | 描述 |
|---|---|
-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-run | Show 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.
相关内容
- uip codedapp push — 在打包之前将源代码发送到 Studio Web。
- uip codedapp publish — 将生成的
.nupkg上传到 UiPath。