tensr — training data and agent tools

Own your training data from the terminal. Tensr stores workouts, sessions, and goals in local SQLite, exchanges files with other peers, and exposes the same services to assistants over MCP. It is a pure-Go, static binary. Local commands work offline without an account.

Its sister CLI, workoutmd, validates, formats, and converts portable routine files. Install either or both. Tensr compiles the same workout parser and validator; it does not need another executable.

Install

The release pipeline publishes macOS and Linux binaries for arm64 and amd64. After the first Tensr release is published, install with its separate script:

curl -fsSL https://dl.tensr.fitness/install-tensr.sh | sh

Both this installer and the workoutmd installeroffer to install the missing sister CLI when a terminal is available. Downloads are verified with SHA-256 and installed atomically into ~/.local/bin(fallback: /usr/local/bin). Prompts read the terminal, so a piped script works. Unattended installs skip the prompt:

# Install only Tensr, or explicitly include the missing companion:
curl -fsSL https://dl.tensr.fitness/install-tensr.sh | sh -s -- --no-companion
curl -fsSL https://dl.tensr.fitness/install-tensr.sh | sh -s -- --with-companion

tensr upgrade --check     # compare with the stable release manifest
tensr upgrade             # offer [y/N] to download and reinstall
tensr upgrade --yes       # explicit unattended approval

Upgrade checks https://dl.tensr.fitness/tensr/latest.json, downloads the newer platform build from its version directory, verifies SHA-256, and replaces the executable atomically. update is an alias.--check downloads no binary. Each CLI has its own manifest and checksums.

Start locally

tensr init
tensr import routine.workout.md
tensr workouts list
tensr workouts get my-routine
tensr workouts set my-routine routine.workout.md --expected-version 0
tensr query 'SELECT id, title, current_version FROM routine'
printf 'SELECT * FROM session LIMIT 10' | tensr query
tensr export -o training.tensr.json
tensr backup recovery.sqlite
tensr doctor

Use --db PATH and --workspace ID before or after the command. Defaults are ~/.local/share/tensr/tensr.sqlite and workspacedefault; XDG data/config directories are respected. Data output is JSON. Diagnostics go to stderr; exit status is 0 for success, 1 for a failed integrity check, and 2 for a usage, I/O, or service error.

Commands

CommandBehavior
init / status / doctorCreate the database; inspect identity and schema; check integrity.
workouts list|get|set|delSaved routines. Set takes an ID and workout.md file; get includes versions; del archives.
sessions list|get|set|delPerformed training. Set takes a complete JSON row; del removes the session and children with tombstones.
goals list|get|set|delTraining goals. Set takes a complete JSON row; del archives.
movements list|search|getInspect workspace custom movements.
schema / queryDiscover real tables; run one read-only SELECT, WITH, or EXPLAIN statement from arguments or stdin.
import / exportMerge/export private v1 sync JSON; import workout.md with stable identity.
backup / restoreConsistent SQLite snapshot; restore requires --yes and creates a recovery copy.
config get|set|list|unsetSave db/workspace defaults.
mcp serveForeground stdio tools for an assistant.
upgrade / version / help / manUpdate, inspect the build, and read usage.

Lists accept --limit 1..1000 --offset N and use stable ID ordering; archived records stay visible. Every local domain mutation captures its site identity and logical clock in the change journal atomically. Workout saves retain versions and are idempotent for identical content. Use--expected-version N to guard against concurrent edits; 0 requires a new workout. Use schema before preparing session/goal JSON.

Exchange and recovery

export contains the complete private sync journal, including tombstones and recording bytes. It is intended for your own peers. Import preserves IDs, authors, provenance, routine versions, and the existing v1 merge semantics; it does not replace the database. Reimporting the same workout.md preserves its frontmatter ID, or uses a content-derived ID when none is supplied.

backup FILE makes a consistent full SQLite snapshot and refuses overwrite. restore FILE --yes validates compatibility and integrity, saves a recovery copy beside the database, then restores transactionally while retaining the receiving site's identity. Unsupported schema versions are refused. Network sync and compressed link/QR exchange are later additions.

Connect an assistant through MCP

Initialize a database, then configure your MCP client to launch Tensr with absolute paths:

{
  "mcpServers": {
    "tensr": {
      "command": "/absolute/path/to/tensr",
      "args": ["--db", "/absolute/path/to/training.sqlite", "mcp", "serve"]
    }
  }
}

The client owns the process; EOF or Ctrl-C stops it. stdout contains only protocol messages. Tools discover the schema, read/query records, validate workout.md, and explicitly save or delete records using the same Go services as the CLI. Tool annotations distinguish reads, mutations, and destructive actions. Your client controls tool approval. See thecoach skill for the assistant workflow.

Account services

tensr login opens a browser authorization page and prints a matching code. Sign in with a passkey, confirm the code, then chooseAuthorize or Decline. Login works before you create a training database.

tensr login
tensr auth status
tensr auth status --check
tensr logout

For SSH, use login --device-flow --no-browser and open the printed link on another device. Scripts and --json must explicitly opt into waiting with --device-flow. Use --reauth to replace a connection. Credentials use your OS credential store; headless systems can explicitly select --credential-store=file for a private credentials file. Account settings let you revoke each connection.

Cloud backups are off by default. login --backups --db training.sqliterequests backup permission for an existing data copy. The browser option starts unchecked. This release records permission only; login uploads no training data, and a CLI cloud upload command is still to come.backup FILE creates a local snapshot.

Login requires API authorization support to be enabled after its migrations. A server awaiting rollout returns cli_auth_unavailable. Hosted coach/task submission remains unavailable. Local tools and use of your own assistant remain available without login.

Build from source

cd cli/tensr
CGO_ENABLED=0 go build -o /tmp/tensr .
go test ./...

Use the Go version in go.mod. Tests cover the shared app sync scenarios, schema parity, local writes and exchange, MCP, verified upgrades, and both installers with real terminal prompts.