A powerful TypeScript command-line tool for parsing and analyzing Zwift activity log files. Extract session metadata, system information, route/world details, and visualize FPS performance over time.
- ๐ FPS Analysis - Visualize frame rate performance with ASCII graphs and statistics
- ๐บ๏ธ Route Tracking - Identify routes/activities with duration, distance, and elevation data
- ๐ World Sessions - Track world changes and activity segments
- ๐ป System Information - Extract GPU, CPU, RAM, resolution, and graphics settings
- ๐ฎ Session Metadata - View game version, launcher version, device info, and timestamps
- ๐จ Color-Coded Output - Easy-to-read console output with syntax highlighting
- ๐ค JSON Export - Output data as JSON for further processing
- ๐ง Flexible Options - Enable/disable specific analysis sections as needed
- ๐ Interactive File Picker - Browse and select log files if no path provided
npm install -g zwift-log-parser
zwift-log-parser /path/to/your/logfile.loggit clone https://github.com/chrisjwalk/zwift-log-parser.git
cd zwift-log-parser
npm install
npm run build
npm link
zwift-log-parser /path/to/your/logfile.logzwift-log-parser /path/to/Log.txtIf no file path is provided, an interactive file picker will appear:
zwift-log-parserzwift-log-parser [logfile] [options]
Arguments:
logfile Path to Zwift log file to parse
Options:
-V, --version Output the version number
--no-fps Skip FPS analysis and graphs
--no-routes Skip route/activity information
--no-metadata Skip session and system metadata
--json Output results as JSON instead of formatted text
-h, --help Display help information# Analyze everything (default)
zwift-log-parser ~/Documents/Zwift/Logs/Log.txt
# Only show routes and metadata, skip FPS
zwift-log-parser ~/Documents/Zwift/Logs/Log.txt --no-fps
# Export to JSON for further processing
zwift-log-parser ~/Documents/Zwift/Logs/Log.txt --json > output.json
# Only show FPS analysis
zwift-log-parser ~/Documents/Zwift/Logs/Log.txt --no-routes --no-metadataโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Session Information
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Log Time: 20:34:51 2024-10-27
๐ฎ Game Version: 1.71.0 (138908)
๐ฑ Device: Windows (x64)
๐ Launcher: 2.4.1 (48)
๐ป System Configuration
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Routes & Activities
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Watopia
๐ Volcano Circuit (2 laps) โ 23:45 (14.2 km, 168 m)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
FPS Analysis (1,425 samples)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
60.00 โค โญโโโโฎ โญโโโฎ โญโโฎ
55.00 โคโโโฏ โฐโโโฏ โฐโโโโโโฏ โฐโโโ
50.00 โค
45.00 โค
40.00 โค
โโโโโโโโโโโโโโโโโโโโโโโโโโ
Average: 57.3 fps | Min: 45.2 fps | Max: 60.0 fps
This is an Nx monorepo with two projects:
core/ # Parser library (@zwift-log-parser/core)
โโโ src/
โ โโโ index.ts # Library entry point
โ โโโ lib/
โ โโโ parser.ts # ZwiftLogParser class
โ โโโ file-picker.ts # Interactive file picker
โโโ project.json # Nx project configuration
cli/ # CLI application
โโโ src/
โ โโโ main.ts # CLI entry point with Commander.js
โโโ project.json # Nx project configuration
bin/
โโโ zwift-log-parser.js # Global CLI wrapper
npm install # Install dependencies
npm run build # Build all projects (core + cli)
npm start # Run the built CLI application
npm run dev # Watch mode - rebuilds on changes
npm run zwift-log-parser # Run CLI without building (uses tsx)
npm test # Run all tests with Vitest
npm run lint # Lint all projects with ESLint
npm run clean # Remove build artifacts
npm run pack # Create npm package tarballnpx nx run core:build # Build core library only
npx nx run cli:build # Build CLI only
npx nx run core:test # Test core library
npx nx run cli:test # Test CLI
npx nx run core:lint # Lint core library
npx nx run cli:lint # Lint CLI
npx nx graph # View project dependency graph# 1. Install dependencies
npm install
# 2. Run without building (fastest for development)
npm run zwift-log-parser -- /path/to/logfile.log
# 3. Build for production
npm run build
# 4. Test the built version
npm start -- /path/to/logfile.log
# 5. Run tests
npm test
# 6. Lint code
npm run lint- Language: TypeScript 5.9
- Build System: Nx 22.3.3 (monorepo orchestration)
- Runtime: Node.js (ESM modules)
- Bundler: esbuild (CLI), tsc (library)
- Testing: Vitest 4.0
- Linting: ESLint 9.8
- CLI Framework: Commander.js 14.0
- UI Libraries:
- chalk 5.3 (colored output)
- asciichart 1.5 (FPS graphs)
- @inquirer/prompts 8.2 (file picker)
The core library provides:
ZwiftLogParserclass - Main parser with methods for extracting metadata, FPS data, routes, and worldspickFile()function - Interactive file picker for selecting log files- TypeScript types and interfaces for all parsed data structures
The CLI application:
- Uses Commander.js for argument parsing and help generation
- Provides formatted, color-coded console output
- Supports JSON export for programmatic use
- Imports and uses the core library for all parsing logic
Contributions are welcome! Please feel free to submit issues or pull requests.
MIT
- Type Checking: Strict mode enabled
- Parse Zwift activity log files
- Extract and analyze activity data
- Console-based interface
When you're ready to publish to the npm registry (ensure the package name is unique):
# bump version, build, and publish
npm version patch
npm publish --access publicIf you want to test the package locally before publishing, use npm pack and then install via npm install ./zwift-log-parser-<version>.tgz in a temporary project (no global permissions required).
Feel free to extend the parser with additional features and log format support.
MIT