zwift-log-parser 0.0.0-stage → 0.3.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 +21 -0
- package/README.md +294 -2
- package/bin/zwift-log-parser.js +5 -0
- package/dist/cli/main.js +29139 -0
- package/dist/zwift-log-parser-0.3.0.tgz +0 -0
- package/package.json +86 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Christopher J. Walker
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,295 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Zwift Log Parser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A TypeScript command-line tool for parsing and analyzing Zwift activity log files. Built with [Bun](https://bun.sh) and [React Ink](https://github.com/vadimdemedes/ink).
|
|
4
|
+
|
|
5
|
+
🌐 **Website**: <https://chrisjwalk.github.io/zwift-log-parser>
|
|
6
|
+
|
|
7
|
+
> **Looking for TrainerDX?** This project was inspired by
|
|
8
|
+
> [TrainerDX](https://trainerdx.com/) (formerly Zwiftalizer), which shut down
|
|
9
|
+
> permanently on November 30, 2026. Zwift Log Parser carries on that spirit as
|
|
10
|
+
> an open-source, self-hosted alternative — parse your logs locally for FPS
|
|
11
|
+
> analysis, route tracking, device diagnostics, and more.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- 📊 **FPS Analysis** — Visualize frame rate performance with ASCII graphs and statistics
|
|
16
|
+
- 🗺️ **Route Tracking** — Identify routes/activities with duration, distance, and elevation data
|
|
17
|
+
- 🌍 **World Sessions** — Track world changes and activity segments
|
|
18
|
+
- 💻 **System Information** — Extract GPU, CPU, RAM, resolution, and graphics settings
|
|
19
|
+
- 🎮 **Session Metadata** — View game version, launcher version, device info, and timestamps
|
|
20
|
+
- 📤 **JSON Export** — Output data as JSON for further processing
|
|
21
|
+
- 🔧 **Flexible Options** — Enable/disable specific analysis sections as needed
|
|
22
|
+
- 📁 **Interactive File Picker** — Browse and select log files if no path is provided
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
### From npm
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install -g zwift-log-parser
|
|
30
|
+
# or, with Bun:
|
|
31
|
+
bun install -g zwift-log-parser
|
|
32
|
+
|
|
33
|
+
zwift-log-parser /path/to/your/Log.txt
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Requires Node.js.
|
|
37
|
+
|
|
38
|
+
### Standalone binaries
|
|
39
|
+
|
|
40
|
+
No Node.js? Every release ships self-contained executables for Windows,
|
|
41
|
+
macOS, and Linux (x64 + arm64) — grab one from the
|
|
42
|
+
[releases page](https://github.com/chrisjwalk/zwift-log-parser/releases/latest),
|
|
43
|
+
then:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# e.g. on Linux
|
|
47
|
+
chmod +x zwift-log-parser-linux-x64
|
|
48
|
+
./zwift-log-parser-linux-x64 /path/to/your/Log.txt
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### From a GitHub Release
|
|
52
|
+
|
|
53
|
+
Every release also ships an npm package tarball attached to the release page —
|
|
54
|
+
no registry needed. Get the tarball URL from
|
|
55
|
+
<https://github.com/chrisjwalk/zwift-log-parser/releases/latest>, then:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# replace v0.0.2 with the release you want
|
|
59
|
+
npm install -g https://github.com/chrisjwalk/zwift-log-parser/releases/download/v0.0.2/zwift-log-parser-0.0.2.tgz
|
|
60
|
+
zwift-log-parser /path/to/your/Log.txt
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Local Development
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git clone https://github.com/chrisjwalk/zwift-log-parser.git
|
|
67
|
+
cd zwift-log-parser
|
|
68
|
+
bun install
|
|
69
|
+
bun run build
|
|
70
|
+
npm link # makes the zwift-log-parser command available globally
|
|
71
|
+
zwift-log-parser /path/to/your/Log.txt
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
### Basic Usage
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
zwift-log-parser /path/to/Log.txt
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
If no file path is provided, an interactive file picker will launch:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
zwift-log-parser
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Command-Line Options
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
zwift-log-parser [logfile] [options]
|
|
92
|
+
|
|
93
|
+
Arguments:
|
|
94
|
+
logfile Path to Zwift log file to parse
|
|
95
|
+
|
|
96
|
+
Options:
|
|
97
|
+
-V, --version Output the version number
|
|
98
|
+
--no-fps Skip FPS analysis and graphs
|
|
99
|
+
--no-routes Skip route/activity information
|
|
100
|
+
--no-metadata Skip session and system metadata
|
|
101
|
+
--json Output results as JSON instead of formatted display
|
|
102
|
+
-h, --help Display help information
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Examples
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Analyze everything (default)
|
|
109
|
+
zwift-log-parser ~/Documents/Zwift/Logs/Log.txt
|
|
110
|
+
|
|
111
|
+
# Routes and metadata only, no FPS graph
|
|
112
|
+
zwift-log-parser ~/Documents/Zwift/Logs/Log.txt --no-fps
|
|
113
|
+
|
|
114
|
+
# Export to JSON for further processing
|
|
115
|
+
zwift-log-parser ~/Documents/Zwift/Logs/Log.txt --json > output.json
|
|
116
|
+
|
|
117
|
+
# FPS analysis only
|
|
118
|
+
zwift-log-parser ~/Documents/Zwift/Logs/Log.txt --no-routes --no-metadata
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Sample Output
|
|
122
|
+
|
|
123
|
+
<details>
|
|
124
|
+
<summary>📸 Click to see a screenshot of the full output</summary>
|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+
</details>
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
🚴 Zwift Log Parser v0.0.2
|
|
132
|
+
|
|
133
|
+
Session Information
|
|
134
|
+
Log Date/Time: 21:09:07 2026-01-08
|
|
135
|
+
Game Version: 1.104.4(157262) rc/1.104.4
|
|
136
|
+
Device: PC
|
|
137
|
+
|
|
138
|
+
System Information
|
|
139
|
+
GPU: NVIDIA GeForce RTX 5060/PCIe/SSE2
|
|
140
|
+
Driver: 4.6.0 NVIDIA 591.74
|
|
141
|
+
CPU: 12th Gen Intel(R) Core(TM) i5-12600KF
|
|
142
|
+
RAM: 64GB
|
|
143
|
+
Resolution: 1920x1080
|
|
144
|
+
Graphics: ultra
|
|
145
|
+
|
|
146
|
+
Worlds
|
|
147
|
+
Watopia
|
|
148
|
+
• Triple Flat Loops
|
|
149
|
+
• The Big Ring
|
|
150
|
+
|
|
151
|
+
FPS Analysis
|
|
152
|
+
|
|
153
|
+
📍 Watopia
|
|
154
|
+
|
|
155
|
+
126.00 ┤
|
|
156
|
+
121.33 ┤ ╭───╮ ╭──────╮
|
|
157
|
+
116.67 ┼──╯ │ ╭╮ │ ╰╮
|
|
158
|
+
...
|
|
159
|
+
|
|
160
|
+
Time: 1h 48m 52s | Average: 99.76 | Min: 61.73 | Max: 120.97
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Development
|
|
164
|
+
|
|
165
|
+
### Project Structure
|
|
166
|
+
|
|
167
|
+
This is a Bun workspace monorepo with two packages:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
core/ # Parser library (@zwift-log-parser/core)
|
|
171
|
+
├── src/
|
|
172
|
+
│ ├── index.ts # Library entry point
|
|
173
|
+
│ └── lib/
|
|
174
|
+
│ ├── parser.ts # ZwiftLogParser class
|
|
175
|
+
│ ├── file-picker.ts # Interactive file picker
|
|
176
|
+
│ └── __fixtures__/ # Test data (real log files)
|
|
177
|
+
└── package.json
|
|
178
|
+
|
|
179
|
+
cli/ # CLI application
|
|
180
|
+
├── src/
|
|
181
|
+
│ ├── main.tsx # Entry point — argument parsing
|
|
182
|
+
│ ├── App.tsx # Root React Ink component
|
|
183
|
+
│ └── components/ # Individual UI panel components
|
|
184
|
+
│ ├── Banner.tsx
|
|
185
|
+
│ ├── MetadataPanel.tsx
|
|
186
|
+
│ ├── WorldsPanel.tsx
|
|
187
|
+
│ ├── FpsPanel.tsx
|
|
188
|
+
│ └── Section.tsx
|
|
189
|
+
└── package.json
|
|
190
|
+
|
|
191
|
+
scripts/
|
|
192
|
+
└── build.ts # Bun build script (bundles CLI via esbuild)
|
|
193
|
+
|
|
194
|
+
bin/
|
|
195
|
+
└── zwift-log-parser.js # npm bin wrapper
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Available Commands
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
bun install # Install dependencies
|
|
202
|
+
bun run build # Build CLI bundle to dist/
|
|
203
|
+
bun run dev # Run CLI directly with Bun (no build needed)
|
|
204
|
+
bun start # Run the built CLI from dist/
|
|
205
|
+
bun test # Run all tests
|
|
206
|
+
bun lint # Lint all source files with ESLint
|
|
207
|
+
bun run clean # Remove build artifacts
|
|
208
|
+
bun run pack # Create npm tarball in dist/
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Cutting a Release
|
|
212
|
+
|
|
213
|
+
1. Bump `version` in `package.json` and merge to `main`
|
|
214
|
+
2. Go to **Actions → Release → Run workflow**, leave the branch as `main`, and
|
|
215
|
+
run it — the workflow reads the version from `package.json`, runs lint +
|
|
216
|
+
tests, builds, smoke-tests the tarball, publishes to npm, and attaches
|
|
217
|
+
`zwift-log-parser-<version>.tgz` to a GitHub Release
|
|
218
|
+
|
|
219
|
+
Tag pushes still work as an alternative: `git tag v0.0.2 && git push origin v0.0.2`
|
|
220
|
+
(the tag must match the `package.json` version).
|
|
221
|
+
|
|
222
|
+
### Development Workflow
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# 1. Install dependencies
|
|
226
|
+
bun install
|
|
227
|
+
|
|
228
|
+
# 2. Run directly without building (fastest iteration)
|
|
229
|
+
bun run dev /path/to/Log.txt
|
|
230
|
+
|
|
231
|
+
# 3. Build for production
|
|
232
|
+
bun run build
|
|
233
|
+
|
|
234
|
+
# 4. Test the built bundle
|
|
235
|
+
bun start /path/to/Log.txt
|
|
236
|
+
|
|
237
|
+
# 5. Run tests
|
|
238
|
+
bun test
|
|
239
|
+
|
|
240
|
+
# 6. Lint
|
|
241
|
+
bun lint
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Publishing to npm
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
# Bump version, build, and publish
|
|
248
|
+
npm version patch
|
|
249
|
+
bun run build
|
|
250
|
+
npm publish --access public
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
To test the package locally before publishing:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
bun run pack
|
|
257
|
+
npm install -g dist/zwift-log-parser-<version>.tgz
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Technology Stack
|
|
261
|
+
|
|
262
|
+
- **Runtime**: [Bun](https://bun.sh)
|
|
263
|
+
- **Language**: TypeScript 6.0
|
|
264
|
+
- **UI**: [React Ink](https://github.com/vadimdemedes/ink) 7 (terminal UI, React 19)
|
|
265
|
+
- **Bundler**: esbuild (via Bun build API)
|
|
266
|
+
- **CLI Arg Parsing**: Commander.js
|
|
267
|
+
- **FPS Graphs**: asciichart
|
|
268
|
+
- **File Picker**: @inquirer/prompts
|
|
269
|
+
- **Testing**: Vitest
|
|
270
|
+
- **Linting**: ESLint 10 + typescript-eslint
|
|
271
|
+
|
|
272
|
+
## Architecture
|
|
273
|
+
|
|
274
|
+
### Core Library (`@zwift-log-parser/core`)
|
|
275
|
+
|
|
276
|
+
Provides the `ZwiftLogParser` class and `pickFile()` utility:
|
|
277
|
+
|
|
278
|
+
- `parseMetadata(content)` — session and system info
|
|
279
|
+
- `parseRouteSessions(content)` — routes and world sessions with timing
|
|
280
|
+
- `parseFPSLines(content)` — raw FPS sample array
|
|
281
|
+
- `parseFpsPerWorld(content)` — FPS data grouped by world, with timestamps
|
|
282
|
+
- `calculateFpsStats(fps)` — average, min, max statistics
|
|
283
|
+
- `downsampleData(data, width)` — reduce data points for graph rendering
|
|
284
|
+
|
|
285
|
+
### CLI Application
|
|
286
|
+
|
|
287
|
+
Built with React Ink — the terminal output is a rendered React component tree. Commander.js handles argument and option parsing before React renders.
|
|
288
|
+
|
|
289
|
+
## Contributing
|
|
290
|
+
|
|
291
|
+
Contributions are welcome! Please feel free to submit issues or pull requests.
|
|
292
|
+
|
|
293
|
+
## License
|
|
294
|
+
|
|
295
|
+
MIT
|