A command-line interface for interacting with Lichess.org's API to make it easy to script your way around Lichess.
cargo install lictlBefore using commands that require authentication, you'll need to log into Lichess:
lictl login
# Verify your authentication
lictl whoami# 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># Get broadcast round details
lictl broadcast-rounds get <round-id># Export chapter PGN for a study
lictl studies export <study-id> <chapter-id># Import PGN into a study
lictl studies import <study-id> "<pgn-content>"# Make GET requests to any Lichess API endpoint
lictl req get /account
lictl req get /broadcast page=2 nb=10The project includes helpful scripts in the scripts/ directory:
Copies a broadcast's games into a study:
./scripts/copy-broadcast-to-study.sh <round-id> <study-id># Run tests
cargo test
# Build in debug mode
cargo build
# Build in release mode
cargo build --releaseThis project uses pre-commit hooks to ensure code quality. The hooks run cargo fmt and cargo clippy before each commit.
To set up the pre-commit hooks:
# Run the setup script
./.openhands/setup.sh
# Or manually install pre-commit and the hooks
pip install pre-commit
pre-commit installThe hooks will automatically run when you commit changes. You can also run them manually:
# Run all hooks on all files
pre-commit run --all-files
# Run a specific hook
pre-commit run cargo-fmt
pre-commit run cargo-clippy- Fork the repository
- Create a feature branch
- Commit your changes (pre-commit hooks will ensure code quality)
- Push to the branch
- Create a Pull Request