A simple CLI to interact with the Strava API.
-
Clone the repository:
git clone https://github.com/yourusername/stravacli.git cd stravacli -
Create a virtual environment and install:
python3 -m venv venv source venv/bin/activate pip install -e .
The CLI uses environment variables to authenticate with the Strava API.
-
Create a
.envfile in the root directory (you can use.env.exampleas a template):cp .env.example .env
-
Fill in your Strava API credentials:
STRAVA_CLIENT_ID: Your application Client ID.STRAVA_CLIENT_SECRET: Your application Client Secret.STRAVA_ACCESS_TOKEN: Your personal Access Token.
Note
You can obtain these credentials by creating an application at Strava Developers.
Once installed and configured, you can use the strava command:
strava --versionstrava whoamiFor the authenticated user:
strava athlete-statsFor a specific athlete ID:
strava athlete-stats 12345678The CLI supports automatic command completion for bash, zsh, and fish.
-
Install completion for your current shell:
strava --install-completion
-
Restart your terminal or source your configuration file (e.g.,
source ~/.zshrc). -
Enjoy autocompletion by pressing
TABafter typingstrava.