mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 03:10:22 +00:00
feat: add agents command
This commit is contained in:
@@ -30,6 +30,10 @@ clawdbot [--dev] [--profile <name>] <command>
|
||||
send
|
||||
poll
|
||||
agent
|
||||
agents
|
||||
list
|
||||
add
|
||||
delete
|
||||
status
|
||||
health
|
||||
sessions
|
||||
@@ -147,7 +151,7 @@ Options:
|
||||
- `--workspace <dir>`
|
||||
- `--non-interactive`
|
||||
- `--mode <local|remote>`
|
||||
- `--auth-choice <oauth|apiKey|minimax|skip>`
|
||||
- `--auth-choice <oauth|openai-codex|antigravity|apiKey|minimax|skip>`
|
||||
- `--anthropic-api-key <key>`
|
||||
- `--gateway-port <port>`
|
||||
- `--gateway-bind <loopback|lan|tailnet|auto>`
|
||||
@@ -272,6 +276,29 @@ Options:
|
||||
- `--json`
|
||||
- `--timeout <seconds>`
|
||||
|
||||
### `agents`
|
||||
Manage isolated agents (workspaces + auth + routing).
|
||||
|
||||
#### `agents list`
|
||||
List configured agents.
|
||||
|
||||
Options:
|
||||
- `--json`
|
||||
|
||||
#### `agents add [name]`
|
||||
Add a new isolated agent. If `--workspace` is omitted, runs the guided wizard.
|
||||
|
||||
Options:
|
||||
- `--workspace <dir>`
|
||||
- `--json`
|
||||
|
||||
#### `agents delete <id>`
|
||||
Delete an agent and prune its workspace + state.
|
||||
|
||||
Options:
|
||||
- `--force`
|
||||
- `--json`
|
||||
|
||||
### `status`
|
||||
Show linked session health and recent recipients.
|
||||
|
||||
|
||||
@@ -28,6 +28,16 @@ If you do nothing, Clawdbot runs a single agent:
|
||||
- Workspace defaults to `~/clawd` (or `~/clawd-<profile>` when `CLAWDBOT_PROFILE` is set).
|
||||
- State defaults to `~/.clawdbot/agents/main/agent`.
|
||||
|
||||
## Agent helper
|
||||
|
||||
Use the agent wizard to add a new isolated agent:
|
||||
|
||||
```bash
|
||||
clawdbot agents add work
|
||||
```
|
||||
|
||||
Then add `routing.bindings` (or let the wizard do it) to route inbound messages.
|
||||
|
||||
## Multiple agents = multiple people, multiple personalities
|
||||
|
||||
With **multiple agents**, each `agentId` becomes a **fully isolated persona**:
|
||||
@@ -73,10 +83,12 @@ multiple phone numbers without mixing sessions.
|
||||
|
||||
agents: {
|
||||
home: {
|
||||
name: "Home",
|
||||
workspace: "~/clawd-home",
|
||||
agentDir: "~/.clawdbot/agents/home/agent",
|
||||
},
|
||||
work: {
|
||||
name: "Work",
|
||||
workspace: "~/clawd-work",
|
||||
agentDir: "~/.clawdbot/agents/work/agent",
|
||||
},
|
||||
|
||||
@@ -330,8 +330,10 @@ Run multiple isolated agents (separate workspace, `agentDir`, sessions) inside o
|
||||
|
||||
- `routing.defaultAgentId`: fallback when no binding matches (default: `main`).
|
||||
- `routing.agents.<agentId>`: per-agent overrides.
|
||||
- `name`: display name for the agent.
|
||||
- `workspace`: default `~/clawd-<agentId>` (for `main`, falls back to legacy `agent.workspace`).
|
||||
- `agentDir`: default `~/.clawdbot/agents/<agentId>/agent`.
|
||||
- `model`: per-agent default model (provider/model), overrides `agent.model` for that agent.
|
||||
- `routing.bindings[]`: routes inbound messages to an `agentId`.
|
||||
- `match.provider` (required)
|
||||
- `match.accountId` (optional; `*` = any account; omitted = default account)
|
||||
|
||||
@@ -38,6 +38,12 @@ clawdbot configure
|
||||
**Remote mode** only configures the local client to connect to a Gateway elsewhere.
|
||||
It does **not** install or change anything on the remote host.
|
||||
|
||||
To add more isolated agents (separate workspace + sessions + auth), use:
|
||||
|
||||
```bash
|
||||
clawdbot agents add <name>
|
||||
```
|
||||
|
||||
## Flow details (local)
|
||||
|
||||
1) **Existing config detection**
|
||||
@@ -110,6 +116,20 @@ Notes:
|
||||
- macOS: Bonjour (`dns-sd`)
|
||||
- Linux: Avahi (`avahi-browse`)
|
||||
|
||||
## Add another agent
|
||||
|
||||
Use `clawdbot agents add <name>` to create a separate agent with its own workspace,
|
||||
sessions, and auth profiles. Running without `--workspace` launches the wizard.
|
||||
|
||||
What it sets:
|
||||
- `routing.agents.<agentId>.name`
|
||||
- `routing.agents.<agentId>.workspace`
|
||||
- `routing.agents.<agentId>.agentDir`
|
||||
|
||||
Notes:
|
||||
- Default workspaces follow `~/clawd-<agentId>`.
|
||||
- Add `routing.bindings` to route inbound messages (the wizard can do this).
|
||||
|
||||
## Non‑interactive mode
|
||||
|
||||
Use `--non-interactive` to automate or script onboarding:
|
||||
@@ -128,6 +148,12 @@ clawdbot onboard --non-interactive \
|
||||
|
||||
Add `--json` for a machine‑readable summary.
|
||||
|
||||
Add agent (non‑interactive) example:
|
||||
|
||||
```bash
|
||||
clawdbot agents add work --workspace ~/clawd-work
|
||||
```
|
||||
|
||||
## Gateway wizard RPC
|
||||
|
||||
The Gateway exposes the wizard flow over RPC (`wizard.start`, `wizard.next`, `wizard.cancel`, `wizard.status`).
|
||||
@@ -159,6 +185,8 @@ Typical fields in `~/.clawdbot/clawdbot.json`:
|
||||
- `wizard.lastRunCommand`
|
||||
- `wizard.lastRunMode`
|
||||
|
||||
`clawdbot agents add` writes `routing.agents.<agentId>` and optional `routing.bindings`.
|
||||
|
||||
WhatsApp credentials go under `~/.clawdbot/credentials/whatsapp/<accountId>/`.
|
||||
Sessions are stored under `~/.clawdbot/agents/<agentId>/sessions/`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user