mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-13 11:00:50 +00:00
What: switch to 你/你的 tone; standardize Skills/Gateway网关/local loopback/私信 wording Why: align zh-CN docs with issue 6995 feedback + idiomatic tech style Tests: pnpm docs:build
83 lines
1.9 KiB
Markdown
83 lines
1.9 KiB
Markdown
---
|
||
read_when:
|
||
- 你需要多个隔离的智能体(工作区 + 路由 + 认证)
|
||
summary: "`openclaw agents` 的 CLI 参考(列出/添加/删除/设置身份)"
|
||
title: agents
|
||
x-i18n:
|
||
generated_at: "2026-02-01T19:58:38Z"
|
||
model: claude-opus-4-5
|
||
provider: pi
|
||
source_hash: 30556d81636a9ad8972573cc6b498e620fd266e1dfb16eef3f61096ea62f9896
|
||
source_path: cli/agents.md
|
||
workflow: 14
|
||
---
|
||
|
||
# `openclaw agents`
|
||
|
||
管理隔离的智能体(工作区 + 认证 + 路由)。
|
||
|
||
相关内容:
|
||
|
||
- 多智能体路由:[多智能体路由](/concepts/multi-agent)
|
||
- 智能体工作区:[智能体工作区](/concepts/agent-workspace)
|
||
|
||
## 示例
|
||
|
||
```bash
|
||
openclaw agents list
|
||
openclaw agents add work --workspace ~/.openclaw/workspace-work
|
||
openclaw agents set-identity --workspace ~/.openclaw/workspace --from-identity
|
||
openclaw agents set-identity --agent main --avatar avatars/openclaw.png
|
||
openclaw agents delete work
|
||
```
|
||
|
||
## 身份文件
|
||
|
||
每个智能体工作区可以在工作区根目录包含一个 `IDENTITY.md`:
|
||
|
||
- 示例路径:`~/.openclaw/workspace/IDENTITY.md`
|
||
- `set-identity --from-identity` 从工作区根目录读取(或从显式指定的 `--identity-file` 读取)
|
||
|
||
头像路径相对于工作区根目录解析。
|
||
|
||
## 设置身份
|
||
|
||
`set-identity` 将字段写入 `agents.list[].identity`:
|
||
|
||
- `name`
|
||
- `theme`
|
||
- `emoji`
|
||
- `avatar`(工作区相对路径、http(s) URL 或 data URI)
|
||
|
||
从 `IDENTITY.md` 加载:
|
||
|
||
```bash
|
||
openclaw agents set-identity --workspace ~/.openclaw/workspace --from-identity
|
||
```
|
||
|
||
显式覆盖字段:
|
||
|
||
```bash
|
||
openclaw agents set-identity --agent main --name "OpenClaw" --emoji "🦞" --avatar avatars/openclaw.png
|
||
```
|
||
|
||
配置示例:
|
||
|
||
```json5
|
||
{
|
||
agents: {
|
||
list: [
|
||
{
|
||
id: "main",
|
||
identity: {
|
||
name: "OpenClaw",
|
||
theme: "space lobster",
|
||
emoji: "🦞",
|
||
avatar: "avatars/openclaw.png",
|
||
},
|
||
},
|
||
],
|
||
},
|
||
}
|
||
```
|