← 返回
安全合规 Key 中文

Strava CLI

Interact with Strava via the strava-client-cli Python tool. Use for viewing activities, athlete profiles, stats, and exporting data. Covers setup (creating a Strava account, API app, and OAuth) and all CLI commands.
通过 strava-client-cli Python 工具与 Strava 交互,用于查看活动、运动员资料、统计数据及导出数据。内容涵盖设置(创建 Strava 账户、API 应用及 OAuth)及所有 CLI 命令。
geodeterra
安全合规 clawhub v0.1.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 1,007
下载
💾 12
安装
1
版本
#latest

概述

Strava CLI

Install

uvx --from strava-client-cli strava --help
# Or install persistently:
uv tool install strava-client-cli

Setup

1. Create a Strava Account (if needed)

Sign up at https://www.strava.com/register. Only name, email, and password required.

2. Create a Strava API Application

  1. Go to https://www.strava.com/settings/api
  2. Fill in:
    • Application Name: any descriptive name
    • Category: pick closest match (e.g. "Other")
    • Website: any URL (e.g. your GitHub)
    • Authorization Callback Domain: localhost
    • Description: brief description
  3. Check the API Agreement checkbox
  4. Click Create
  5. Note your Client ID and Client Secret

> 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.

3. Authenticate

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.

Manual Token Exchange (headless/automated)

If no browser is available, do the OAuth flow manually:

  1. Build the auth URL:

```

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

```

  1. Open in any browser, authorize, grab the code from the redirect URL
  2. Exchange:

```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

```

  1. Save the response tokens to ~/.config/strava-cli/tokens.json:

```json

{

"access_token": "...",

"refresh_token": "...",

"expires_at": 1234567890,

"token_type": "Bearer"

}

```

Commands

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

Source

https://github.com/geodeterra/strava-cli

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-29 04:54 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,718
security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,607
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,215 📥 266,506