owlette docs
reference

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

typefieldsbehavior
restart_processprocess_name or process_id/processIdKill and relaunch a configured process, or launch it if it is not already running.
start_processprocess_name or process_id/processIdStart a configured process. If it is scheduled and outside its window, the agent records a manual override.
stop_processprocess_name or process_id/processIdGracefully terminate a running process and mark it STOPPED.
kill_processprocess_name or process_id/processIdGracefully terminate a running process and mark it KILLED.
set_launch_modeprocess_name or process_id/processId, mode, optional schedulesSet 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

typefieldsbehavior
reboot_machinenone usedSchedule a Windows reboot in 30 seconds and set reboot visibility fields on the machine document.
shutdown_machinenone usedSchedule a Windows shutdown in 30 seconds and set shutdown visibility fields on the machine document.
cancel_rebootnoneAbort a pending reboot/shutdown with shutdown /a and clear local and Firestore reboot state.
dismiss_reboot_pendingoptional process_nameClear a reboot-pending prompt and reset relaunch counters for the named process when present.

screenshots and live view

typefieldsbehavior
capture_screenshotoptional monitorCapture from the active user session. 0 means all monitors; positive values select a monitor index.
start_live_viewoptional interval, optional durationStart repeated screenshot capture. interval is clamped to 5-60 seconds; duration is clamped to 60-1800 seconds.
stop_live_viewnoneStop the live-view screenshot loop and clear the machine liveView flag.

display topology

typefieldsbehavior
apply_display_topologylayout, optional applyId/apply_idValidate and apply a display layout, arm the revert watchdog, and require a matching acknowledgement before the deadline.
enumerate_display_modesnoneBuild and upload the supported display-mode catalogue when hardware changed.
ack_display_topologyoptional applyId/apply_idAcknowledge the in-flight display apply and cancel auto-revert when the ID matches.
test_display_applynoneRun a read-only display helper smoke test without applying a topology change.

cortex and agent update

typefieldsbehavior
mcp_tool_calltool_name, tool_params, optional chat_id, optional timeout_secondsExecute an agent-side MCP tool. tool_params is the payload object.
update_owletteinstaller_url, checksum_sha256, optional target_version, optional deployment_idDownload 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

typefieldsbehavior
update_configconfigReplace local config while preserving the local Firebase auth section.
toggle_autolaunchprocess_name or process_id/processId, autolaunchLegacy compatibility path. Matches process id first, falls back to name, then sets launch mode to always or off and updates derived autolaunch.
provision_cortex_keyapi_key, optional providerEncrypt and store a local Cortex provider key in config. Defaults provider to anthropic.

software deployment

typefieldsbehavior
install_softwareinstaller_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_projectsDownload, checksum-verify, and run an installer in the interactive user session. Default timeout is 2400 seconds.
cancel_installationinstaller_nameCancel an active installer process tree and mark the command cancelled.
uninstall_softwaresoftware_name, uninstall_command, optional silent_flags, optional installer_type, optional verify_paths, optional timeout_seconds, optional deployment_idRun an uninstall command, auto-detect silent flags when omitted, and verify registry/file cleanup. Default timeout is 1200 seconds.
cancel_uninstallsoftware_nameCancel an active uninstall tracked as uninstall_<software_name>.
refresh_software_inventorynoneForce an immediate installed-software inventory sync.

legacy project distribution

typefieldsbehavior
distribute_projectproject_url, optional project_name, optional extract_path, optional distribution_idLegacy ZIP distribution path. Prefer the roost v2 router commands for current project sync.
cancel_distributionproject_nameClean 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.

fieldtypedescription
type"sync_pull"
site_idstringSite that owns the roost and target machine.
roost_idstringroost to sync.
version_idstringImmutable version to materialize.
version_urlstringVersion manifest URL. The agent attempts to mint a fresh signed URL before fetching.
extract_rootstringDestination 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.

fieldtypedescription
type"cancel_sync"
site_idstringSite that owns the sync.
roost_idstringroost being synced.
version_idstringVersion 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.

fieldtypedescription
type"rollback_to_version"
site_idstringSite that owns the roost and target machine.
roost_idstringroost to sync.
version_idstringOlder immutable version to materialize.
version_urlstringVersion manifest URL.
extract_rootstringDestination 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.

on this page