Google Health CLI for Openclaw

A lightweight, read-only Go CLI tool designed to fetch and format Google Health v4 data as clean JSON for developers and AI agents.

stozo04
v1.0.0
Jun 21, 2026
0
32
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install google-health-cli-dev

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install google-health-cli-dev using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Google Health CLI?

Google Health CLI is a performant, dependency-free binary written in Go that acts as a secure, read-only client for the Google Health v4 API. Built to support modern developers and automated setups, it streamlines the authentication process using local OAuth2 token caching, allowing automated scripts to query metrics headlessly after a one-time setup. It bypasses complex runtimes like Python, letting users extract raw healthcare and exercise data straight to stdout as clean, parsed JSON.

Rather than locking users into a specific framework, the tool operates on data minimization principles, meaning it performs no internal processing or external data transmissions. Outputting directly to stdout makes it incredibly easy to connect raw health telemetry to modern pipelines, rendering it an ideal pipeline block for orchestrating customized analytics using Openclaw Skills.

Google Health CLI Use Cases

  • Pulling granular physical metrics such as sleep cycles, heart rate logs, oxygen saturation levels, and step counts for personalized dashboard integration.
  • Piping raw wellness and recovery data directly into LLM analytical tools using Openclaw Skills to auto-generate personalized fitness summaries.
  • Extracting reconciled daily summaries instead of vast raw logs to quickly synchronize historical workout data with external databases.
  • Creating headless cron jobs to automate personal fitness archives safely on private local infrastructure.

How Google Health CLI Works

  1. Configuration: The tool identifies credentials (client ID and secret) stored in system environment variables or a local, gitignored config.json file.
  2. Authentication: Running auth login initiates a single interactive browser window for OAuth2 authorization, caching the access token locally with secure filesystem permissions.
  3. Query Compilation: The client translates native CLI command parameters (like --days or --from/--to windows) into compatible URL queries for the Google Health API.
  4. Secure Extraction: It connects over HTTPS directly to the read-only Google Health endpoints to retrieve authorized health metrics.
  5. Clean Output: Resulting payloads stream directly to stdout as parseable JSON arrays, while system diagnostics and human-readable metadata are directed exclusively to stderr.

Google Health CLI Setup

Get up and running with Google Health CLI integrations in your ecosystem by executing these initial configurations:

  1. Build or Download the Binary: Download a pre-compiled build for your specific architecture or install directly using Go:
go install github.com/stozo04/google-health-cli/cmd/google-health-cli@latest
  1. Generate Desktop Credentials: Configure a free Desktop Application client within your Google Cloud Console, requesting read-only scopes for Google Health. Detailed walkthroughs are available in the repository's OAUTH_SETUP.md document.

  2. Export Credentials: Expose your OAuth identifiers using standard shell environment variables:

export GOOGLE_HEALTH_CLIENT_ID="your_desktop_client_id"
export GOOGLE_HEALTH_CLIENT_SECRET="your_desktop_client_secret"

Alternatively, specify these values within a gitignored config.json situated in your active working directory:

{
  "client_id": "your_desktop_client_id",
  "client_secret": "your_desktop_client_secret"
}
  1. Authenticate Headlessly: Authorize access via your web browser to generate your initial cache token:
google-health-cli auth login

Verify that the configuration is valid and ready to run headlessly:

google-health-cli doctor

Google Health CLI Data Schema & Taxonomy

The command-line client outputs structured data directly to stdout. Below is an overview of the output schema and structures handled by the tool:

Core Operations Matrix

Command Pattern Payload Type Description
data list <type> Raw JSON Array Direct, unfiltered telemetry representing physical data points (e.g., heart-rate, weight, steps).
rollup daily <type> Reconciled Daily Rows Server-side calendar day consolidations that cleanly reconcile multiple tracking devices.
sessions Flattened Activity Rows Parsed physical logs reflecting standardized metrics (duration, average heart rate, calories).
api get <path> Raw Endpoint JSON Freeform GET-only access constrained exclusively to Google Health /v4/ scopes.

Sample Data Schemas

Daily Resting Heart Rate Schema:

[
  {
    "dataSource": {
      "platform": "FITBIT",
      "device": {
        "displayName": "Google Pixel Watch 4 (45mm)"
      }
    },
    "dailyRestingHeartRate": {
      "date": {
        "year": 2026,
        "month": 6,
        "day": 17
      },
      "beatsPerMinute": "78"
    }
  }
]

Exercise Session Schema:

[
  {
    "date": "2026-06-16",
    "exercise_type": "ELLIPTICAL",
    "duration_min": 35,
    "avg_hr": 130,
    "calories": 236,
    "platform": "FITBIT"
  }
]

Google Health CLI Advanced Features

  • Headless Auto-Refresh: Seamlessly handles expired authorization tokens behind the scenes, ensuring long-running server jobs execute without manual re-authorization.
  • Data Source De-duplication: Uses the Google Health API's server-side rollups to merge overlaps from multiple tracking platforms into a clean, single-point daily metric.
  • Unmodeled Discovery: Use raw api get requests to access unmapped endpoints while maintaining strict read-only compliance policies.
  • Automation Diagnostics: Features dedicated exit statuses (e.g., status 64 for expired credentials, 78 for config missing) to write robust, error-tolerant bash scripts.
  • Interactive Shell Completion: Generate instant completion configurations for shells like bash, zsh, fish, and powershell to construct scripts instantly using Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*