UiPath Documentation
uipath-cli
2026.10
false
UiPath CLI 用户指南

UIP 编码应用程序推送

“uip codedapp push”的语法和选项,用于将本地源代码上传到 Studio Web 编码应用程序项目。

uip codedapp push用于将本地源代码上传到 Studio Web 项目。在执行可选的资源导入操作后,它会从项目根目录上传--build-dir (默认为dist )中的构建输出和项目的源文件。使用它将本地编辑操作返回到最初从 Studio Web 拉取的项目。

大纲​

uip codedapp push [options]
uip codedapp push [options]

选项​

标记描述
--project-id <id>网页应用程序项目 ID。如果省略,则从UIPATH_PROJECT_ID环境变量读取,然后从.env文件中的UIPATH_PROJECT_ID读取。请参阅“项目 ID” 。
--solution-name <name>未设置项目 ID 时要创建的 Studio Web 解决方案的名称。搭配--project-name 。
--project-name <name>未设置项目 ID 时,要在该解决方案中创建的编码应用程序项目的名称。搭配--solution-name 。
--build-dir <dir>构建输出目录。默认值: dist 。
--ignore-resources跳过导入引用资源的步骤。
--allow-large-files允许在没有确认提示的情况下推送 2 MB 到 10 MB 之间的文件。当任何文件为 2 MB 或更大时,在非交互式运行中为必需。
-v, --version <version>设置显式代码版本(例如2.0.0 )。
--verbose显示详细进度日志。
--base-url <url>UiPath 基本 URL(身份验证覆盖)。
--org-id <id>组织 ID(身份验证覆盖)。
--tenant-id <id>租户 ID(身份验证覆盖)。
--access-token <token>访问令牌(身份验证覆盖)。

项目 ID​

push上传到现有 Studio Web 项目。它将从已设置的第一个变量中获取项目 ID: --project-id 、 UIPATH_PROJECT_ID环境变量或UIPATH_PROJECT_ID当前目录的.env文件中。

如果未设置任何项目, push会创建一个新的 Studio Web 解决方案,其中包含编码应用程序项目,并在.env UIPATH_PROJECT_ID以便下一次推送重用它:

  • 使用--solution-name和--project-name时,系统将在没有提示的情况下创建使用这些名称的解决方案和项目。
  • 在没有这些解决方案的交互式终端上,它会询问是否创建新解决方案或使用现有解决方案,并提示您输入任何缺少的名称。
  • 在非交互式运行中,两个名称均为必填项。没有它们, push会失败并命名要通过的选项。

当设置的项目 ID 来自三个来源中的任何一个时,系统将拒绝传递--solution-name或--project-name ,因此,当您请求新项目时,推送永远不会转到现有项目。

环境变量​

When the project has a .env.example file, or a .env.template file when there is no .env.example, push adds its UIPATH_APPS_* names and values to the environment variables of the app in its Studio Web solution. Whoever deploys the app then sees what can be configured.

  • Only names that the solution does not list yet are added. A value already set in Studio Web is not changed.
  • A name removed from the file stays in the solution until someone removes it there.
  • A blank value (NAME=) leaves the variable unset, so the app's own fallback applies.
  • The plain .env file is never read or pushed.
重要提示:

Values in .env.example reach every deployment as its defaults, and anyone who can open the app can read them. Do not put secrets in the file.

To set the values of a deployed standalone app, use uip codedapp deploy --env-vars-file.

排除文件​

push从项目根目录中的.gitignore和.uipignore读取排除模式。.uipignore使用与.gitignore相同的语法,并且当两个文件不一致时, 的模式优先。无论是否存在忽略文件,以下内容始终会被排除在外:

  • node_modules/ 和 .uipath/
  • .gitignore、.uipignore、.gitkeep
  • .env文件,包括.env.local 、 .env.*.local 、 .env.development 、 .env.production 、 .env.test和.env.example
  • 名称以点开头的任何其他文件或文件夹

文件检查​

在上传之前, push会检查将要发送的每个文件:

选中结果
文件扩展名不属于允许的网页相关类型集推送功能已被阻止。系统将列出禁止访问的文件。
10 MB 或更大的文件推送功能已被阻止。
大小不低于 2 MB 且小于 10 MB 的文件交互式:提示确认。非交互式:阻止推送,除非您传递--allow-large-files参数。
action-schema.json 显示且无效推送功能已被阻止。
action-schema.json of a coded action app uses one property name in more than one of inputs, outputs, inOuts, and outcomesPush blocked, before anything is uploaded. Refer to Duplicate action schema property names.

Duplicate action schema property names​

The Apps service rejects an action schema that uses one property name in more than one of inputs, outputs, inOuts, and outcomes on a first publish or install. For a coded action app, push therefore compares the local action-schema.json with the one the last push uploaded:

Case 分支结果
The duplicate name is not in the last pushed schemaPush blocked. Rename the property, then push again.
An earlier push already uploaded that name in those sectionsPush continues with a warning. A deployed app keeps the name on upgrade, and renaming it breaks the app's tasks. A first install of the solution, for example in another tenant, still rejects it.
Earlier pushes did not upload action-schema.json, for example because an ignore rule leaves it outPush continues with a warning.
The remote project cannot be readPush blocked, without uploading. Push again later.

示例​

# Push from the default ./dist build directory
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001

# Custom build directory and explicit version
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001 \
    --build-dir build \
    --version 2.0.0

# Push files between 2 MB and 10 MB without a prompt (CI)
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001     --allow-large-files

# First push: create a new Studio Web solution and coded app project (CI)
uip codedapp push --solution-name "Finance Apps" --project-name "InvoiceViewer"

# Skip resource imports
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001 \
    --ignore-resources
# Push from the default ./dist build directory
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001

# Custom build directory and explicit version
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001 \
    --build-dir build \
    --version 2.0.0

# Push files between 2 MB and 10 MB without a prompt (CI)
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001     --allow-large-files

# First push: create a new Studio Web solution and coded app project (CI)
uip codedapp push --solution-name "Finance Apps" --project-name "InvoiceViewer"

# Skip resource imports
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001 \
    --ignore-resources

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

{
  "Code": "PushCompleted",
  "Data": { "message": "Push completed successfully." }
}
{
  "Code": "PushCompleted",
  "Data": { "message": "Push completed successfully." }
}

推送失败后,将返回带有Result: "Failure"的Message: "Push failed" ,并在Instructions中返回原因。

另请参阅​

此页面有帮助吗?

连接

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

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

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

保持更新