agent commands reference
Operational reference for command records the web app writes and the agent executes through Firestore.
command lifecycle
Command queues are single Firestore documents whose fields are command IDs. They are not per-command subcollections.
1. Web/API writes one map entry to:
sites/{siteId}/machines/{machineId}/commands/pending
{
"{commandId}": {
"type": "command_type",
"status": "pending",
...command-specific fields
}
}
2. The agent listener reads the pending document and dispatches each unseen
command ID.
3. Long-running commands can write partial records to:
sites/{siteId}/machines/{machineId}/commands/completed
4. The agent writes the final record under the same command ID in the
completed document, then deletes the command ID field from pending.Server helpers that use stampCommand add createdAt, expiresAt, and
optional auditCorrelationId. The public machine-command endpoint also stamps
siteId, machineId, timestamp, status, and queuedBy.
command document schema
pending entry
{
"{commandId}": {
"type": "command_type",
"status": "pending",
"createdAt": "<server timestamp>",
"expiresAt": "<timestamp>",
"timestamp": "<server timestamp>",
"queuedBy": "user:uid-or-apiKey:keyId",
"...": "command-specific fields"
}
}Legacy writers may use millisecond timestamp without createdAt or
expiresAt; the agent accepts both shapes.
progress entry
Long-running commands update the completed document before final completion.
{
"{commandId}": {
"status": "downloading",
"updatedAt": "<server timestamp>",
"deployment_id": "deployment_123",
"progress": 45
}
}Progress writes are partial status records. They are throttled by the agent and
can use command-specific statuses such as downloading, installing,
uninstalling, or extracting before the final completed, failed, or
cancelled record is written.
completed entry
{
"{commandId}": {
"type": "command_type",
"result": "Human-readable result message",
"status": "completed",
"completedAt": "<server timestamp>",
"deployment_id": "deployment_123"
}
}failed entry
Failed commands use error, not result.
{
"{commandId}": {
"type": "command_type",
"error": "Error: description of what went wrong",
"status": "failed",
"completedAt": "<server timestamp>",
"deployment_id": "deployment_123"
}
}cancelled entry
{
"{commandId}": {
"type": "command_type",
"result": "Cancellation message",
"status": "cancelled",
"completedAt": "<server timestamp>",
"deployment_id": "deployment_123"
}
}public API command types
These are the command types accepted by the public machine-command action in
web/lib/actions/executeMachineCommand.server.ts.
process control
| type | fields | behavior |
|---|---|---|
restart_process | process_name or process_id/processId | Kill and relaunch a configured process, or launch it if it is not already running. |
start_process | process_name or process_id/processId | Start a configured process. If it is scheduled and outside its window, the agent records a manual override. |
stop_process | process_name or process_id/processId | Gracefully terminate a running process and mark it STOPPED. |
kill_process | process_name or process_id/processId | Gracefully terminate a running process and mark it KILLED. |
set_launch_mode | process_name or process_id/processId, mode, optional schedules | Set mode to off, always, or scheduled. The agent matches process id first, falls back to name, and derives legacy autolaunch from the launch mode. |
The public route shim still requires process_name for set_launch_mode; direct Firestore command writers and the agent handler accept process_id / processId as the preferred identifier.
machine power and reboot state
| type | fields | behavior |
|---|---|---|
reboot_machine | none used | Schedule a Windows reboot in 30 seconds and set reboot visibility fields on the machine document. |
shutdown_machine | none used | Schedule a Windows shutdown in 30 seconds and set shutdown visibility fields on the machine document. |
cancel_reboot | none | Abort a pending reboot/shutdown with shutdown /a and clear local and Firestore reboot state. |
dismiss_reboot_pending | optional process_name | Clear a reboot-pending prompt and reset relaunch counters for the named process when present. |
screenshots and live view
| type | fields | behavior |
|---|---|---|
capture_screenshot | optional monitor | Capture from the active user session. 0 means all monitors; positive values select a monitor index. |
start_live_view | optional interval, optional duration | Start repeated screenshot capture. interval is clamped to 5-60 seconds; duration is clamped to 60-1800 seconds. |
stop_live_view | none | Stop the live-view screenshot loop and clear the machine liveView flag. |
display topology
| type | fields | behavior |
|---|---|---|
apply_display_topology | layout, optional applyId/apply_id | Validate and apply a display layout, arm the revert watchdog, and require a matching acknowledgement before the deadline. |
enumerate_display_modes | none | Build and upload the supported display-mode catalogue when hardware changed. |
ack_display_topology | optional applyId/apply_id | Acknowledge the in-flight display apply and cancel auto-revert when the ID matches. |
test_display_apply | none | Run a read-only display helper smoke test without applying a topology change. |
cortex and agent update
| type | fields | behavior |
|---|---|---|
mcp_tool_call | tool_name, tool_params, optional chat_id, optional timeout_seconds | Execute an agent-side MCP tool. tool_params is the payload object. |
update_owlette | installer_url, checksum_sha256, optional target_version, optional deployment_id | Download a verified agent installer and run it through Task Scheduler. checksum_sha256 is required. |
mcp_tool_call returns JSON-encoded tool output in the final result field
when the command completes successfully.
legacy dashboard and internal command types
These commands are still registered in agent/src/owlette_service.py but are
not all accepted by the public machine-command allowlist. They exist for
dashboard flows, deployment workers, older configuration flows, or internal
admin actions.
configuration and process compatibility
| type | fields | behavior |
|---|---|---|
update_config | config | Replace local config while preserving the local Firebase auth section. |
toggle_autolaunch | process_name or process_id/processId, autolaunch | Legacy compatibility path. Matches process id first, falls back to name, then sets launch mode to always or off and updates derived autolaunch. |
provision_cortex_key | api_key, optional provider | Encrypt and store a local Cortex provider key in config. Defaults provider to anthropic. |
software deployment
| type | fields | behavior |
|---|---|---|
install_software | installer_url, optional installer_name, optional silent_flags, required sha256_checksum, optional verify_path, optional timeout_seconds, optional deployment_id, optional parallel_install, optional close_processes, optional suppress_projects | Download, checksum-verify, and run an installer in the interactive user session. Default timeout is 2400 seconds. |
cancel_installation | installer_name | Cancel an active installer process tree and mark the command cancelled. |
uninstall_software | software_name, uninstall_command, optional silent_flags, optional installer_type, optional verify_paths, optional timeout_seconds, optional deployment_id | Run an uninstall command, auto-detect silent flags when omitted, and verify registry/file cleanup. Default timeout is 1200 seconds. |
cancel_uninstall | software_name | Cancel an active uninstall tracked as uninstall_<software_name>. |
refresh_software_inventory | none | Force an immediate installed-software inventory sync. |
legacy project distribution
| type | fields | behavior |
|---|---|---|
distribute_project | project_url, optional project_name, optional extract_path, optional distribution_id | Legacy ZIP distribution path. Prefer the roost v2 router commands for current project sync. |
cancel_distribution | project_name | Clean up the temporary ZIP file for an in-progress legacy distribution. |
router-registered roost v2 command types
These commands are registered in agent/src/sync_commands.py through
CommandRouter and dispatch before the legacy if/elif chain.
sync_pull
Pull an immutable roost version, download missing chunks, and assemble files at the target path.
| field | type | description |
|---|---|---|
type | "sync_pull" | |
site_id | string | Site that owns the roost and target machine. |
roost_id | string | roost to sync. |
version_id | string | Immutable version to materialize. |
version_url | string | Version manifest URL. The agent attempts to mint a fresh signed URL before fetching. |
extract_root | string | Destination directory for assembled files. |
The handler reports target states pending, downloading, assembling,
committed, failed, and cancelled.
cancel_sync
Cancel an in-flight sync_pull for the same site, roost, and version.
| field | type | description |
|---|---|---|
type | "cancel_sync" | |
site_id | string | Site that owns the sync. |
roost_id | string | roost being synced. |
version_id | string | Version being synced. |
Cancellation is cooperative. The active download or file operation finishes its
current step, then the handler records cancelled.
rollback_to_version
Materialize an older roost version after the server-side rollback has already
changed the current-version pointer. The payload matches sync_pull.
| field | type | description |
|---|---|---|
type | "rollback_to_version" | |
site_id | string | Site that owns the roost and target machine. |
roost_id | string | roost to sync. |
version_id | string | Older immutable version to materialize. |
version_url | string | Version manifest URL. |
extract_root | string | Destination directory for assembled files. |
coverage checklist
Dispatcher entries covered from agent/src/owlette_service.py:
restart_process, start_process, kill_process, stop_process,
toggle_autolaunch, set_launch_mode, update_config, install_software,
update_owlette, cancel_installation, uninstall_software,
cancel_uninstall, refresh_software_inventory, distribute_project,
cancel_distribution, mcp_tool_call, capture_screenshot,
reboot_machine, shutdown_machine, cancel_reboot,
dismiss_reboot_pending, provision_cortex_key, start_live_view,
stop_live_view, apply_display_topology, enumerate_display_modes,
ack_display_topology, and test_display_apply.
Router entries covered from agent/src/sync_commands.py:
sync_pull, cancel_sync, and rollback_to_version.
platform authentication internals
This reference covers Owlette platform authentication internals: Firebase-backed user sessions, agent device-code pairing, passkey authentication (WebAuthn), optional MFA (TOTP), and role-based access control. For HTTP API integrations, use API authentication, which documents scoped owk_* API keys, bearer headers, scopes, and public API error behavior.
cortex tools reference
Complete reference for all 46 public web Cortex tools from web/lib/mcp-tools.ts, organized by tier.