The Google Health API Got a CLI: ghealth is an Open-Source Tool for Your Fitbit Air Data
The Google Health API is the official successor to the Fitbit Web API.

The Google Health API is the official successor to the Fitbit Web API. It targets the Google Health API v4 and moves developers onto Google OAuth 2.0. Now an open-source CLI command-line tool called ghealth wraps that API for terminals and AI agents.
The tool is a single Go binary under the Apache 2.0 license. It exposes 40 verified data types as structured JSON. That design lets you pipe sleep, heart rate, and step data into an agent’s context.
ghealth is a wrapper over the Google Health API v4. You build it from source with go build -o ghealth . . It ships as one self-contained binary.
The tool is explicitly agent-first. Every command returns simplified JSON with a stable shape. It also provides deterministic exit codes, a --dry-run flag, and a --raw flag.
The repository ships two Agent Skills as SKILL.md files. One covers auth, setup, and global flags. The other documents all 40 data types, operations, patterns, and gotchas. Agents install them with npx skills add .
The CLI lives under the Google-Health-API GitHub organization. That organization also hosts long-standing Fitbit open-source repositories.
The 40 types cover most Fitbit and Pixel Watch signals. Examples include steps , heart-rate , sleep , weight , oxygen-saturation , and heart-rate-variability . Clinical types like electrocardiogram require the ecg.readonly scope.
Each type supports a subset of operations. Common ones are list , rollup , daily-rollup , and reconcile . Writable types ( exercise , sleep , weight , body-fat , height ) add create , update , and delete .
The reconcile operation merges overlapping data points from multiple sources. That mirrors the Reconciled Stream in the v4 API.
Sleep is a good example for pattern analysis. The default list returns a summary. Adding --detail returns stage-by-stage data (awake, deep, REM). That helps you spot patterns week over week.
Setup runs through one command: ghealth setup . A wizard walks you through the GCP project and OAuth. You create a Desktop-type OAuth client in the Google Cloud Console.
You bring your own OAuth credentials. The tool holds no shared key. Files are written under ~/.config/ghealth/ with file mode 0600. Tokens refresh automatically.
All Google Health API scopes are classified as Restricted. Google requires a privacy and security review for production access. For personal use, you authorize your own project against your own account. The API returns data from Fitbit, Pixel Watch, and connected third-party sources.
Source: MarkTechPost