Reference (CLI, API, SDKs, config)

CLI, daemon HTTP API, OpenAPI, SDKs, config keys, metrics, and agent protocol.

Command flags, REST routes, config fields, and SDK method lists. Prefer Guides for workflows; use this section when you need exact names and shapes.

  • Agent protocol — HTTP endpoints exposed by grain-agent inside each guest.
  • CLI reference (all grain commands) — Complete grain command reference for interactive use.
  • Configuration reference — All knobs in ~/.grain/config.yaml for daemon and CLI defaults.
  • Go SDK — Public Go client for the grain daemon — DialUnix, create, exec, lifecycle, and more.
  • HTTP API reference (REST daemon) — Daemon REST API over unix socket or TCP for automation and the Go/TypeScript SDKs.
  • Metrics — Daemon Prometheus scrape endpoint and per-sandbox guest stats history on the host.
  • OpenAPI explorer (Swagger UI) — Browse the grain daemon HTTP API — operations, curl/Python/Node samples, and JSON examples.
  • Python SDK — Stdlib Python client for the grain daemon — TCP or Unix socket, create, exec, lifecycle, and more.
  • TypeScript SDK — Node-friendly fetch client for the grain daemon (@cxdy/grain under sdk/ts).