Skip to content

Agent Commands

The agent command group handles bot orchestration. Agents are autonomous workers that claim tasks from the board, report progress, and coordinate with each other. The coordinator loop manages task distribution and rebalancing across active agents.

Overview

Agents follow a lifecycle:

  1. Register presence via agent heartbeat
  2. Claim available tasks via agent claim
  3. Report progress via agent report
  4. Complete or release tasks via agent complete / agent release

The coordinator (agent coordinate) automates this loop, distributing tasks based on agent skills and availability.

Commands

agent heartbeat

Send a heartbeat signal to indicate an agent is alive and active.

bash
# Send heartbeat with current status
optimal agent heartbeat --agent content-bot --status active

# Signal that an agent is idle
optimal agent heartbeat --agent finance-bot --status idle
FlagDescription
--agentAgent name (required)
--statusAgent status (e.g. active, idle, busy)

TIP

Agents should send heartbeats at regular intervals. If no heartbeat is received within the timeout window, the coordinator considers the agent offline and may reassign its tasks.


agent list

List all agents and their current status.

bash
optimal agent list

Outputs each registered agent with its name, status, last heartbeat time, and currently assigned tasks.


agent claim

Claim the next available task matching the agent's skill.

bash
# Claim any available task
optimal agent claim --agent content-bot

# Claim a task matching a specific skill
optimal agent claim --agent finance-bot --skill financial-analysis
FlagDescription
--agentAgent name (required)
--skillSkill tag to match against task requirements

agent report

Report progress on a claimed task.

bash
optimal agent report --task 42 --agent content-bot --message "Generated 3 of 5 social posts"
FlagDescription
--taskTask ID (required)
--agentAgent name (required)
--messageProgress message (required)

agent complete

Mark a task as completed.

bash
optimal agent complete --task 42 --agent content-bot --summary "Published 5 social posts for CRE-11TRUST"
FlagDescription
--taskTask ID (required)
--agentAgent name (required)
--summaryCompletion summary

agent release

Release a claimed task back to the pool. Use this when an agent cannot finish a task.

bash
optimal agent release --task 42 --agent content-bot --reason "Missing API credentials"
FlagDescription
--taskTask ID (required)
--agentAgent name (required)
--reasonReason for releasing the task

agent blocked

Mark a task as blocked. The task stays assigned but is flagged for attention.

bash
optimal agent blocked --task 42 --agent finance-bot --reason "Waiting on income statement upload"
FlagDescription
--taskTask ID (required)
--agentAgent name (required)
--reasonDescription of the blocker

WARNING

Blocked tasks are not automatically reassigned. Use agent rebalance or manually unblock via board update to resume work.


agent coordinate

Run the coordinator loop. This is a long-running process that monitors the task board and distributes work to available agents.

bash
optimal agent coordinate
optimal agent coordinate --interval 60000 --max-agents 5
FlagDescription
--intervalPoll interval in milliseconds (default: 30000)
--max-agentsMaximum agents to manage (default: 10)

The coordinator:

  • Monitors agent heartbeats
  • Assigns unassigned tasks to idle agents based on skill matching
  • Detects stalled or offline agents and reassigns their tasks
  • Logs all coordination actions to the activity log

agent status

Get the current coordinator status, including active agents, task distribution, and any issues.

bash
optimal agent status

agent assign

Manually assign a specific task to an agent, bypassing the coordinator's automatic matching.

bash
optimal agent assign --task 42 --agent finance-bot
FlagDescription
--taskTask ID (required)
--agentTarget agent name (required)

agent rebalance

Redistribute tasks across all active agents. Useful after an agent goes offline or when workloads become uneven.

bash
optimal agent rebalance

This command evaluates current assignments and redistributes tasks to achieve a balanced workload across all agents reporting an active heartbeat.

Built by Carlos Lenis in Miami