View and manage health and fitness metrics and measurement data from Fitbit, Pixel Watch, and other third-party devices and apps.
Created by @coopdogGGs (ryanc00per).
Quick Start
googlehealth-pp-cli doctor
googlehealth-pp-cli sync --resources steps,distance,daily-resting-heart-rate
googlehealth-pp-cli trends --window 7 --json
googlehealth-pp-cli correlate --a steps --b daily-resting-heart-rate --max-lag 3 --json
Unique Features
These capabilities aren't available in any other tool for this API.
trends — Per-metric trailing rolling-average trend lines with net first-to-last delta, de-noising day-to-day scale-weight and resting-HR whiplash
streaks — Current and longest consecutive-calendar-day streaks where a metric met a goal (e.g. 10k steps, resting HR under 60), with calendar gaps breaking the run
correlate — Pearson correlation plus best-lag scan between any two daily metrics (steps vs resting HR, sleep vs HRV) over locally synced history
sync — Mirror Google Health data points across data types into a local SQLite store for offline analysis
search — FTS5 full-text search across locally synced Google Health records
Usage
Run googlehealth-pp-cli --help for the full command reference and flag list.
Commands
projects
Manage projects
users
Manage users
Output Formats
Every command supports these output flags:
--json — structured output for scripting and agents
--select id,name,status — filter to specific fields
--dry-run — preview the request without sending
--agent — JSON + compact + non-interactive in one flag
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--json output to stdout, errors to stderr
- Filterable -
--select id,name returns only fields you need
- Previewable -
--dry-run shows the request without sending
- Explicit retries - add
--idempotent to create retries and --ignore-missing to delete retries when a no-op success is acceptable
- Confirmable -
--yes for explicit confirmation of destructive actions
- Piped input - write commands can accept structured input when their help lists
--stdin
- Offline-friendly - sync/search commands can use the local SQLite store when available
- Agent-safe by default - no colors or formatting unless
--human-friendly is set
Exit codes: 0 success, 2 usage error, 3 not found, 4 auth error, 5 API error, 7 rate limited, 10 config error.
Health Check
googlehealth-pp-cli doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Config file: ~/.config/google-health-pp-cli/config.toml
Static request headers can be configured under headers; per-command header overrides take precedence.
Environment variables:
| Name | Kind | Required | Description |
|---|
GOOGLEHEALTH_OAUTH2C | per_call | Yes | Set to your API credential. |
agentcookie (optional)
If you use agentcookie to sync secrets across machines, this CLI auto-adopts agentcookie-managed credentials with no extra setup. When the daemon writes to this CLI's config, googlehealth-pp-cli doctor reports agentcookie: detected and auth-status labels the source as agentcookie. Skip this section if you don't use agentcookie - the CLI works the same as any other.
Troubleshooting
Authentication errors (exit code 4)
- Run
googlehealth-pp-cli doctor to check credentials
- Verify the environment variable is set:
echo $GOOGLEHEALTH_OAUTH2C
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
Generated by CLI Printing Press