#lichess #pgn #chess #authentication

app lictl

A command line interface for scripting Lichess

3 unstable releases

Uses new Rust 2024

new 0.2.1 May 2, 2025
0.1.1 Apr 19, 2025
0.1.0 Apr 19, 2025

#393 in Game dev

Download history 17/week @ 2025-04-13 255/week @ 2025-04-20 101/week @ 2025-04-27

373 downloads per month

AGPL-3.0-only

24KB
498 lines

lictl - Lichess CLI Tool

A command-line interface for interacting with Lichess.org's API to make it easy to script your way around Lichess.

Installation

cargo install lictl

Authentication

Before using commands that require authentication, you'll need to log into Lichess:

lictl login

# Verify your authentication
lictl whoami

Commands

Broadcasts

# Get broadcast details by ID
lictl broadcasts get --by-id <broadcast-id>

# Get broadcast details by round ID
lictl broadcasts get --by-round <round-id>

# Export broadcast PGN
lictl broadcasts export <broadcast-id>

Broadcast Rounds

# Get broadcast round details
lictl broadcast-rounds get <round-id>

Studies

# Import PGN into a study
lictl studies import <study-id> "<pgn-content>"

Generic API Requests

# Make GET requests to any Lichess API endpoint
lictl req get /account
lictl req get /broadcast page=2 nb=10

Scripts

The project includes helpful scripts in the scripts/ directory:

copy-broadcast-to-study.sh

Copies a broadcast's games into a study:

./scripts/copy-broadcast-to-study.sh <round-id> <study-id>

Development

# Run tests
cargo test

# Build in debug mode
cargo build

# Build in release mode
cargo build --release

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Dependencies

~13–24MB
~340K SLoC