1.0.0 • Published 5 years ago
lichess-tournament-creator v1.0.0
Lichess Tournament Creator
CLI tool to create Lichess chess tournaments, built using NodeJS.
Features
- Quickly creating a single Lichess tournament (Arena or Swiss format)
- Bulk creating a set of defined tournaments in a configuration file
Installing
Using npm:
$ npm i -g lichess-tournament-creatorUsage
$ lichess-tournament-creator <type> [...params]type:arena: create Arena format tournamentname: tournament namedate: tournament date, in 'YYYY-MM-DD hh:mm:ss' formattournament_duration: tournament duration, in minutesmatch_duration: match duration, in minutesmatch_increment: match increment per move, in secondsauth_token: lichess API authorization token
arena: create Swiss format tournamentname: tournament nameteam_id: team identification stringdate: tournament date, in 'YYYY-MM-DD hh:mm:ss' formatnum_rounds: tournament number of roundsmatch_duration: match duration, in minutesmatch_increment: match increment per move, in secondsauth_token: lichess API authorization token
file: create a set of tournaments via configuration filefile_name: JSON file name (format explained below)
Examples
$ lichess-tournament-creator arena "First anual chess meetup" "2021-01-01 16:30:00" 80 3 2 authtokenxpto123$ lichess-tournament-creator swiss "Swiss-cheese open" switzerland-chess-club "2021-05-20 15:10:00" 7 5 3 authtokenxpto123$ lichess-tournament-creator file my_tournaments.jsonJSON tournaments file format
The JSON tournaments input file should follow the following format:
{
"auth_token": "authtokenxpto123", // lichess API authorization token, used in all requests
"tournaments": [
{
"name": "First anual chess meetup",
"type": "arena",
"date": "2021-01-01 16:30:00",
"tournament_duration": 80,
"match": {
"duration": 3,
"increment": 2
}
},
{
"name": "Swiss-cheese open",
"type": "swiss",
"team_id": "switzerland-chess-club",
"date": "2021-05-20 15:10:00",
"num_rounds": 7,
"match": {
"duration": 5,
"increment": 3
}
}
]
}Usage considerations
- The Lichess API only allows a limit of tournaments created per user, per day (12 public tournaments or 24 private tournaments)
- The generated authorization should feature permission for tournament creating
- In order to create a swiss format tournament for a team, the user must be an admin of the team (to have the required permissions)
Tests
To run the test suite, install the project's dependencies and run npm test:
$ npm install
$ npm testTo run mutation tests:
$ npm run test:mutationFuture work
- Allows public/private tournament specification, along with other tournament-tweaking options that are not available at the moment
- Improve error lichess API error handling, displaying it in a more user-friendly format
License
1.0.0
5 years ago