cortex node

Manage nodes in the Cortex hub — a distributed agent execution layer where remote nodes connect to a central hub via WebSocket. Nodes register with capability tiers and execute directives from the hub.

Usage

cortex node <subcommand> [options]

Subcommands

SubcommandDescription
registerRegister a new node with the hub
listList all registered nodes
showShow details for a specific node
deregisterRemove a node from the hub
rekeyRotate a node's authentication token
connectConnect as a node to a hub

Node Status

StatusDescription
connectingEstablishing WebSocket connection
connectedActive with heartbeat
disconnectedConnection lost
errorConnection in error state
deregisteredNode removed from hub

Capability Tiers

TierAccess Level
rootFull unrestricted — all tools, all paths (/), all sudo commands, all domains
sudoElevated scoped — excludes /etc, /root, /proc, /sys; allows apt/npm/pip
unprivilegedSandboxed — read-only tools, no shell, restricted to /tmp/cortex-sandbox

Connect Options

OptionDescription
--idNode identifier
--tokenAuthentication token
--endpointHub WebSocket endpoint URL
--tierCapability tier (root, sudo, unprivileged)
--groupNode group for routing
--nameHuman-readable node name
--reconnect-msReconnect interval in milliseconds
--heartbeat-msHeartbeat interval in milliseconds
--timeout-msConnection timeout in milliseconds

Protocol

Nodes communicate with the hub via a message protocol:

  • register — Node announces itself to hub
  • heartbeat — Periodic health check with live metrics
  • directive — Hub sends execution directive
  • result — Node returns execution result
  • stream_chunk — Streaming result chunks
  • cancel — Hub cancels in-flight directive

Examples

# Register a new node
cortex node register

# List all nodes
cortex node list

# Show node details
cortex node show node-001

# Connect as a node to a hub
cortex node connect --token <token> --endpoint https://hub.example.com --tier sudo

# Rotate node token
cortex node rekey node-001

# Remove a node
cortex node deregister node-001