npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kaiord/cli

v4.7.0

Published

Command-line interface for Kaiord workout file conversion

Readme

@kaiord/cli

Command-line interface for Kaiord workout file conversion. Convert workout files between FIT, KRD, TCX, and ZWO formats with ease.

Installation

Install globally using npm or pnpm:

npm install -g @kaiord/cli

or

pnpm add -g @kaiord/cli

After installation, the kaiord command will be available globally.

Usage

Convert Command

Convert workout files between different formats.

Basic Usage

kaiord convert --input workout.fit --output workout.krd

FIT to KRD

kaiord convert --input workout.fit --output workout.krd

KRD to FIT

kaiord convert --input workout.krd --output workout.fit

Batch Conversion

Convert multiple files using glob patterns:

kaiord convert --input "workouts/*.fit" --output-dir converted/

Format Override

Override automatic format detection:

kaiord convert --input data.bin --input-format fit --output workout.krd

Validate Command

Perform round-trip validation to verify data integrity.

Basic Validation

kaiord validate --input workout.fit

Custom Tolerances

Use a custom tolerance configuration file:

kaiord validate --input workout.fit --tolerance-config tolerance.json

Example tolerance.json:

{
  "time": { "absolute": 1, "unit": "seconds" },
  "power": { "absolute": 1, "percentage": 1, "unit": "watts" },
  "heartRate": { "absolute": 1, "unit": "bpm" },
  "cadence": { "absolute": 1, "unit": "rpm" }
}

Configuration File

You can create a .kaiordrc.json file to set default options. The CLI will search for this file in:

  1. Current working directory
  2. User home directory (~/.kaiordrc.json)

CLI options always take precedence over config file defaults.

Example Configuration

Create .kaiordrc.json in your project or home directory:

{
  "defaultInputFormat": "fit",
  "defaultOutputFormat": "krd",
  "defaultOutputDir": "./converted",
  "defaultToleranceConfig": "./tolerance.json",
  "verbose": false,
  "quiet": false,
  "json": false,
  "logFormat": "pretty"
}

Configuration Options

  • defaultInputFormat: Default input format (fit, krd, tcx, zwo)
  • defaultOutputFormat: Default output format (fit, krd, tcx, zwo)
  • defaultOutputDir: Default output directory for batch conversions
  • defaultToleranceConfig: Path to default tolerance configuration file
  • verbose: Enable verbose logging by default
  • quiet: Enable quiet mode by default
  • json: Enable JSON output by default
  • logFormat: Default log format (pretty or structured)

Usage with Config File

With a config file, you can simplify your commands:

# Without config file
kaiord convert --input workout.fit --output workout.krd --output-format krd

# With config file (defaultOutputFormat: "krd")
kaiord convert --input workout.fit --output workout.krd

CLI options override config defaults:

# Config has verbose: true, but --quiet overrides it
kaiord convert --input workout.fit --output workout.krd --quiet

Global Options

Verbosity Control

# Verbose output (detailed logging)
kaiord convert --input workout.fit --output workout.krd --verbose

# Quiet mode (errors only)
kaiord convert --input workout.fit --output workout.krd --quiet

Output Format

# JSON output (machine-readable)
kaiord convert --input workout.fit --output workout.krd --json

# Force pretty terminal output
kaiord convert --input workout.fit --output workout.krd --log-format pretty

# Force structured JSON logs
kaiord convert --input workout.fit --output workout.krd --log-format json

Supported Formats

  • FIT (.fit) - Garmin's binary workout file format
  • KRD (.krd) - Kaiord's canonical JSON format
  • TCX (.tcx) - Training Center XML format
  • ZWO (.zwo) - Zwift workout XML format

Plugin System (Future Enhancement)

The CLI is designed with a plugin architecture that will allow third-party developers to add support for custom workout file formats without modifying the core library. See Plugin Architecture Documentation for details on the design.

Planned Features:

  • Dynamic plugin discovery and loading
  • Type-safe plugin interface
  • Automatic format detection for plugin formats
  • Plugin configuration via .kaiordrc.json
  • Plugin management commands (kaiord plugins list, install, etc.)

Example Plugin Usage (Future):

# Install a plugin
npm install -g @kaiord/plugin-gpx

# Use plugin format
kaiord convert --input workout.gpx --output workout.krd

See Example GPX Plugin for a complete plugin implementation example.

Exit Codes

  • 0: Success
  • 1: Error (invalid arguments, file not found, parsing error, validation error)

Documentation

Main Documentation

Package-Specific Documentation

Development

# Install dependencies
pnpm install

# Build the CLI
pnpm build

# Run in development mode
pnpm dev -- convert --input workout.fit --output workout.krd

# Link for local testing
npm link
kaiord --version
npm unlink -g

Testing

Run the test suites:

# Run all tests
pnpm test

# Run unit tests only
pnpm test:unit

# Run integration tests
pnpm test:integration

# Run smoke tests
pnpm test:smoke

# Run tests in watch mode
pnpm test:watch

License

MIT - See LICENSE file for details.