UiPath CLI 用户指南
uip agent push和uip agent pull是 Studio Web 往返过程的两个半部分。它们使用相同的传输格式( .uis ,即智能体项目的 ZIP 存档文件)、相同的身份验证模型和相同的错误界面。使用push将本地项目发送到 Studio Web,以便该项目显示在 Agent Builder 用户界面中;使用pull从 Studio Web 下载解决方案作为.uis ,您可以检查、提取或打包到 Orchestrator 部署中。
这两个动词都需要活动的 CLI 会话 ( uip login )。
uip 智能体推送
将智能体项目作为新解决方案导入 Studio Web,或覆盖现有解决方案。
当输入为目录时, push将验证项目结构,运行 Studio Web 架构验证阶段( --skip-schema-validation除外),打包到临时.uis (不包括.agent-builder/ ),并将存档发布到 Studio Web 解决方案导入 API。当输入已经是.uis时,系统会按原样上传存档。
成功目录推送后,项目根目录中的SolutionStorage.json将使用返回的云解决方案和项目 ID 进行更新 — 后续的uip agent eval run调用可以使用这些 ID,而无需您传递--solution-id 。
大纲
uip agent push [path] [-n <name>] [--overwrite <solutionId>] [--skip-schema-validation] [--login-validity <minutes>]
uip agent push [path] [-n <name>] [--overwrite <solutionId>] [--skip-schema-validation] [--login-validity <minutes>]
参数
[path](可选,默认为.) — 智能体项目目录或.uis文件的路径。
选项
| 标记 | 默认 | 用途 |
|---|---|---|
-n, --name <name> | 智能体metadata.name → 路径基本名称 | Studio Web 中的解决方案名称。 |
--overwrite <solutionId> | — | 按 ID 覆盖现有解决方案,而不是创建新解决方案。将端点从POST /api/Solution/Import更改为POST /api/Solution/<id>/Overwrite 。 |
--skip-schema-validation | 关闭 | 跳过 Studio Web 架构验证阶段。仅目录输入 — .uis输入从不运行架构验证。 |
--login-validity <minutes> | 10 | 令牌有效期的最短分钟数要求。 |
示例
# Push the current directory as a new solution
uip agent push
# Push a specific directory
uip agent push ./my-agent
# Overwrite an existing solution in place
uip agent push ./my-agent --overwrite a1b2c3d4-0000-0000-0000-000000000001
# Push a pre-packed archive
uip agent push ./dist/my-agent.uis
# Push the current directory as a new solution
uip agent push
# Push a specific directory
uip agent push ./my-agent
# Overwrite an existing solution in place
uip agent push ./my-agent --overwrite a1b2c3d4-0000-0000-0000-000000000001
# Push a pre-packed archive
uip agent push ./dist/my-agent.uis
数据形状(--输出 json)
{
"Code": "AgentPush",
"Data": {
"Status": "Agent imported into Studio Web",
"Name": "my-agent",
"SolutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"ProjectCount": 1,
"CloudProjectId": "a1b2c3d4-0000-0000-0000-000000000002"
}
}
{
"Code": "AgentPush",
"Data": {
"Status": "Agent imported into Studio Web",
"Name": "my-agent",
"SolutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"ProjectCount": 1,
"CloudProjectId": "a1b2c3d4-0000-0000-0000-000000000002"
}
}
对于--overwrite , Status为"Solution overwritten successfully" ,而SolutionId会回显您传递的值。如果响应不包含项目数组,则CloudProjectId为"-" 。
UIP 智能体拉取
从 Studio Web 将解决方案下载为.uis存档。(可选)将存档提取到同级目录中。
大纲
uip agent pull <solutionId> [-d <dir>] [-n <name>] [--extract] [--login-validity <minutes>]
uip agent pull <solutionId> [-d <dir>] [-n <name>] [--extract] [--login-validity <minutes>]
参数
<solutionId>(必填) — 解决方案 UUID。从uip agent list中获取一个。
选项
| 标记 | 默认 | 用途 |
|---|---|---|
-d, --destination <dir> | . | 已下载文件的目标目录。根据需要创建。 |
-n, --name <name> | <solutionId> | 输出文件名(去除扩展名)。如果不存在,则会附加.uis 。 |
--extract | 关闭 | 下载后,将.uis提取到与其一起命名的目录中。 |
--login-validity <minutes> | 10 | 令牌有效期的最短分钟数要求。 |
示例
# Download by ID into the current directory
uip agent pull a1b2c3d4-0000-0000-0000-000000000001
# Download into a specific directory
uip agent pull a1b2c3d4-0000-0000-0000-000000000001 -d ./downloads
# Download with a friendly filename and extract
uip agent pull a1b2c3d4-0000-0000-0000-000000000001 \
-d ./downloads \
-n invoice-agent \
--extract
# Download by ID into the current directory
uip agent pull a1b2c3d4-0000-0000-0000-000000000001
# Download into a specific directory
uip agent pull a1b2c3d4-0000-0000-0000-000000000001 -d ./downloads
# Download with a friendly filename and extract
uip agent pull a1b2c3d4-0000-0000-0000-000000000001 \
-d ./downloads \
-n invoice-agent \
--extract
数据形状(--输出 json)
{
"Code": "AgentPull",
"Data": {
"Status": "Solution exported successfully",
"SolutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Output": "/abs/path/downloads/a1b2c3d4-0000-0000-0000-000000000001.uis"
}
}
{
"Code": "AgentPull",
"Data": {
"Status": "Solution exported successfully",
"SolutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Output": "/abs/path/downloads/a1b2c3d4-0000-0000-0000-000000000001.uis"
}
}
使用--extract时,有效负载还会包含ExtractedTo: "/abs/path/downloads/<name>" 。
往返示例
# Iterate locally, push to Studio Web, edit in the UI, pull back
uip agent init ./my-agent
uip agent validate ./my-agent
uip agent push ./my-agent # captures SolutionId
# (edit in Studio Web)
uip agent pull <SolutionId> -d ./downloads --extract
# compare ./my-agent with ./downloads/<SolutionId>/ to reconcile
# Iterate locally, push to Studio Web, edit in the UI, pull back
uip agent init ./my-agent
uip agent validate ./my-agent
uip agent push ./my-agent # captures SolutionId
# (edit in Studio Web)
uip agent pull <SolutionId> -d ./downloads --extract
# compare ./my-agent with ./downloads/<SolutionId>/ to reconcile
相关内容
uip agent list— 枚举要馈入pull解决方案 ID。uip agent pack— 在不涉及 Studio Web 的情况下生成.uis。uip agent validate— 在push之前运行,以避免服务器端拒绝。uip agent share— 推送后共享解决方案。