
Google Health CLI 俾 AI 讀 Fitbit 數據,方便但唔係冇風險
開發者可砌 dashboard,同時要面對 OAuth、token 同敏感健康資料
一條 terminal command,背後係 Fitbit 遷入 Google Health
Google Health CLI 乍聽好 developer-only,其實代表 Google 而家想令 Fitbit / Pixel Watch 嗰批健康數據,變成 agent 同 dashboard 可以直接拎嚟用嘅原料。Android Authority 先報道呢個新工具;Google Health Community 公告同 GitHub README 都寫明,ghealth 走 Google Health API v4,可以查 40+ 健康同運動指標,包括 steps、heart rate、sleep、VO2 Max、HRV、SpO2、ECG、blood glucose 同 nutrition 等。重點唔係多一個 CLI,而係你唔使再等 Google Health app 自己整某個圖表,可以自己匯出 JSON / CSV,或者餵畀 AI agent 做整理。

圖片:Google
實際可以做咩
最貼地嘅玩法係個人 dashboard。你可以定時拉睡眠、心率、步數同運動紀錄,砌成自己睇得明嘅趨勢表;跑步人可以每星期自動出 recovery 摘要;開發者可以用 dry-run、schema types 呢類指令,先睇 API 實際會拎咩資料再接入服務。Google 個 README 仲寫到,呢個 repo 有兩個 Agent Skills,用意係令 agent 識得 setup、auth 同查 data type。換句話講,Google 已經預咗有人會叫 AI 直接幫你讀健康數據。

圖片:Google
點解而家先出
呢個時間點唔係偶然。Google 官方文檔寫到,legacy Fitbit Web API 2026 年 9 月會關掉,現有 Fitbit API integration 要搬去 Google Health API 同 Google OAuth 2.0;OAuth token 唔可以直接過戶,用家要重新授權。Google Fit API 另一邊亦去到收尾階段,Android 官方建議 cloud-based integration 轉 Google Health API,手機本地步數類 app 就用 Health Connect。Health CLI 其實係示範一個新方向:Fitbit 數據以後可以離開 app 入面嗰張卡片,入到 Google Cloud、OAuth 同 agent 工具鏈入面嘅資料流。
真正要睇權限
Google Health API scope 全部屬 restricted,讀寫 sleep、profile、ECG、GPS exercise location、nutrition 之類資料,都要用家 OAuth 同意。Google setup 文檔亦寫明,新 OAuth client 預設未驗證,測試 / production 都有 100 人 cap;多過 100 人要第三方 security review。呢點好關鍵:個人 power user 可以玩到,但公司想整成 app,唔係放條 command 出街咁簡單。你要做最小 scope、清楚講明拎咩、存幾耐、點刪,否則健康數據一入 agent pipeline,就好易由「方便」變成「散晒」。
AI agent 讀健康資料,最怕係你唔記得佢讀過咩
CLI 本身唔等於危險,問題係 agent 最鍾意拎輸出再轉手:寫入筆記、傳去雲端、生成摘要,甚至接日曆自動改行程。Google Health CLI README 明寫 credentials.json 會喺本機 ~/.config/ghealth/ 存 access 同 refresh token,而且係 plaintext JSON,只靠檔案權限保護。呢個設計方便 script,但亦即係你部機、CI、agent sandbox、備份目錄,一出事就可能帶埋健康 token 走。尤其 sleep、心率、血糖、ECG 呢類資料,唔好同普通 app usage log 當成同一級風險。
香港可用性唔好講到太滿
香港 iOS App Store 見到 Google Health (Fitbit) app,開發者係 Google;但暫時未見 Google Health CLI 或 Google Health API 文檔列出港區帳戶支援清單。即係話,用開 Fitbit / Pixel Watch 嘅香港用家有機會可以跟 GitHub 步驟試 OAuth,但唔應該假設 Health Coach、Premium、medical records 或所有 API scope 都喺香港帳戶即開即用。產品團隊真係要接呢條 API,就要用實際港區 Google 帳戶、裝置同 consent flow 驗一次,唔好靠美國文檔推落本地。
值唔值得玩
Health CLI 係幾實用嘅 developer shortcut,尤其係啲本來已經會用 spreadsheet、Grafana、Notion 或自家 script 管健康數據嘅人;佢令 Fitbit 數據終於唔使困喺官方 app 入面。不過健康資料一開畀 AI,最要緊係 scope、token、輸出檔同 retention 要管得住。想玩可以,先用 readonly scope、短時間窗口、local-only 流程試;有醫療判斷、診斷、治療決定,就交返畀醫護。下一步要睇 Google 會唔會令呢套 CLI 成為 Gemini / Health Coach 嘅正式橋樑。
參考來源
- Android Authority — This new Google tool brings AI agents your Fitbit and health data — original report
- Google Health Community: Introducing the Google Health CLI — Google 官方公告,確認 CLI 支援 40+ 指標、AI agent 場景同 GitHub repo。
- Google-Health-API/google-health-cli — 官方 GitHub README,核對安裝、OAuth、資料類型、輸出格式同 token 儲存方式。
- Google Health API docs — 官方 API 文檔,確認 Google Health API 係下一代 Fitbit Web API。
- Google Health API scopes — 核對 Health API 權限分類,同 sleep、profile、ECG、nutrition 等 scope。
- About the Google Health API — 核對 Fitbit Web API 2026 年 9 月關掉、restricted scopes 同裝置支援說法。
- Android Health & Fitness: Fit migration guide — 補充 Google Fit、Google Health API 同 Health Connect 嘅分工背景。
- App Store HK: Google Health (Fitbit) — 確認香港 App Store 見到 Google Health (Fitbit) app,但唔等於 CLI/API 港區帳戶全面確認。
本文根據原文及公開資料整理;資料有出入時,以原文及官方資料為準。






