“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 — 解决方案中的内部项目,而不是解决方案本身。从CloudProjectId的uip agent push字段、 uip agent list的projects[]数组或已推送项目的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是项目根目录中以斜杠分隔的完整路径,包括嵌套文件夹名称。IsMain和IsEntryPoint为字符串化的布尔值 ( "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"
}
}
相关内容
uip agent pull— 将整个解决方案下载为.uis存档。uip agent push— 导入项目(新项目或覆盖项目)。uip agent list— 枚举解决方案(及其项目)。