What Is Google-Health-CLI?
Google-Health-CLI is an API client CLI built by Rudrankriyam in Go for the Google Health API, and it gives developers a terminal-native way to query health data, manage OAuth, inspect profile settings, and automate webhook subscriber workflows. Google-Health-CLI is one of the best CLI Tools tools for developers integrating Google Health data, and the repository documents coverage for 31 data types and 18 REST methods as of Feb 2026. The point is simple: it exposes a stable command surface for scripts and agents instead of forcing every integration through ad hoc HTTP calls.
Quick Overview
| Attribute | Details |
|---|---|
| Type | CLI Tools |
| Best For | developers integrating Google Health data |
| Language/Stack | Go, Google Health API v4, OAuth2, JSON/NDJSON/CSV output |
| License | N/A |
| GitHub Stars | N/A as of Feb 2026 |
| Pricing | Open-Source |
| Last Release | N/A |
Who Should Use Google-Health-CLI?
- Backend engineers building Google Health integrations who want a typed command surface instead of hand-rolling REST wrappers.
- Data platform teams that need repeatable exports, rollups, and reconciliation jobs for sleep, steps, heart rate, and profile data.
- AI agent builders who need stable machine-readable context from
ghealth agent manifest,ghealth agent capabilities, and schema introspection. - Healthcare-facing indie hackers validating product ideas against real API responses before wiring a full service layer.
Not ideal for:
- Non-technical operators who want a GUI-first workflow and do not want to manage OAuth, scopes, and environment variables.
- Teams outside the Google Health API surface because Google-Health-CLI is tightly scoped to Google Health v4 and will not replace generic API clients.
- Users who only need one-off manual inspection and prefer a browser-based tool like Postman over a shell utility.
Key Features of Google-Health-CLI
- OAuth setup with scoped access —
ghealth auth loginhandles the authentication flow, and the CLI defaults to read-only scopes until you explicitly add--write. That matters when a service account or personal token should not be over-privileged on day one. - Predictable output formats — Google-Health-CLI emits table, markdown, JSON, NDJSON, and CSV depending on the terminal and flags. When stdout is piped, it switches to JSON-friendly output, which makes it easier to chain into
jq,xsv, or a CI job. - Typed data access commands — the CLI exposes
data list,data reconcile, androllup dailyflows with explicit--fromand--towindows. That reduces ambiguity around time ranges and keeps the command line close to the underlying API model. - Profile, settings, and identity endpoints —
ghealth profile get,ghealth settings get, andghealth identity getmap directly to user-level reads. That is useful when you need to confirm the current account context before running a data migration or sync. - Webhook subscriber management — the
subscriberscommands cover list, create, patch, and delete operations with explicit resource names. This is the right shape for CI automation because destructive calls require--yesand do not depend on an interactive prompt. - Agent-oriented commands —
ghealth agent manifest,ghealth agent capabilities,ghealth agent schema --type sleep, andghealth agent context todayare designed for downstream tools that need stable machine-readable context. If your workflow feeds an orchestrator like OpenSwarm, these commands reduce parsing glue. - Raw API escape hatch —
ghealth api GET /v4/users/me/profile --jsongives you a direct path for endpoint coverage gaps or debugging. When you need to compare the CLI response with the underlying transport, pair it with OpenTrace to inspect request behavior at the HTTP layer.
Google-Health-CLI vs Alternatives
| Tool | Best For | Key Differentiator | Pricing |
|---|---|---|---|
| Google-Health-CLI | Scriptable Google Health automation | Typed subcommands, OAuth helpers, agent output, and stable exit codes | Open-Source |
| cURL | Raw HTTP debugging | Lowest-level control with no opinionated command model | Free |
| Postman | Manual API exploration | GUI collections, visual auth setup, and request history | Freemium |
| Google Cloud SDK | Broader Google platform work | Cloud admin tooling beyond the Google Health API surface | Free |
Pick cURL when you want exact control over headers, query strings, and raw request bodies. It is the better choice for protocol debugging, but it leaves all endpoint semantics and output shaping on you.
Pick Postman when a GUI is more useful than a terminal and you need to share collections with non-shell users. Google-Health-CLI wins when the output must be piped into scripts, cron jobs, or agent pipelines.
Pick the Google Cloud SDK when your work is mainly about broader Google infrastructure, identity, or project management. It is not a substitute for Google-Health-CLI when the task is specifically Google Health API v4 data access.
If OAuth and machine identity are the main friction points in your stack, consider pairing Google-Health-CLI with MachineAuth. If you need to trace requests while validating data transforms, OpenTrace is the better companion than another generic API client.
How Google-Health-CLI Works
Google-Health-CLI is structured as a Go binary with a subcommand tree that mirrors the Google Health API surface. The design choice is straightforward: map endpoint families to commands, keep authentication local, and make output predictable enough for shell pipelines and agents.
The authentication path uses OAuth setup with explicit client ID and secret configuration, either through ghealth config set or environment variables. Read-only scopes are the default, and --write expands permissions only when you need to create, update, or delete data.
ghealth config set client-id YOUR_CLIENT_ID
ghealth config set client-secret YOUR_CLIENT_SECRET
ghealth auth login
ghealth data list heart-rate --from 2026-05-08T00:00:00Z --to 2026-05-09T00:00:00Z --json
That flow configures credentials, starts the OAuth login, and then requests a deterministic JSON payload for the chosen data type. The important detail is that the command line stays stable even when you switch from interactive exploration to automation, and the --json flag prevents terminal formatting from polluting machine input.
The command model also reflects how the API is consumed in practice. types, endpoints, data, rollup, profile, settings, identity, and subscribers separate concerns so a script can call only the smallest surface it needs, while ghealth api remains available for direct REST access when you need to bypass the typed wrappers.
Pros and Cons of Google-Health-CLI
Pros:
- Strong scriptability — JSON, NDJSON, CSV, and stable exit codes make Google-Health-CLI usable in CI, cron, and agent pipelines without custom parsers.
- Good auth ergonomics — local OAuth setup plus environment-variable support keeps secrets out of command history if you configure them correctly.
- Typed command coverage — the command set maps cleanly to Google Health concepts like data types, rollups, and webhook subscribers.
- Safe defaults — read-only scopes by default and
--yesfor destructive actions reduce accidental writes. - Useful agent surface — manifest, capabilities, schema, and context commands are built for downstream automation rather than human-only use.
- Low operational overhead — installation via Homebrew or
go installis lightweight, and there is no server to deploy.
Cons:
- Narrow scope — Google-Health-CLI only solves Google Health API work, so it will not replace general API test tooling.
- No GUI — teams that depend on visual request building or shared collections will still prefer Postman.
- License and release metadata are not surfaced in the repo text — you can use the CLI, but the page does not provide a clean stars count or last tagged release in the scraped content.
- OAuth setup is mandatory — if you do not already have credentials, the first-run path is slower than a public API client.
- Healthcare data work still requires domain awareness — the CLI does not remove compliance, consent, or retention requirements from your implementation.
Getting Started with Google-Health-CLI
Install Google-Health-CLI with Homebrew or Go, then verify the binary before touching credentials. The first run should confirm that the executable is on your path and that the CLI can reach its local config and command tree.
brew install rudrankriyam/tap/ghealth
# or
go install github.com/rudrankriyam/Google-Health-CLI@latest
ghealth doctor
ghealth types list
ghealth endpoints list
After installation, configure your OAuth client and log in. Once authenticated, you can query data with --json, inspect schemas with ghealth agent schema, and test a specific family such as sleep or heart-rate without writing any custom HTTP wrapper.
ghealth config set client-id YOUR_CLIENT_ID
ghealth config set client-secret YOUR_CLIENT_SECRET
ghealth auth login
If you need write access, rerun login with --write only for the session or workflow that truly needs it. For pipelines, prefer environment variables so the CLI can run headlessly in CI without hardcoding secrets into shell history.
Verdict
Google-Health-CLI is the strongest option for terminal-first Google Health integration when you need deterministic JSON and scriptable OAuth. Its biggest strength is the typed command surface for data, rollups, and agent context, while the main caveat is its narrow scope and lack of a GUI. Use it when your workflow is code-driven, not click-driven.



