Skip to content

cropscode worker

Terminal window
cropscode worker

The worker command handles tenant selection (if needed) and starts the worker daemon.

On first run, it walks you through setup:

  1. Checks that you’re logged in (prompts to run cropscode login if not)
  2. Fetches your available tenants from the orchestrator
  3. If you have multiple tenants, lets you pick one
  4. Saves the configuration to ~/.cropscode/worker.json
  5. Starts the worker daemon

On subsequent runs, it reads the saved config and starts the worker immediately.

  1. Reads worker config from ~/.cropscode/worker.json
  2. Connects outbound to the orchestrator via WebSocket
  3. Reports system info (hostname, CPU, RAM)
  4. Begins sending heartbeats every 10 seconds
  5. Listens for container commands (create, stop, terminal)

The worker connects outbound — no inbound ports, no firewall rules, works behind NAT. If the connection drops, it reconnects with exponential backoff (1s → 2s → 4s → … up to 30s).

Running cropscode worker for the first time stores:

  • Worker ID (randomly generated UUID)
  • Tenant ID and name
  • Orchestrator WebSocket URL

These are saved in ~/.cropscode/worker.json.

Getting Started Concepts Guides CLI Self-Hosting Reference Links