trainerroad-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 Quinn Sprouse
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # Unofficial TrainerRoad CLI
2
+
3
+ > Unofficial tool. Not affiliated with or endorsed by TrainerRoad.
4
+
5
+ CLI to fetch TrainerRoad data for your account, including:
6
+
7
+ - future workouts
8
+ - past/completed workouts
9
+ - today view
10
+ - events and annotations
11
+ - progression levels
12
+ - plans and phases
13
+ - FTP and FTP prediction
14
+ - power ranking and power records
15
+ - weight history
16
+
17
+ ## Install
18
+
19
+ ### From GitHub
20
+
21
+ ```bash
22
+ npx --yes github:quinnsprouse/trainerroad-cli help
23
+ ```
24
+
25
+ ### Local development
26
+
27
+ ```bash
28
+ git clone https://github.com/quinnsprouse/trainerroad-cli.git
29
+ cd trainerroad-cli
30
+ npm install
31
+ npm exec --yes trainerroad-cli -- help
32
+ ```
33
+
34
+ ### Global
35
+
36
+ ```bash
37
+ npm install -g github:quinnsprouse/trainerroad-cli
38
+ trainerroad-cli help
39
+ ```
40
+
41
+ ## Quickstart
42
+
43
+ 1. Authenticate
44
+
45
+ ```bash
46
+ trainerroad-cli login --username <username> --password-stdin
47
+ ```
48
+
49
+ 2. Query data
50
+
51
+ ```bash
52
+ trainerroad-cli whoami --json
53
+ trainerroad-cli today --json
54
+ trainerroad-cli future --days 30 --json
55
+ trainerroad-cli past --days 30 --json
56
+ trainerroad-cli plan --view current --json
57
+ trainerroad-cli levels --json
58
+ trainerroad-cli ftp --json
59
+ ```
60
+
61
+ 3. Discover all commands
62
+
63
+ ```bash
64
+ trainerroad-cli help
65
+ trainerroad-cli help future --json
66
+ trainerroad-cli discover --level 3 --json
67
+ ```
68
+
69
+ ## Modes
70
+
71
+ - `private` (authenticated): full account data
72
+ - `public` (username-based): limited day-level data
73
+
74
+ Use `--target <username>` and/or `--public` for public mode queries.
75
+
76
+ ## Output
77
+
78
+ - default: pretty JSON
79
+ - `--json`: structured JSON
80
+ - `--jsonl`: one record per line
81
+ - `--fields a,b,c`: project record fields
82
+ - `--records-only`: lighter record payloads
83
+
84
+ ## Security
85
+
86
+ - Session cookies are stored in `.trainerroad/session.json`.
87
+ - Treat this file as sensitive and do not commit it.
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "trainerroad-cli",
3
+ "version": "0.1.0",
4
+ "description": "Unofficial CLI for authenticating with TrainerRoad and querying timeline/workout data",
5
+ "main": "src/cli.mjs",
6
+ "bin": {
7
+ "trainerroad-cli": "src/cli.mjs",
8
+ "trcli": "src/cli.mjs"
9
+ },
10
+ "files": [
11
+ "src",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "scripts": {
16
+ "recon": "node scripts/recon.mjs",
17
+ "cli": "node src/cli.mjs",
18
+ "help": "node src/cli.mjs help",
19
+ "discover": "node src/cli.mjs discover",
20
+ "capabilities": "node src/cli.mjs capabilities",
21
+ "login": "node src/cli.mjs login",
22
+ "whoami": "node src/cli.mjs whoami",
23
+ "timeline": "node src/cli.mjs timeline",
24
+ "events": "node src/cli.mjs events",
25
+ "annotations": "node src/cli.mjs annotations",
26
+ "levels": "node src/cli.mjs levels",
27
+ "plan": "node src/cli.mjs plan",
28
+ "weight-history": "node src/cli.mjs weight-history",
29
+ "today": "node src/cli.mjs today",
30
+ "future": "node src/cli.mjs future",
31
+ "past": "node src/cli.mjs past",
32
+ "ftp": "node src/cli.mjs ftp",
33
+ "ftp-prediction": "node src/cli.mjs ftp-prediction",
34
+ "power-ranking": "node src/cli.mjs power-ranking",
35
+ "power-records": "node src/cli.mjs power-records",
36
+ "logout": "node src/cli.mjs logout"
37
+ },
38
+ "keywords": [
39
+ "trainerroad",
40
+ "cli",
41
+ "unofficial"
42
+ ],
43
+ "author": "",
44
+ "license": "ISC",
45
+ "engines": {
46
+ "node": ">=20.0.0"
47
+ },
48
+ "type": "module",
49
+ "dependencies": {
50
+ "playwright": "^1.58.2"
51
+ }
52
+ }