ghealth CLI
A CLI for the Google Health API: steps, heart rate, sleep, weight, ECG and 40 data types in total read as JSON, shipped with two skills
- 274 ★ on the repository
- Last commit
- Apache-2.0
Broad access
Why this level
- Access tokens to your health data are stored in plaintext on disk in ~/.config/ghealth
- Reads sensitive data: heart rate, ECG, glucose, sleep and nutrition
- Can create and delete exercise, sleep, weight, height and body fat records
Install
- Works in
Manual install
git clone https://github.com/Google-Health-API/google-health-cli.git && cd google-health-cli && go build -o ghealth .Go is required. The README lists no prebuilt binaries or package manager.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Access tokens to your health data are stored in plaintext on disk in ~/.config/ghealth
- Reads sensitive data: heart rate, ECG, glucose, sleep and nutrition
- Can create and delete exercise, sleep, weight, height and body fat records
This is third-party code. Review the repository files before installing.
What it does
ghealth is a Go command-line program for the Google Health API v4. It reads 40 verified data types: steps, heart rate, exercise, sleep, weight, oxygen saturation, heart rate variability, ECG, blood glucose, nutrition and more. Responses come as simplified JSON with deterministic exit codes, and there are `--dry-run`, `--raw`, `--format table` and `--format csv` flags. Most types support `list`, `get`, `rollup`, `daily-rollup` and `reconcile`. For example, `ghealth data steps daily-rollup --from 2026-03-22 --to 2026-03-29` returns step totals per day. Exercise, sleep, weight, body fat and height can be created, updated and deleted. An exercise track exports with `export-tcx` to TCX or CSV. First setup runs through `ghealth setup`: a GCP project, an OAuth client and a browser sign-in, with a browserless mode for agents and CI. The repository ships two skills: a shared one covering setup and flags, and one describing all 40 data types with examples and gotchas. A day missing from a rollup means the device was not worn. A zero step count shows up as a record with value 0.
Who it is for. For developers and analysts who connect Google wearable data to their workflows and for agents that need reliable access to that data.
Good fit when
- You need a weekly summary of steps, heart rate or sleep for a personal report or analysis
- An exercise record needs exporting with its route to CSV for pandas
- Weight, body fat or height should be entered or corrected from a script
- An agent should answer health questions only from data it was granted access to
- You need ECG data or irregular rhythm notifications: dedicated scopes exist for them
Not a fit when
- You need Apple Health or Garmin data: ghealth works with the Google Health API only
- You want a medical conclusion: the program returns numbers and interprets nothing
- You need a gapless daily series: days without a sync are absent from the output and not filled with zeros
- You cannot create a Google Cloud project and an OAuth client: sign-in is impossible without them
Example request
Show daily step totals for last week with ghealth and mark the days with no dataLimitations
A Google Cloud project with the Google Health API enabled and an OAuth client of the desktop application type are required. Tokens sit in plaintext in `~/.config/ghealth/credentials.json` with mode 0600, and `GHEALTH_CONFIG_DIR` changes the path. Installation is currently a source build: Go and `go build -o ghealth .` are needed. ECG and irregular-rhythm scopes are granted separately. For steps and distance, `list` returns intervals without values and `daily-rollup` gives totals. Writes are asynchronous: the API returns an operation, and you verify the result by reading.
How to disable. Delete the `ghealth` binary, the `~/.config/ghealth/` folder with tokens and the skills from the agent's skills folder. App access can be revoked in the Google account settings.
FAQ
How do I install ghealth and connect the skills?
Clone the repository and run `go build -o ghealth .`. Skills install with `npx skills add https://github.com/Google-Health-API/google-health-cli`, or individually through the links to the `skills/ghealth` and `skills/ghealth-shared` folders.
How do I sign in without a browser, on a server or in CI?
Run `ghealth auth login --non-interactive`: the command prints a sign-in URL and a completion command. Open the URL on any device, then run `ghealth auth login --complete` with the code you get.
Why does list not show the step count?
For steps and distance, `list` returns time intervals without values. `ghealth data steps daily-rollup` gives daily totals.
What does a missing day in daily-rollup mean?
For steps, distance, floors, altitude and calories, a missing date means the device was not worn or did not sync. A record with zero is a true zero. Do not average a missing day as zero.
What can be written through ghealth?
Exercise, sleep, weight, body fat and height: they support `create`, `update` and `delete`. The other data types are read-only.
Discussion
No questions or reviews yet.
Related
CLI toolsA Google DeepMind skill collection for science tasks: access to biology and chemistry databases, literature search and structural biology
MCP server for Apple Health data: an agent answers questions about sleep, workouts and heart rate with SQL
Official ScrapeAtlas terminal client: an agent or script pulls public data from 49 platforms with one command and gets plain JSON
MCP server for Google Sheets and Google Drive: an agent reads, edits and creates spreadsheets, tabs and charts
Google's open-source MCP server for databases: ready tools for Postgres, MySQL, BigQuery, Spanner and more, plus custom tools in tools.yaml
A Claude Code plugin and MCP server: over 1000 scientific tools for biology, chemistry and medicine, data-check commands and routing skills
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| ghealth (this entry) | no | 274 | ||
| Apple Health MCP Server | no | not required | 575 | an MCP server for Apple Health data using SQL queries |
| Garmin MCP | no | API key | 1,426 | Garmin Connect data through an unofficial integration |
README in short
The README briefly introduces the CLI and gives a three-command quick start. It continues with setup, sign-in methods for interactive, headless and cloud scenarios, a table of 40 data types with operations, read and write examples, output format and a section on agent skills.