{
  "topic": "cli.health",
  "path": [
    "cli",
    "health"
  ],
  "title": "cyoda health — liveness probe",
  "synopsis": "`cyoda health` sends an HTTP GET to `http://127.0.0.1:<port>/readyz` and exits 0 if the server responds with HTTP 200. Any non-200 response or connection error causes exit 1.",
  "body": "# cli.health\n\n## NAME\n\ncli.health — probe the admin listener's `/readyz` endpoint.\n\n## SYNOPSIS\n\n`cyoda health`\n\n## DESCRIPTION\n\n`cyoda health` sends an HTTP GET to `http://127.0.0.1:<port>/readyz` and exits 0 if the server responds with HTTP 200. Any non-200 response or connection error causes exit 1.\n\nThe probe uses a hard-coded 2-second HTTP client timeout. This timeout is load-bearing: a deadlocked readiness handler looks identical to \"server accepts the connection then hangs\" from the client's perspective. Without a timeout, Docker's `HEALTHCHECK` would inherit the deadlock and never mark the container unhealthy.\n\nThe port is read from `CYODA_ADMIN_PORT` (default: `9091`). The admin listener always binds to `127.0.0.1` from the probe's perspective — `cyoda health` is designed to run inside the same container or on the same host as the server.\n\nPrimary consumers:\n\n- **Docker Compose** — `HEALTHCHECK` stanza in the service definition.\n- **Helm chart** — `readinessProbe` invokes `cyoda health` before the pod is marked ready.\n\n## OPTIONS\n\n`cyoda health` accepts no flags.\n\n## ENVIRONMENT VARIABLES\n\n- `CYODA_ADMIN_PORT` — Admin listener port to probe (default: `9091`).\n\n## EXIT CODES\n\n- `0` — Server responded HTTP 200. Instance is ready.\n- `1` — Connection failed, timed out, or server returned a non-200 status.\n\n## EXAMPLES\n\n```\n# Basic probe (uses CYODA_ADMIN_PORT or default 9091)\ncyoda health\n\n# Probe a server on a non-default admin port\nCYODA_ADMIN_PORT=19091 cyoda health\n\n# Use in a shell script\nif cyoda health; then\n  echo \"server is ready\"\nelse\n  echo \"server not ready\" >&2\n  exit 1\nfi\n```\n\n## SEE ALSO\n\n- telemetry\n",
  "sections": [
    {
      "name": "NAME",
      "body": "cli.health — probe the admin listener's `/readyz` endpoint."
    },
    {
      "name": "SYNOPSIS",
      "body": "`cyoda health`"
    },
    {
      "name": "DESCRIPTION",
      "body": "`cyoda health` sends an HTTP GET to `http://127.0.0.1:<port>/readyz` and exits 0 if the server responds with HTTP 200. Any non-200 response or connection error causes exit 1.\n\nThe probe uses a hard-coded 2-second HTTP client timeout. This timeout is load-bearing: a deadlocked readiness handler looks identical to \"server accepts the connection then hangs\" from the client's perspective. Without a timeout, Docker's `HEALTHCHECK` would inherit the deadlock and never mark the container unhealthy.\n\nThe port is read from `CYODA_ADMIN_PORT` (default: `9091`). The admin listener always binds to `127.0.0.1` from the probe's perspective — `cyoda health` is designed to run inside the same container or on the same host as the server.\n\nPrimary consumers:\n\n- **Docker Compose** — `HEALTHCHECK` stanza in the service definition.\n- **Helm chart** — `readinessProbe` invokes `cyoda health` before the pod is marked ready."
    },
    {
      "name": "OPTIONS",
      "body": "`cyoda health` accepts no flags."
    },
    {
      "name": "ENVIRONMENT VARIABLES",
      "body": "- `CYODA_ADMIN_PORT` — Admin listener port to probe (default: `9091`)."
    },
    {
      "name": "EXIT CODES",
      "body": "- `0` — Server responded HTTP 200. Instance is ready.\n- `1` — Connection failed, timed out, or server returned a non-200 status."
    },
    {
      "name": "EXAMPLES",
      "body": "```\n# Basic probe (uses CYODA_ADMIN_PORT or default 9091)\ncyoda health\n\n# Probe a server on a non-default admin port\nCYODA_ADMIN_PORT=19091 cyoda health\n\n# Use in a shell script\nif cyoda health; then\n  echo \"server is ready\"\nelse\n  echo \"server not ready\" >&2\n  exit 1\nfi\n```"
    },
    {
      "name": "SEE ALSO",
      "body": "- telemetry"
    }
  ],
  "see_also": [
    "telemetry"
  ],
  "stability": "stable",
  "actions": []
}
