Skip to content

bzimmer/gravl

Repository files navigation

Overview

build codecov

gravl logo

gravl command line clients for activity-related services

Activity clients

Installation

Docker

gravl is available as a Docker image on GitHub Container Registry:

# Minimal image (just the binary)
FROM ghcr.io/bzimmer/gravl:latest AS gravl
FROM scratch
COPY --from=gravl /usr/bin/gravl /usr/bin/gravl
ENTRYPOINT ["/usr/bin/gravl"]

# Or with a base distro if you need shell access
FROM ghcr.io/bzimmer/gravl:latest AS gravl
FROM debian:bookworm-slim
COPY --from=gravl /usr/bin/gravl /usr/bin/gravl

Available image tags:

  • ghcr.io/bzimmer/gravl:latest - latest stable release
  • ghcr.io/bzimmer/gravl:v1.2.3 - specific version

Homebrew

brew install bzimmer/tap/gravl

Authentication

Strava requires OAuth2 tokens to access the API on behalf of a user. gravl includes an oauth subcommand for Strava to start a local web server and guide you through the authorization flow.

Strava

  1. Register an application at https://www.strava.com/settings/api to obtain a client ID and client secret. Set the "Authorization Callback Domain" to localhost.
  2. Export the client credentials as environment variables:
    export STRAVA_CLIENT_ID=<your client id>
    export STRAVA_CLIENT_SECRET=<your client secret>
  3. Run the OAuth command to start the local authorization server:
    gravl strava oauth
  4. Open a browser to http://localhost:9001. You will be redirected to Strava to authorize the application.
  5. After authorizing, the browser will display a JSON document containing the access and refresh tokens.
  6. Copy the refresh token and set it as an environment variable:
    export STRAVA_REFRESH_TOKEN=<your refresh token>

Documentation