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

uip 智能体文件

“uip 智能体文件”的语法和选项,可读取并覆盖 Studio Web 智能体项目中的单个文件。

uip agent file作用于 Studio Web 项目中的单个文件,其粒度类似于uip agent pull / push ,后者移动整个.uis存档。当您希望读取或覆盖特定文件(例如,修补agent.json )而不拉取和重新打包整个解决方案时,请使用file

每个子命令都需要活动的 CLI 会话 ( uip login )。所有子命令均采用全局选项--output--output-filter--log-level--log-file )。退出代码遵循标准合同

大纲

uip agent file list <projectId>                                    [--login-validity <minutes>]
uip agent file get  <projectId> <fileId> [-d <path>]               [--login-validity <minutes>]
uip agent file put  <projectId> <fileId> <localPath>               [--login-validity <minutes>]
uip agent file list <projectId>                                    [--login-validity <minutes>]
uip agent file get  <projectId> <fileId> [-d <path>]               [--login-validity <minutes>]
uip agent file put  <projectId> <fileId> <localPath>               [--login-validity <minutes>]

<projectId>Studio Web 项目UUID — 解决方案中的内部项目,而不是解决方案本身。从CloudProjectIduip agent push字段、 uip agent listprojects[]数组或已推送项目的SolutionStorage.json中获取一个变量。

uip 智能体文件列表

将 Studio Web 项目中的文件以平面树的形式列出。

参数

  • <projectId> (必填) — Studio Web 项目 UUID。

选项

标记默认用途
--login-validity <minutes>10令牌有效期的最短分钟数要求。

示例

uip agent file list a1b2c3d4-0000-0000-0000-000000000001
uip agent file list a1b2c3d4-0000-0000-0000-000000000001

数据形状(--输出 json)

{
  "Code": "AgentFileList",
  "Data": [
    {
      "Path": "Agent/agent.json",
      "Id": "a1b2c3d4-0000-0000-0000-000000000201",
      "Name": "agent.json",
      "FileType": "json",
      "IsMain": "true",
      "IsEntryPoint": "true"
    }
  ]
}
{
  "Code": "AgentFileList",
  "Data": [
    {
      "Path": "Agent/agent.json",
      "Id": "a1b2c3d4-0000-0000-0000-000000000201",
      "Name": "agent.json",
      "FileType": "json",
      "IsMain": "true",
      "IsEntryPoint": "true"
    }
  ]
}

Path是项目根目录中以斜杠分隔的完整路径,包括嵌套文件夹名称。IsMainIsEntryPoint为字符串化的布尔值 ( "true" / "false" )。空项目会返回Data: { "Message": "No files found in project" }

uip 智能体文件获取

下载单个文件。将其写入磁盘或通过 Base64 编码到响应中。

参数

  • <projectId> (必填) — 项目 UUID。
  • <fileId> (必填) — 文件 UUID(来自file list )。

选项

标记默认用途
-d, --destination <path>(写入响应)要写入文件的本地路径。系统会自动创建父目录。
--login-validity <minutes>10令牌有效期的最短分钟数要求。

示例

# Download to a specific file path
uip agent file get \
  a1b2c3d4-0000-0000-0000-000000000001 \
  a1b2c3d4-0000-0000-0000-000000000201 \
  -d ./agent.json

# Fetch without writing to disk (content is inlined base64)
uip agent file get \
  a1b2c3d4-0000-0000-0000-000000000001 \
  a1b2c3d4-0000-0000-0000-000000000201
# Download to a specific file path
uip agent file get \
  a1b2c3d4-0000-0000-0000-000000000001 \
  a1b2c3d4-0000-0000-0000-000000000201 \
  -d ./agent.json

# Fetch without writing to disk (content is inlined base64)
uip agent file get \
  a1b2c3d4-0000-0000-0000-000000000001 \
  a1b2c3d4-0000-0000-0000-000000000201

数据形状(--输出 json)

包含 -d

{
  "Code": "AgentFileGet",
  "Data": {
    "Status": "File downloaded",
    "ProjectId": "a1b2c3d4-0000-0000-0000-000000000001",
    "FileId": "a1b2c3d4-0000-0000-0000-000000000201",
    "Output": "/abs/path/agent.json"
  }
}
{
  "Code": "AgentFileGet",
  "Data": {
    "Status": "File downloaded",
    "ProjectId": "a1b2c3d4-0000-0000-0000-000000000001",
    "FileId": "a1b2c3d4-0000-0000-0000-000000000201",
    "Output": "/abs/path/agent.json"
  }
}

不使用-d (内联):

{
  "Code": "AgentFileGet",
  "Data": {
    "Status": "File downloaded",
    "ProjectId": "…",
    "FileId": "…",
    "Content": "<base64>",
    "Encoding": "base64"
  }
}
{
  "Code": "AgentFileGet",
  "Data": {
    "Status": "File downloaded",
    "ProjectId": "…",
    "FileId": "…",
    "Content": "<base64>",
    "Encoding": "base64"
  }
}

uip 智能体文件放置

在 Studio Web 项目中上传/覆盖文件。文件将作为多部分表单数据发送至PUT /api/Project/<projectId>/FileOperations/File/<fileId>

参数

  • <projectId> (必填) — 项目 UUID。
  • <fileId> (必填) — 要覆盖的文件 UUID。
  • <localPath> (必填) — 要上传的本地文件路径。

选项

标记默认用途
--login-validity <minutes>10令牌有效期的最短分钟数要求。

示例

uip agent file put \
  a1b2c3d4-0000-0000-0000-000000000001 \
  a1b2c3d4-0000-0000-0000-000000000201 \
  ./agent.json
uip agent file put \
  a1b2c3d4-0000-0000-0000-000000000001 \
  a1b2c3d4-0000-0000-0000-000000000201 \
  ./agent.json

数据形状(--输出 json)

{
  "Code": "AgentFilePut",
  "Data": {
    "Status": "File uploaded",
    "ProjectId": "a1b2c3d4-0000-0000-0000-000000000001",
    "FileId": "a1b2c3d4-0000-0000-0000-000000000201",
    "LocalPath": "/abs/path/agent.json"
  }
}
{
  "Code": "AgentFilePut",
  "Data": {
    "Status": "File uploaded",
    "ProjectId": "a1b2c3d4-0000-0000-0000-000000000001",
    "FileId": "a1b2c3d4-0000-0000-0000-000000000201",
    "LocalPath": "/abs/path/agent.json"
  }
}

另请参阅

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新