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

@wnsdud-jy/c2l

v0.1.6

Published

Turn a chess.com game URL into a lichess analysis URL from your terminal.

Readme

chess2lichess (c2l)

Turn a chess.com game URL into a lichess analysis URL from the terminal.

npm version node license

OverviewQuick startUsageTUInpm package notesLimits

Overview

c2l is a small CLI that converts a chess.com game URL into a lichess.org analysis link.

It runs as a native binary (Rust implementation) while providing a simple Node entry point at the package level.

[!IMPORTANT] c2l supports https://www.chess.com/game/<id> and https://www.chess.com/game/live/<id> URLs.

Key features

  • URL validation for supported chess.com/game/... links
  • PGN extraction with fallback strategies
  • PGN import via https://lichess.org/api/import
  • Structured metadata extraction from PGN headers
  • Final analysis URL output and optional actions
    • copy PGN to clipboard
    • print PGN
    • save PGN to a file
    • auto open browser
  • Interactive npm self-update prompt for npm-installed c2l when a newer package version exists
  • Interactive URL input mode and TUI mode

Quick start - npm

Install globally for shell usage:

npm install -g @wnsdud-jy/c2l

Use c2l directly:

c2l "https://www.chess.com/game/live/123456789"

Run without global install:

npx @wnsdud-jy/c2l "https://www.chess.com/game/live/123456789"

If you want a local dependency:

npm i -D @wnsdud-jy/c2l
npx c2l "https://www.chess.com/game/live/123456789"

[!TIP] npm/npx install does not require a Rust toolchain. It downloads a prebuilt binary for your platform.

Usage

Usage: c2l [OPTIONS] [URL...] [COMMAND]

Commands:
  tui   Run TUI mode
  doctor  Run environment and release checks
  help  Print this message or the help of the given subcommand(s)

Arguments:
  [URL]  chess.com game URL(s). Can be repeated for batch mode.

Options:
      --copy             Copy PGN to clipboard
      --open             Open browser
      --print-pgn        Print PGN to stdout
      --no-open          Do not open browser automatically
      --save-pgn <PATH>  Save PGN to file
      --raw-url          Print only the final URL
      --json             Print machine-readable JSON output
      --quiet            Suppress human-readable progress and summary messages
      --verbose          Show verbose progress logs
      --format <FORMAT>  Output format: text|json|csv [default: text]
      --input <PATH>     Read URLs from a file, one per line
  -h, --help             Print help
  -V, --version          Print version

Examples:

# Process one URL
c2l "https://www.chess.com/game/123456789"

# Process one live URL
c2l "https://www.chess.com/game/live/123456789"

# Process multiple URLs at once
c2l "https://www.chess.com/game/live/111" "https://www.chess.com/game/live/222" --raw-url

# Process file input and output JSON
c2l --json --input urls.txt

# Pipe URLs via stdin
printf "%s\n%s\n" "https://www.chess.com/game/live/111" "https://www.chess.com/game/live/222" | c2l --json

# Get only final URL for scripting
c2l --raw-url "https://www.chess.com/game/live/123456789"

# Save PGN and avoid opening browser
c2l --save-pgn game.pgn --no-open "https://www.chess.com/game/live/123456789"

# Interactive mode
c2l
URL> https://www.chess.com/game/live/111
URL> https://www.chess.com/game/live/222
URL> quit

[!TIP] For shell pipelines, pass --raw-url and chain output directly.

[!NOTE] When c2l is launched from the npm package in an interactive terminal, it checks the npm registry for a newer package version before processing. Script-friendly modes such as --json, --format csv, --raw-url, and quiet output skip this prompt. You can upgrade immediately, skip once, or mute the prompt for 7 days.

Text output now also includes short metadata when PGN headers are available, such as players, result, date, move count, and opening.

TUI mode

c2l tui
  • Enter: process current URL
  • c: copy PGN to clipboard
  • o: open final URL in browser
  • p: save PGN as c2l-last.pgn
  • q, Esc, or Ctrl+C: quit

npm package notes

During npm install, postinstall runs scripts/postinstall.js:

  • Resolve your platform/arch (linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64)
  • Download the matching asset from GitHub Releases
  • Verify SHA-256 via checksums file
  • Save binary to vendor/ in the package
  • Make binary executable (chmod +x) on non-Windows platforms

Supported environment variables:

  • C2L_SKIP_POSTINSTALL=1: skip download step
  • C2L_GITHUB_REPO=<owner/repo>: override release repository
  • C2L_RELEASE_TAG=<tag>: override release tag (default: v<package-version>)

bin/c2l.js simply launches the downloaded binary for your environment.

Build from source

cargo build --release
cargo test

Run Node-side tests:

npm test

Limits

  • Non-chess.com URLs are rejected.
  • Private/restricted games may fail to resolve.
  • If chess.com markup/API shape changes, extraction can break.
  • If lichess API behavior changes, final URL parsing can fail.
  • Output color in TUI depends on terminal capability.