uvx --from strava-client-cli strava --help
# Or install persistently:
uv tool install strava-client-cli
Sign up at https://www.strava.com/register. Only name, email, and password required.
localhost> Important: New Strava API apps allow only 1 connected athlete. To connect a different athlete, revoke the current one at Settings → My Apps → Revoke Access.
strava auth
Enter Client ID and Client Secret when prompted. Open the displayed URL in a browser, authorize, then copy the code parameter from the redirect URL (http://localhost/?code=XXXXX) and paste it back.
Tokens auto-refresh (every 6 hours). Config: ~/.config/strava-cli/config.json, tokens: ~/.config/strava-cli/tokens.json.
If no browser is available, do the OAuth flow manually:
```
https://www.strava.com/oauth/authorize?client_id=CLIENT_ID&response_type=code&redirect_uri=http://localhost&approval_prompt=force&scope=activity:read_all,profile:read_all
```
code from the redirect URL```bash
curl -s -X POST https://www.strava.com/oauth/token \
-d client_id=CLIENT_ID \
-d client_secret=CLIENT_SECRET \
-d code=CODE \
-d grant_type=authorization_code
```
~/.config/strava-cli/tokens.json:```json
{
"access_token": "...",
"refresh_token": "...",
"expires_at": 1234567890,
"token_type": "Bearer"
}
```
strava profile # Athlete profile
strava stats # Run/ride/swim stats summary
strava activities --limit 10 # Recent activities
strava activities --type Run --after 2024-01-01 # Filter by type/date
strava activity 12345678 # Detailed activity view
strava export --output ./data --format json # Bulk export
https://github.com/geodeterra/strava-cli
共 1 个版本