OpenBee
Developer Guide

CLI Reference

Complete reference for the openbee ctl command-line tool

The openbee ctl command is the command-line interface for controlling a running openbee server. All subcommands communicate with the local server over its configured API.

Global Flag

FlagTypeDefaultDescription
--config, -cstringconfig.yamlPath to config file

worker

Manage worker agents.

worker list

List all registered workers with optional filtering and pagination.

openbee ctl worker list [flags]
FlagTypeRequiredDescription
--departmentstringNoFilter by department ID or name
--no-recursiveboolNoOnly return workers directly in the department (not in child departments)
--namestringNoFilter by name (case-insensitive partial match)
--idstringNoFilter by exact worker ID
--pageintNoPage number (default: 1)
--page-sizeintNoPage size (default: 50, max: 200)

worker get

Get a worker by ID.

openbee ctl worker get <id>
ArgumentRequiredDescription
idYesWorker UUID

worker status

Get current status of a worker.

openbee ctl worker status <id>
ArgumentRequiredDescription
idYesWorker UUID

worker create

Create a new worker.

openbee ctl worker create --name <name> [flags]
FlagTypeRequiredDescription
--name, -nstringYesWorker name
--descriptionstringNoWorker description
--constraintsstringNoWorker constraints content
--work-dirstringNoWorking directory path
--enginestringNoAI engine to use (e.g. claude, codex, pi, kimi); leave empty for server default
--departmentstringNoDepartment ID or name (comma-separated for multiple)
--scopesstringNoPermission scopes (comma-separated, e.g. read:workers,read:tasks)
--engine-argsstringNoExtra CLI args per engine, e.g. "claude=--model claude-sonnet-4-6" (repeatable)

worker update

Update a worker's properties (patch semantics: omitted fields are unchanged).

openbee ctl worker update <id> [flags]
Argument / FlagTypeRequiredDescription
idYesWorker UUID
--namestringNoNew name
--descriptionstringNoNew description
--constraintsstringNoNew constraints content
--enginestringNoAI engine to use (e.g. claude, codex, pi, kimi); leave empty to keep unchanged
--departmentstringNoDepartment ID or name (comma-separated); replaces all associations. Pass empty string to clear
--scopesstringNoPermission scopes (comma-separated); replaces all scopes. Pass empty string to clear
--engine-argsstringNoExtra CLI args per engine (repeatable); pass "claude=" to clear

worker delete

Delete a worker.

openbee ctl worker delete <id> [--delete-work-dir]
Argument / FlagTypeRequiredDescription
idYesWorker UUID
--delete-work-dirboolNoAlso delete the working directory from disk

task

Manage tasks.

task list

List tasks. At least one of --session-key, --message-id, or --worker-id is required.

openbee ctl task list [flags]
FlagTypeRequiredDescription
--session-keystringConditionalFilter by session key (mutually exclusive with --message-id)
--message-idstringConditionalFilter by message ID (mutually exclusive with --session-key)
--worker-idstringConditionalFilter by worker ID
--statusstringNoFilter by status, comma-separated (e.g. pending,running)
--typestringNoFilter by type, comma-separated (e.g. immediate,countdown)

task create

Create a task and assign it directly to a worker, bypassing the Bee's automatic routing.

openbee ctl task create --message-id <id> --worker-id <id> --instruction <text> --type <type> [flags]
FlagTypeRequiredDescription
--message-idstringYesID of the originating platform message
--worker-idstringYesWorker UUID to assign
--instructionstringYesInstruction for the worker
--typestringYesTask type: immediate, countdown, or scheduled
--scheduled-atint64ConditionalUnix milliseconds; required for countdown (must be ≥ now + 5s)
--cronstringConditional5-field cron expression; required for scheduled

Examples

# Immediate task — executes as soon as the worker is available
openbee ctl task create \
  --message-id "msg-abc123" \
  --worker-id "worker-uuid" \
  --instruction "Analyze the latest deployment logs and report any errors" \
  --type immediate

# Countdown task — executes at a specific time (Unix milliseconds, must be ≥ now + 5s)
openbee ctl task create \
  --message-id "msg-abc123" \
  --worker-id "worker-uuid" \
  --instruction "Send the end-of-day summary report" \
  --type countdown \
  --scheduled-at 1735660800000

# Scheduled task — executes on a recurring cron schedule
openbee ctl task create \
  --message-id "msg-abc123" \
  --worker-id "worker-uuid" \
  --instruction "Check system health and alert if any service is down" \
  --type scheduled \
  --cron "0 * * * *"

If --cron is invalid, the task is created with status cancelled and a reason field explaining the parse error.

task cancel

Cancel a pending or scheduled task.

openbee ctl task cancel <id>
ArgumentRequiredDescription
idYesTask UUID

memory

Manage persistent memory entries.

memory get

Read memory entries. Omit --key to list all entries in a scope.

openbee ctl memory get --scope <scope> [--key <key>]
FlagTypeRequiredDescription
--scopestringYesglobal or a session key
--keystringNoMemory key; omit to return all entries in scope

memory save

Save or update a memory entry.

openbee ctl memory save --scope <scope> --key <key> --value <value>
FlagTypeRequiredDescription
--scopestringYesglobal or a session key
--keystringYesMemory key
--valuestringYesMemory value

memory delete

Delete a memory entry.

openbee ctl memory delete --scope <scope> --key <key>
FlagTypeRequiredDescription
--scopestringYesglobal or a session key
--keystringYesMemory key

session

Manage session contexts.

session list

List all workers with active session contexts for a session key.

openbee ctl session list --session-key <key>
FlagTypeRequiredDescription
--session-keystringYesSession key to query

session clear

Cancel all active tasks and clear all session contexts for a session key.

openbee ctl session clear --session-key <key> [--force]
FlagTypeRequiredDescription
--session-keystringYesSession key to clear
--forceboolNoSkip confirmation when multiple workers are linked

session clear-worker

Reset one worker's session context within a session.

openbee ctl session clear-worker --session-key <key> --worker-id <id>
FlagTypeRequiredDescription
--session-keystringYesSession key
--worker-idstringYesWorker UUID whose session context to reset

execution

Query worker execution records.

execution list

List worker execution records with optional filtering and pagination.

openbee ctl execution list [flags]
FlagTypeRequiredDescription
--worker-idstringNoFilter by worker ID
--session-idstringNoFilter by session ID
--statusstringNoFilter by status (pending, running, completed, failed)
--started-fromint64NoFilter started_at >= value (Unix ms)
--started-toint64NoFilter started_at <= value (Unix ms)
--completed-fromint64NoFilter completed_at >= value (Unix ms)
--completed-toint64NoFilter completed_at <= value (Unix ms)
--pageintNoPage number (default: 1)
--page-sizeintNoPage size (default: 50, max: 100)

department

Manage departments. Workers can be organized into departments for filtering and access control.

department list

List all departments as a tree structure.

openbee ctl department list

department get

Get a department by ID or name.

openbee ctl department get <id|name>
ArgumentRequiredDescription
id|nameYesDepartment ID or name

department create

Create a new department.

openbee ctl department create --name <name> [flags]
FlagTypeRequiredDescription
--name, -nstringYesDepartment name
--parentstringNoParent department ID or name
--sort-orderintNoDisplay sort order

department update

Update a department's properties (patch semantics: omitted fields are unchanged).

openbee ctl department update <id|name> [flags]
Argument / FlagTypeRequiredDescription
id|nameYesDepartment ID or name
--namestringNoNew name
--parentstringNoNew parent department ID or name
--sort-orderintNoNew sort order

department delete

Delete a department.

openbee ctl department delete <id|name>
ArgumentRequiredDescription
id|nameYesDepartment ID or name

system

View system status and execution history.

system overview

Show system-wide statistics: worker status distribution, task counts, and recent executions.

openbee ctl system overview

system executions

List bee coordinator execution history.

openbee ctl system executions [--limit <n>]
FlagTypeRequiredDescription
--limitintNoNumber of records to return (default: 10)

message

Send and query platform messages.

message send

Send a message to the user on the originating platform. Supports plain text (via stdin), media files, or both. To send multiple files, call message send once per file.

openbee ctl message send --message-id <id> [--stdin] [--media-path <path>]
FlagTypeRequiredDescription
--message-idstringYesID of the originating platform message
--stdinboolNoRead text content from stdin (use with heredoc)
--media-pathstringNoLocal file path to upload and send as media

At least one of --stdin or --media-path must be provided.

Examples

# Send plain text via heredoc
openbee ctl message send --message-id <id> --stdin << 'EOF'
Task complete.
EOF

# Send a file
openbee ctl message send --message-id <id> --media-path /tmp/report.pdf

# Send text and file together
openbee ctl message send --message-id <id> --stdin --media-path /tmp/report.pdf << 'EOF'
Report attached.
EOF

message list

List received (inbound) platform messages with optional filtering and pagination.

openbee ctl message list [flags]
FlagTypeRequiredDescription
--session-keystringNoFilter by session key
--platformstringNoFilter by platform (e.g. feishu, local)
--statusstringNoFilter by status (received, feeding, bee_processed, merged, failed)
--received-fromint64NoFilter received_at >= value (Unix ms)
--received-toint64NoFilter received_at <= value (Unix ms)
--pageintNoPage number (default: 1)
--page-sizeintNoPage size (default: 50, max: 100)

message list-outbound

List sent (outbound) platform messages with optional filtering and pagination.

openbee ctl message list-outbound [flags]
FlagTypeRequiredDescription
--session-keystringNoFilter by session key
--platformstringNoFilter by platform (e.g. feishu, local)
--statusstringNoFilter by status (sent, failed)
--source-typestringNoFilter by source type (bee, worker, system)
--source-idstringNoFilter by source ID
--sent-fromint64NoFilter sent_at >= value (Unix ms)
--sent-toint64NoFilter sent_at <= value (Unix ms)
--pageintNoPage number (default: 1)
--page-sizeintNoPage size (default: 50, max: 100)

On this page