google-health-api/google-health-cli/ghealth-shared
Claude Code and agent skill by google-health-api/google-health-cli
- community
Checking that the SKILL.md file is still in the repository.
Shared prerequisites for all ghealth skills — auth, setup, global flags, command structure
Install
npx vskill@latest install google-health-api/google-health-cli/ghealth-sharedSKILL.md
ghealth — Shared Prerequisites
Setup
Six steps: GCP project ID, OAuth client_secret JSON (Desktop application), Health API enable, scope selection, browser-based OAuth, save profile.
Scriptable (skips prompts):
Add --non-interactive-auth to skip the browser step and finish later with ghealth auth login --complete <code>.
Files written
All under ~/.config/ghealth/ (override with GHEALTH_CONFIG_DIR):
| File | Contents | Mode | |
|---|---|---|---|
client_secret.json | Your GCP OAuth client | 0600 | |
credentials.json | Access + refresh tokens (plaintext JSON) | 0600 | |
pending_auth.json | In-progress non-interactive flow state | 0600 | |
config.toml | Active profile (project, scopes, format) | 0600 |
Authentication
| Method | Usage | |
|---|---|---|
| Stored credentials | ghealth auth login (default after setup) | |
| Headless (no browser) | ghealth auth login --non-interactive → click URL → ghealth auth login --complete <code> | |
| Move tokens between machines | ghealth auth export > creds.json → on target: ghealth auth import --file creds.json | |
| Access token (no refresh) | export GHEALTH_ACCESS_TOKEN=ya29... | |
| Credential file | export GHEALTH_CREDENTIALS_FILE=/path/to.json | |
| ADC (GCP envs) | Automatic if available |
Precedence: env token > credential file > stored > ADC. Refresh tokens are persisted in credentials.json and refreshed automatically (1h access-token lifetime); a 401 from the API force-refreshes once before erroring.
Check: ghealth auth status. Exit codes:
- 0 — locally configured; does not make a network call. Expired stored tokens still exit 0 — the JSON reports
authenticated: false/expired: true - 2 —
client_secret.jsonpresent but no stored tokens (credentials.jsonmissing); runghealth auth login - 5 — no
client_secret.jsonat all; error carriesnext_steps[]for bootstrap (see below)
Add --validate to verify the access token against Google's tokeninfo endpoint. Without it, env-token / credentials-file modes report configured: true but never claim authenticated: true — presence of a token doesn't prove validity. With --validate, the response includes authenticated, expires_in, and scope from Google.
Bootstrap recipes for agents
Fetch the OAuth client_secret checklist (no failing call needed):
The identical next_steps array is also embedded in every error path where a missing client_secret.json blocks progress: auth login (all modes including --complete), auth status, auth refresh, auth export, setup --no-prompt. Agents should jq -e '.error.next_steps' and relay verbatim.
Fresh install on a workstation (has browser):
Fresh install on a headless host (no browser):
Mount tokens into a container / second worker:
Command Structure
user subcommands: identity, profile get|update, settings get|update, irn-profile, paired-devices list|get --id <id>.
webhooks subcommands: subscribers list|create|update|delete, subscriptions list|create|update|delete --subscriber <id>, verify --url <url>. Requires the `cloud-platform` scope (ghealth auth login --scopes cloud-platform) and a configured project ID. These are project-level push-notification endpoints; the authenticated identity also needs Health API subscriber IAM permissions on the project.
Global Flags
| Flag | Effect | |||
|---|---|---|---|---|
| `--format json\ | table\ | csv` | Output format (default: json) | |
-o <file> | Write data to file; stdout shows only column schema + 3-row preview (not the data) | |||
--raw | Bypass response simplification, return original API JSON | |||
--dry-run | Print HTTP request without executing | |||
--profile <name> | Use named config profile |
list also accepts: --limit N (max total results, default 500), --from, --to, --filter, --page-token (resume from a prior response's nextPageToken), --detail (sleep).
Discovery
Output
- Responses are simplified by default: flat timestamps with UTC offset, compact source, no empty fields
- JSON output always has the same shape for every read (
list,get,rollup,daily-rollup,reconcile): an object{"dataPoints": [...]}, with optional_hintsandnextPageToken. The rows are always underdataPoints— even for rollups and empty results — sojson.load(out)["dataPoints"]always works --rawreturns the full API response--format csvoutputs flat CSV; nested objects are auto-flattened to dot-separated columns (e.g.,metricsSummary.caloriesKcal)-o <file>writes data to the file and prints only a summary to stdout (row count, column names, 3-row preview). Use this instead of piping (> file) — piping gives you the file but no schema on stdout- Errors always JSON on stderr, exit codes 0-5
- Timestamps include user's timezone offset (e.g.,
+01:00)
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ghealth-shared/SKILL.md
Popularity
- Repository stars
- 258
- Repository forks
- 27
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/google-health-api/google-health-cli/ghealth-shared)