A Rust CLI tool to extract and display workouts from the WeightXReps.net website. It authenticates using credentials from a file and retrieves workout data via the GraphQL API, with support for listing, showing, summarizing, and fetching workouts into local cache.
[[ This project is loosly based on bartman/wxrtools that I wrote in C a long time ago. ]]
- Authenticates using email and password from
credentials.txt(email first line, password second) - Authenticates and caches JWT token in
$XDG_CACHE_HOME/wxrust/token(or~/.cache/wxrust/token) - Retrieves individual workouts or lists of workout dates
- Formats output with colors matching the website editor
- Supports detailed views, summaries, and date filtering
- Handles JWT tokens and GraphQL queries efficiently
- Caches workout data locally in XDG cache directory for improved performance
- Fetches and caches workouts in bulk with progress indication, using batched concurrent GraphQL requests
- Compares local cache with server versions
- Imports workouts from text export files
Clone the repository and build with Cargo:
git clone https://github.com/bartman/wxrust.git
cd wxrust
cargo build --releaseRun unit tests with cargo test. For end-to-end smoke tests requiring credentials, use ./smoke.py
To capture failures, if any, use this:
./smoke.py --work-dir tmp --output smoke.logCreate a credentials.txt file with your WeightXReps account email on the first line and password on the second. The program looks for this file in the following locations (in order):
- The path specified with
--credentialsoption (if provided) $XDG_CONFIG_HOME/wxrust/credentials.txt(or~/.config/wxrust/credentials.txtifXDG_CONFIG_HOMEis not set)~/.config/wxrust/credentials.txt./credentials.txt(in the current working directory)
--credentials <file>: Path to credentials file (optional, falls back to standard locations)--force-authentication: Force re-login, ignore cached token (still saves new token to cache)-N, --no-network: Skip network access, use cache only (workouts and dates come from local cache)-C, --no-cache: Skip cache lookup, fetch all data from server (writes still happen unless--no-cache-writeis also used)-W, --no-cache-write: Disable cache writes (reads still happen unless--no-cacheis also used)-s, --scan-days <DAYS>: How many days to scan for new workout dates before using the cache (default:0). Must appear before the subcommand, like other global flags (wxrust -s 7 table deadlift).list/show-sis still--summary.-s 0: scan from the last cached workout through today (skips the network if the cache already has today)-s 7: scan the last 7 days (and still use cached dates for older history)-s -1: list dates from the server over the full requested range-s 0with--no-cacheor an empty cache falls back to a full scan
--color <always|never|auto>: Control color output (default: auto, based on TTY)
Note: --no-network and --no-cache are mutually exclusive. --no-network ignores --scan-days.
- Show the most recent workout:
wxrust show - Show workout for a specific date:
wxrust show 2025-10-31 - Show summary of recent workout:
wxrust show --summary
- List recent workout dates:
wxrust list --count 5 - List with full details:
wxrust list --details --count 3 - List with summaries:
wxrust list --summary --count 2 - List before a date:
wxrust list --before 2025-10-30 --count 5 - List in a date range:
wxrust list 2025-10-01..2025-10-31 - Reverse order:
wxrust list --count 5 --reverse - List all (up to 1000):
wxrust list --all - List with exercise filter:
wxrust list --count 5 squat(only dates with squats) - List range with filter:
wxrust list 2025-10-01..2025-10-31 bench(only dates in range with bench press) - Summary with filter:
wxrust list --summary --count 2 deadlift(summary only includes deadlifts)
- Fetch and cache workouts for 2025:
wxrust fetch 2025 - Fetch new workouts since the last cached date:
wxrust fetch(default-s 0) - Fetch the full history:
wxrust -s -1 fetch - Show diff between local and server:
wxrust fetch --diff 2025-10(only workouts whose cache file would change) - Force re-download:
wxrust fetch --force 2025 - Import from text export file:
wxrust fetch --file export.txt - Print transfer rate after fetch:
wxrust fetch --stats 2026
fetch downloads workouts concurrently (10 dates per GraphQL request, 8 requests in flight) and skips dates that are already cached unless --force is used. --stats prints per-date skip messages (YYYY-MM-DD already cached, skipping) and X workouts, Y seconds, x.y T/s, x.y MB/s after the progress line. --diff compares the cache file to what a fetch would write and prints nothing for unchanged days.
Display a progression table showing personal records (PRs) over time for specific exercises.
- Show PRs for all exercises:
wxrust table - Filter by exercise name:
wxrust table deadlift - Multiple filters (OR logic):
wxrust table deadlift squat - Filter by date range:
wxrust table 2025 - Combine date and exercise filters:
wxrust table 2025 deadlift
table (and heatmap / filtered list) list dates from the local cache and scan only recent days for new workouts (--scan-days, default 0). -s -1 lists dates with concurrent jrange windows over the full range. Workout bodies load through the same batched jday path as fetch; cached days stay local. --no-network skips the date listing round-trip entirely.
Arguments are automatically classified as dates or exercise filters:
- Date formats:
YYYY,YYYY-MM,YYYY.MM,YYYYMM,YYYY-MM-DD,YYYY.MM.DD,YYYYMMDD - Everything else: Treated as exercise name filter (case-insensitive substring match)
The table shows:
- Date of each PR, days ago, body weight
- Exercise name and estimated 1RM (Brzycki formula)
- Projected weights for rep ranges 1-10
- Color gradient from oldest (cool colors) to newest (warm colors)
- Records within 7 days highlighted in bright yellow
Display a calendar heatmap showing workout intensity over time.
- Show 1RM heatmap:
wxrust heatmap - Show sets heatmap:
wxrust heatmap --sets - Show reps heatmap:
wxrust heatmap --reps - Show volume heatmap:
wxrust heatmap --volume - Show weight heatmap:
wxrust heatmap --weight - Filter by date range:
wxrust heatmap 2025 - Filter by exercise:
wxrust heatmap deadlift - Combine filters:
wxrust heatmap 2025 deadlift --sets
The heatmap displays a calendar grid with days colored by intensity (green gradient). Days without workouts are gray. Without color support, uses symbol gradients.
# Show last workout
wxrust show
# List 5 recent workout dates
wxrust list --count 5
# Show detailed view of last 2 workouts
wxrust list --details --count 2
# Summarize workouts before a specific date
wxrust list --summary --before 2025-10-30 --count 3
# List workouts in October 2025
wxrust list 2025-10-01..2025-10-31
# Fetch workouts for 2025
wxrust fetch 2025
# Show differences for October workouts
wxrust fetch --diff 2025-10
# Show PR progression table for deadlifts in 2025
wxrust table 2025 deadlift
# Show all PRs for squats
wxrust table squat
# Disable colors
wxrust --color never list --summary --count 1reqwest: HTTP client with connection reuseserde: JSON serializationbase64: JWT decodingtokio: Async runtimeansi_term: Terminal colorsatty: TTY detectionlazy_static: Global color stateclap: CLI parsingregex: Text processingchrono: Date handlingindicatif: Progress barssimilar: Text diffing
Interacts with WeightXReps GraphQL API at https://weightxreps.net/api/graphql. Uses login mutation for auth, jrange query for date ranges (up to 32 weeks per request; bounded ranges fire independent windows concurrently), and JDay query for individual workouts (up to 10 dates per request, 8 requests in flight). Cached unit preference avoids an extra getSession on every run. Supports efficient connection reuse for multiple requests.
