| name | agenthub-controller |
| description | Use when you need to interact with the AgentHub Controller — create tasks, create workers, check status, send heartbeat. |
AgentHub Controller CLI
Use the agenthub CLI to interact with the AgentHub Controller. It wraps the Controller API into clean commands.
Authentication
Your Manager token is set in the environment:
AGENTHUB_MANAGER_TOKEN=<your-matrix-access-token>
AGENTHUB_CONTROLLER_URL=<injected-controller-url>
The CLI reads these automatically. No manual header injection needed. Do not hard-code localhost ports; local, Docker, and future remote modes differ.
Commands
Capability Discovery
agenthub schema
Worker Management
agenthub worker list --workspace <workspace-id>
agenthub worker create --workspace <workspace-id> --name builder --runtime-base <openclaw|qwenpaw|copaw|opencode|claude-code|codex|gemini> --model <model-id> --join-group-room true
agenthub apply -f worker.yaml
agenthub apply -f worker.yaml --approval-mode request --room <room-id> --reason "Need confirmation before adding capacity"
agenthub approval confirm --event <approval-timeline-event-id> --approved-by <human-or-manager> --reason "Approved in room"
agenthub approval deny --event <approval-timeline-event-id> --denied-by <human-or-manager> --reason "Not needed"
agenthub worker status --id <worker-id>
agenthub worker wake --id <worker-id>
agenthub worker stop --id <worker-id>
Task Management
agenthub task create --workspace <workspace-id> --title "Build UI" --assign-to <agent-id> --spec "## Goal\nBuild a React dashboard"
agenthub apply -f task.yaml
agenthub task list --run <run-id>
agenthub task status --id <task-id>
agenthub task complete --id <task-id>
agenthub task fail --id <task-id> --reason "timeout"
agenthub task retry --id <task-id>
Run Management
agenthub run create --workspace <workspace-id> --goal "Build a website"
agenthub run status --id <run-id>
agenthub run cancel --id <run-id> --reason "user requested"
agenthub run list --workspace <workspace-id>
Room Operations
agenthub room create --owner <owner-id> --title "Worker: builder" --kind task
agenthub apply -f room.yaml
agenthub room events --room <room-id> --limit 20
agenthub room mention --room <room-id> --agent <agent-id> --body "Please start task task-123"
Team and Human Management
agenthub apply -f team.yaml
agenthub apply -f human.yaml
agenthub team create --workspace <workspace-id> --name delivery-team --leader-name delivery-lead --workers existing-builder,existing-reviewer
agenthub human create --name admin-user --display-name "Admin User" --permission-level 1
Manager Contract Reconcile
agenthub apply -f manager.yaml
Workspace State
agenthub state --workspace <workspace-id>
agenthub heartbeat --workspace <workspace-id>
Output
All commands output JSON by default. Parse with jq when needed:
agenthub worker list --workspace ws-123 | jq '.workers[] | .name'
agenthub run status --id run-456 | jq '.tasks[] | {title, status}'
Decision Pattern
Simple goal (1 task, 1 Worker)
agenthub schema — confirm the current Controller operation contract.
agenthub worker list --workspace <id> — check existing workers
- If no suitable worker: ask for or use the explicitly requested runtime base and model.
- If the room policy or action risk requires confirmation, use
agenthub apply -f worker.yaml --approval-mode request --room <room-id> and wait for agenthub approval confirm ....
- Otherwise use
agenthub worker create --workspace <id> --name <name> --runtime-base <runtime-base> --model <model-id> or agenthub apply -f worker.yaml.
agenthub task create --workspace <id> --title "..." --assign-to <agent-id> --spec "..." or agenthub apply -f task.yaml.
- Let the Controller-created task room @mention wake the Worker; use
agenthub room mention only for explicit follow-up messages.
Complex goal (multiple tasks)
agenthub schema — inspect tasks.assign, apply.manifest, and reconcile.resource.
agenthub run create --workspace <id> --goal "..." — create run if a multi-task run is needed.
agenthub task create or agenthub apply -f tasks.yaml for each task with --run <run-id> and dependency info.
- Monitor with
agenthub run status --id <run-id> and room timeline events.
- Synthesize results when all tasks complete.
Error Handling
Error: HTTP 401 — Token expired. Report to human admin.
Error: HTTP 404 — Resource not found. Check IDs.
Error: HTTP 422 — Validation failed. Read error message and fix params.
- Network errors — Retry up to 3 times with 2s delay.
- Missing runtime base/model/auth/Matrix binding — report the exact blocker in the room; do not choose a default Worker base.
Runtime Base Rules
- Manager runtime choices:
openclaw, qwenpaw.
- Worker runtime bases:
openclaw, qwenpaw, copaw, claude-code, opencode, codex, gemini.
openclaw as Manager and openclaw as Worker are different role contracts.
- Bridge-managed CLI Workers still use Matrix room timeline, WorkerInstance, RuntimeLease, SOUL/AGENTS, skills, shared task contract, and ArtifactStore.
Manager Manifest Rule
kind: Manager always reconciles the Manager contract workspace and Controller-backed registries. It is contract-only by default. If the manifest explicitly sets spec.desiredState: running, stopped, or observed, Controller also reconciles the resident OpenClaw/QwenPaw provider lifecycle and records the runtime status/health in the result snapshot.
Member Reconcile Result
Worker create/apply should be understood as five stages:
- ResolveMemberSpec
- ApplyWorkspaceAgent
- ApplyWorkerInstance
- JoinRooms
- AnnounceAndObserve
If any stage fails, report the failed stage and exact blocker.