KosmoKrator

other

Strava CLI for AI Agents

Use the Strava CLI from KosmoKrator to call Strava tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

6 functions 5 read 1 write Bearer token auth

Strava CLI Setup

Strava can be configured headlessly with `kosmokrator integrations:configure strava`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure strava --set access_token="$STRAVA_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor strava --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token STRAVA_ACCESS_TOKEN Secret secret yes Access Token
url STRAVA_URL URL url no API Base URL

Call Strava Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call strava.strava_create_activity '{
  "name": "example_name",
  "type": "example_type",
  "start_date_local": "example_start_date_local",
  "elapsed_time": 1,
  "description": "example_description",
  "distance": 1,
  "trainer": 1,
  "commute": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:strava strava_create_activity '{
  "name": "example_name",
  "type": "example_type",
  "start_date_local": "example_start_date_local",
  "elapsed_time": 1,
  "description": "example_description",
  "distance": 1,
  "trainer": 1,
  "commute": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs strava --json
kosmo integrations:docs strava.strava_create_activity --json
kosmo integrations:schema strava.strava_create_activity --json
kosmo integrations:search "Strava" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Strava.

strava.strava_create_activity

Write write

Create a manual activity on Strava. Requires a name, activity type, start date, and elapsed time in seconds.

Parameters
name, type, start_date_local, elapsed_time, description, distance, trainer, commute

Generic CLI call

kosmo integrations:call strava.strava_create_activity '{"name":"example_name","type":"example_type","start_date_local":"example_start_date_local","elapsed_time":1,"description":"example_description","distance":1,"trainer":1,"commute":1}' --json

Provider shortcut

kosmo integrations:strava strava_create_activity '{"name":"example_name","type":"example_type","start_date_local":"example_start_date_local","elapsed_time":1,"description":"example_description","distance":1,"trainer":1,"commute":1}' --json

strava.strava_get_activity

Read read

Get detailed information about a specific Strava activity, including distance, pace, elevation, and splits.

Parameters
activity_id

Generic CLI call

kosmo integrations:call strava.strava_get_activity '{"activity_id":1}' --json

Provider shortcut

kosmo integrations:strava strava_get_activity '{"activity_id":1}' --json

strava.strava_get_athlete

Read read

Get the authenticated athlete's Strava profile — name, location, follower/following counts, and stats.

Parameters
none

Generic CLI call

kosmo integrations:call strava.strava_get_athlete '{}' --json

Provider shortcut

kosmo integrations:strava strava_get_athlete '{}' --json

strava.strava_get_current_user

Read read

Get the current authenticated user's Strava profile. This is an alias for strava_get_athlete — returns name, location, follower/following counts, and stats.

Parameters
none

Generic CLI call

kosmo integrations:call strava.strava_get_current_user '{}' --json

Provider shortcut

kosmo integrations:strava strava_get_current_user '{}' --json

strava.strava_list_activities

Read read

List recent activities for the authenticated Strava athlete. Supports pagination and date filtering with before/after Unix timestamps.

Parameters
page, per_page, before, after

Generic CLI call

kosmo integrations:call strava.strava_list_activities '{"page":1,"per_page":1,"before":1,"after":1}' --json

Provider shortcut

kosmo integrations:strava strava_list_activities '{"page":1,"per_page":1,"before":1,"after":1}' --json

strava.strava_list_clubs

Read read

List clubs the authenticated Strava athlete belongs to. Returns club names, member counts, and sport types.

Parameters
page, per_page

Generic CLI call

kosmo integrations:call strava.strava_list_clubs '{"page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:strava strava_list_clubs '{"page":1,"per_page":1}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

strava.strava_create_activity

Create a manual activity on Strava. Requires a name, activity type, start date, and elapsed time in seconds.

Operation
Write write
Schema command
kosmo integrations:schema strava.strava_create_activity --json
ParameterTypeRequiredDescription
name string yes Name of the activity (e.g., "Morning Run").
type string yes Activity type: Run, Ride, Swim, Hike, Walk, Workout, WeightTraining, Yoga, etc.
start_date_local string yes ISO 8601 local start date and time (e.g., "2025-01-15T09:30:00").
elapsed_time integer yes Elapsed time in seconds.
description string no Description of the activity.
distance number no Distance in meters.
trainer integer no Set to 1 if this is a trainer/trainer ride activity.
commute integer no Set to 1 if this is a commute activity.

strava.strava_get_activity

Get detailed information about a specific Strava activity, including distance, pace, elevation, and splits.

Operation
Read read
Schema command
kosmo integrations:schema strava.strava_get_activity --json
ParameterTypeRequiredDescription
activity_id integer yes The ID of the activity to retrieve.

strava.strava_get_athlete

Get the authenticated athlete's Strava profile — name, location, follower/following counts, and stats.

Operation
Read read
Schema command
kosmo integrations:schema strava.strava_get_athlete --json
ParameterTypeRequiredDescription
No parameters.

strava.strava_get_current_user

Get the current authenticated user's Strava profile. This is an alias for strava_get_athlete — returns name, location, follower/following counts, and stats.

Operation
Read read
Schema command
kosmo integrations:schema strava.strava_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

strava.strava_list_activities

List recent activities for the authenticated Strava athlete. Supports pagination and date filtering with before/after Unix timestamps.

Operation
Read read
Schema command
kosmo integrations:schema strava.strava_list_activities --json
ParameterTypeRequiredDescription
page integer no Page number (default: 1).
per_page integer no Number of activities per page (default: 30, max: 200).
before integer no Unix timestamp — return activities before this time.
after integer no Unix timestamp — return activities after this time.

strava.strava_list_clubs

List clubs the authenticated Strava athlete belongs to. Returns club names, member counts, and sport types.

Operation
Read read
Schema command
kosmo integrations:schema strava.strava_list_clubs --json
ParameterTypeRequiredDescription
page integer no Page number (default: 1).
per_page integer no Number of clubs per page (default: 30).

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.