speediance-cli

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2026 License: MIT

README

speediance-cli

CI Go Reference Go Report Card Release

A tiny, agent-friendly CLI for the Speediance (Gym Monster) cloud API. Read your completed workouts and create programs that show up on the machine — no photos to reference mid-session. Every command speaks --json, and the tool owns no data layout: it returns structured data and creates programs; you (or your agent) decide what to do with it.

A single, statically-compiled Go binary — no Python, no runtime, nothing to install alongside it. CLI-compatible with the original Python speediance-cli (same commands, same --json).

⚠️ Device support: built and tested for the Gym Monster (v1) (device_type = 1). A Gym Monster 2 now exists and may use a different device type and exercise ids — it is currently UNTESTED. Set SPEEDIANCE_DEVICE_TYPE (or device_type in config.json) if you want to try another device.

Point an agent at this repo. See AGENTS.md for the full self-serve guide (setup, credentials, command surface, plan schema).

Unofficial — uses the Speediance cloud API reverse-engineered from the Android app. Personal use, your own account. Built on the MIT-licensed UnofficialSpeedianceWorkoutManager (hbui3) and speediance-influx (gavinmcfall).

Install

Pre-built binary (recommended): download the archive for your OS/arch from the Releases page, extract, and put speediance-cli on your PATH.

With Go (1.24+):

go install github.com/stozo04/speediance-cli/cmd/speediance-cli@latest
speediance-cli login

go install drops the binary in $(go env GOPATH)/bin — make sure that's on your PATH.

Credentials via env vars (SPEEDIANCE_EMAIL, SPEEDIANCE_PASSWORD, SPEEDIANCE_REGION), a gitignored config.json, or a gitignored .env file in the working directory (auto-loaded; real exported env vars take precedence over it) — see .env.example / config.example.json and AGENTS.md. SSO/Google accounts: set a password in the Speediance app once.

Commands

speediance-cli workouts --days 7 --json      # recent sessions
speediance-cli session <training_id> --json  # full per-set detail
speediance-cli library --search "row"        # exercise catalog (ids/names/muscles)
speediance-cli push plan.json --dry-run      # build a program (preview)
speediance-cli push plan.json                # create it on your account

sync is an optional extra that writes a session into Markdown WEEKS/Week-XX.md checklist files. It needs a path and nothing else does:

speediance-cli sync --weeks-dir /path/to/WEEKS

Convenience commands: config show|set|path (manage config.json without hand-editing), version (build metadata; also --version), and completion bash|zsh|fish|powershell.

Create a workout

Author a plan (a human, a coach, or an LLM can write it), then push it:

{
  "name": "Pull Day",
  "exercises": [
    {"id": 434, "title": "Seated Dual-Handle Lat Pulldown",
     "sets": [{"reps": 12, "weight": 20, "mode": 1, "rest": 75}]}
  ]
}

weight is kilograms; mode 1=Standard; rest in seconds. Get ids from speediance-cli library. Full schema and field notes in AGENTS.md.

Conventions

  • stdout is parseable with --json; all human hints, warnings, and logs go to stderr. Never interleaved — pipe stdout straight into a parser.
  • Exit codes: 0 success, 2 auth failure, non-zero for other errors.
  • Secrets: config.json, .token.json, .env, and plans/ are gitignored. Never commit them. Prefer env vars for agents/headless use.

ClawHub skill

This tool is published as a public skill on ClawHub so any OpenClaw or compatible agent can install it. The skill definition lives in SKILL.md. ClawHub is updated automatically on every change to SKILL.md via GitHub Actions — no manual publish step needed.

Notes

  • Built/tested for Gym Monster 1 only (see device note above). GM2 is untested.
  • "Free Lift" (freestyle) sessions return totals only — no per-set detail. Programs do.
  • library.json is a committed snapshot of the exercise catalog for convenience; regenerate it anytime with speediance-cli library.
  • main is PR-protected; changes land via pull request.

Project layout

A thin cmd/ entrypoint over a closed internal/ tree (the gh pattern):

  • cmd/speediance-cli/ — entrypoint (main); maps errors to exit codes
  • internal/api/ — HTTP client: frozen headers, auth, token refresh, endpoints
  • internal/config/ — config + credential discovery (env / file / flags)
  • internal/auth/.token.json cache (0600)
  • internal/template/ — exercise library + build/create programs from a plan
  • internal/workout/ — workout/session models, record parsing, timestamp handling
  • internal/sheet/ — (optional) Markdown week-sheet writer + fuzzy matching
  • internal/cli/ — Cobra command wiring (one file per command)
  • SKILL.md — ClawHub marketplace skill definition
  • library.json — committed catalog snapshot (Gym Monster 1)
  • plans/ — personal workout plan JSONs (gitignored)

Development

go build ./...
go test -race ./...
golangci-lint run ./...

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
speediance-cli command
Command speediance-cli is a drop-in CLI for the (unofficial) Speediance / Gym Monster cloud API.
Command speediance-cli is a drop-in CLI for the (unofficial) Speediance / Gym Monster cloud API.
internal
api
Package api is the single patch point for the (unofficial) Speediance cloud API.
Package api is the single patch point for the (unofficial) Speediance cloud API.
auth
Package auth manages the on-disk token cache (.token.json).
Package auth manages the on-disk token cache (.token.json).
cli
Package cli wires the cobra command tree.
Package cli wires the cobra command tree.
config
Package config resolves runtime configuration and credential discovery.
Package config resolves runtime configuration and credential discovery.
sheet
Package sheet writes a completed Speediance session into a Markdown WEEKS/Week-XX.md checklist.
Package sheet writes a completed Speediance session into a Markdown WEEKS/Week-XX.md checklist.
template
Package template builds the customTrainingTemplate POST body and fetches the exercise library.
Package template builds the customTrainingTemplate POST body and fetches the exercise library.
version
Package version exposes build metadata for the CLI.
Package version exposes build metadata for the CLI.
workout
Package workout models Speediance session data and the exact JSON shapes the CLI emits.
Package workout models Speediance session data and the exact JSON shapes the CLI emits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL