#upload #platform #activity #icu #intervals #logs #strava

app trackme

upload activity logs to analysis platforms

1 unstable release

0.1.0 Oct 22, 2023

#6 in #intervals

GPL-3.0-or-later

40KB
616 lines

trackme

Command-line tool for uploading activity logs to platforms like Intervals.icu and Strava.

Quickstart

$ trackme upload --name "My Activity" activity.fit
  [intervals.icu] upload finished (ID i12345)
  [strava       ] upload finished (ID 12345)

Installation

To install trackme, you need Rust 1.70.0 or later. Download the source code for the latest release and compile it with:

$ git clone https://codeberg.org/robink/trackme.git
$ cd trackme
$ git checkout stable
$ cargo build --release

It is recommended to verify the OpenPGP signature of the release before compiling and installing it:

$ git verify-commit stable

All releases should be signed with the key EC7E F0F9 B681 4C24 6236 3842 B755 6972 702A FD45.

Alternatively, you can install trackme directly from crates.io:

$ cargo install --locked trackme

Usage

Commands

The main command is upload. It uploads an activity file – typically in the FIT, GPX or TCX format – to one or more tracking platforms. Per default, it uploads to all supported platforms. You can select the platforms with the --platforms option. Use the --name option to override the activity name that is generated by the platform.

$ trackme upload activity.fit
  [intervals.icu] upload finished (ID i12345)
  [strava       ] upload finished (ID 12345)

$ trackme upload --name "My Activity" activity.fit
  [intervals.icu] upload finished (ID i12345)
  [strava       ] upload finished (ID 12345)

$ trackme upload --platforms strava --name "My Strava Activity" activity.fit
  [strava] upload finished (ID 12345)

Configuration

trackme tries to load its configuration from one of the following files:

  • ${XDG_CONFIG_HOME}/trackme/config.toml (default: ~/.config/trackme/config.toml)
  • ${dir}/trackme/config.toml for dir in XDG_CONFIG_DIRS (default: /etc/xdg/trackme/config.tml)

Alternatively, the path to the config file can be set using the --config option.

config.toml is an example configuration file that describes the available settings. All settings can also be passed as command-line arguments. Use the --help option to list the available arguments.

Platforms

The following sections describe how to set up the supported platforms so that you can upload your activities. It is recommended to use the configuration file for the required settings, but you can also use CLI arguments instead.

Intervals.icu

To upload to Intervals.icu, you need the athlete ID and API key from SettingsDeveloper Settings.

CLI:

$ trackme --intervals-icu-athlete-id i12345 --intervals-icu-api-key secret-string ...

Configuration:

[platform.intervals_icu]
athlete_id = "i12345"
api_key = "secret-string"

Strava

To upload to Strava, you first need to create an API application in SettingsMy API Application, as described in the Strava Developer documentation. Then configure trackme with the client ID and secret for your API application.

CLI:

$ trackme --strava-client-id 12345 --strava-client-secret secret-string ...

Configuration:

[platform.strava]
client_id = 12345
client_secret = "secret-string"

Before you can upload activities to Strava, you need to authorize the application for your account using the strava login command. It will print a URL that you have to open in a web browser (or use the --open option to open it automatically). Login to your Strava account and authorize the application. You will be redirected to a localhost URL. Copy that URL and paste it to the strava login command.

$ trackme strava login --open

This generates an access token for accessing the Strava API and a refresh token to renew the access token if it expires. To keep track of these tokens, trackme will generate the file ${XDG_STATE_HOME}/trackme/strava.toml (default: ~/.local/state/trackme/strava.toml).

Contact

For bug reports, feature requests and other messages, please open an issue for the Codeberg.org project.

License

This project is licensed under the GNU General Public License, Version 3.0 or later. The documentation and examples contained in this repository are licensed under the Creative Commons Zero license. For more information, see the license header in each file. You can find a copy of the license texts in the LICENSES directory.

trackme complies with version 3.0 of the REUSE specification.

Dependencies

~5–18MB
~257K SLoC