11# Fitbit CLI
22
3- [ ![ Release] ( https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml/badge.svg?branch=main&event=release )] ( https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml ) [ ![ PyPI - Status] ( https://img.shields.io/pypi/status/fitbit-cli )
3+ [ ![ Release] ( https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml/badge.svg )] ( https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml ) [ ![ PyPI - Status] ( https://img.shields.io/pypi/status/fitbit-cli )
44] ( https://pypi.org/project/fitbit-cli/ ) [ ![ PyPI - Version] ( https://img.shields.io/pypi/v/fitbit-cli )
55] ( https://pypi.org/project/fitbit-cli/ )
66
99Access your Fitbit data directly from your terminal 💻. View 💤 sleep logs, ❤️ heart rate, 🏋️♂️ activity levels, 🩸 SpO2, and more, all presented in a simple, easy-to-read table format!
1010
1111<p align =" center " >
12- <img alt="Fitbit logo", width="250" src=". /assets/Fitbit_Logo_White_RGB.jpg">
12+ <img alt="Fitbit logo", width="250" src="https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main /assets/Fitbit_Logo_White_RGB.jpg">
1313</p >
1414
15+ [ ![ asciicast] ( https://asciinema.org/a/696114.svg )] ( https://asciinema.org/a/696114 )
16+
1517## Supported Web APIs
1618
1719> Only ` GET ` APIs are supported!
@@ -25,11 +27,17 @@ Access your Fitbit data directly from your terminal 💻. View 💤 sleep logs,
2527| [ Active Zone Minutes (AZM) Time Series] ( https://dev.fitbit.com/build/reference/web-api/active-zone-minutes-timeseries/ ) | ✅ |
2628| [ Activity] ( https://dev.fitbit.com/build/reference/web-api/activity/ ) | 👷 |
2729
28- ## Install
30+ ## Usage Guide
31+
32+ 1 . Install the Fitbit CLI
2933
3034``` bash
3135python -m pip install fitbit-cli
36+ ```
37+
38+ 2 . Help
3239
40+ ``` bash
3341fitbit-cli -h
3442usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]]] [-o [DATE[,DATE]]] [-e [DATE[,DATE]]] [-a [DATE[,DATE]]] [-u] [-v]
3543
@@ -56,15 +64,38 @@ APIs:
5664 Show user profile data
5765```
5866
59- ## Register Fitbit App
67+ 3. Register Fitbit App
6068
61- 1. Go to [https://dev.fitbit.com/apps](https://dev.fitbit.com/apps)
62- 2. Click on "REGISTER AN APP" tab
63- 3. Follow below example and register an app
69+ 1. Go to [https://dev.fitbit.com/apps](https://dev.fitbit.com/apps)
70+ 2. Click on "REGISTER AN APP" tab
71+ 3. Follow below example and register an app
6472
65- <p align="left">
66- <img alt="Fitbit logo", width="700" src="./assets/fitbit-app-registration.png">
67- </p>
73+ <p align="left">
74+ <img alt="Fitbit logo", width="700" src="https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/fitbit-app-registration.png">
75+ </p>
76+
77+ 4. Run the following command to set up interactive authentication and store the Fitbit token locally
78+
79+ ```bash
80+ fitbit-cli --init-auth
81+ ```
82+
83+ For a visual guide, see the Asciinema recording below
84+ [](https://asciinema.org/a/696115)
85+
86+ 5. Start using it 😎
87+
88+ ```bash
89+ $ fitbit-cli -s
90+ Sleep Data Summary 😴
91+ ┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
92+ ┃ Date 📆 ┃ Deep Sleep 🛏 ┃ Light Sleep 💤 ┃ REM Sleep 🌙 ┃ Wake Time ⏰ ┃ Efficiency 💯 ┃
93+ ┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
94+ │ 2024-12-25 │ 139 min │ 190 min │ 155 min │ 54 min │ 55% │
95+ └────────────┴──────────────┴────────────────┴──────────────┴──────────────┴───────────────┘
96+ ```
97+
98+ _**NOTE: The token is valid for only 8 hours, `fitbit-cli` automatically refreshes the token when it expires.**_
6899
69100## Local Development
70101
0 commit comments