1
1
# Fitbit CLI
2
2
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 )
4
4
] ( https://pypi.org/project/fitbit-cli/ ) [ ![ PyPI - Version] ( https://img.shields.io/pypi/v/fitbit-cli )
5
5
] ( https://pypi.org/project/fitbit-cli/ )
6
6
9
9
Access 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!
10
10
11
11
<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">
13
13
</p >
14
14
15
+ [ ![ asciicast] ( https://asciinema.org/a/696114.svg )] ( https://asciinema.org/a/696114 )
16
+
15
17
## Supported Web APIs
16
18
17
19
> Only ` GET ` APIs are supported!
@@ -25,11 +27,17 @@ Access your Fitbit data directly from your terminal 💻. View 💤 sleep logs,
25
27
| [ Active Zone Minutes (AZM) Time Series] ( https://dev.fitbit.com/build/reference/web-api/active-zone-minutes-timeseries/ ) | ✅ |
26
28
| [ Activity] ( https://dev.fitbit.com/build/reference/web-api/activity/ ) | 👷 |
27
29
28
- ## Install
30
+ ## Usage Guide
31
+
32
+ 1 . Install the Fitbit CLI
29
33
30
34
``` bash
31
35
python -m pip install fitbit-cli
36
+ ```
37
+
38
+ 2 . Help
32
39
40
+ ``` bash
33
41
fitbit-cli -h
34
42
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]]] [-o [DATE[,DATE]]] [-e [DATE[,DATE]]] [-a [DATE[,DATE]]] [-u] [-v]
35
43
@@ -56,15 +64,38 @@ APIs:
56
64
Show user profile data
57
65
```
58
66
59
- ## Register Fitbit App
67
+ 3. Register Fitbit App
60
68
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
64
72
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.**_
68
99
69
100
## Local Development
70
101
0 commit comments