Chess Opening Trainer ♟️

AnkiWeb addon 705507113

Imports chess PGN game collections into Anki decks, creating opening-repertoire flashcards with board diagrams, annotations, and nested variations, while allowing re-imports without losing learning progress.
AI-generated summary; may contain mistakes.

card-creationimport

Open on AnkiWeb GitHub Forum topic Find alternatives

AnkiWeb

Votes
12 (👍 12 · 👎 0)
Updated
2026-06-15
Anki versions
25.09~
License
WTFPL (from the license file in the package)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
CSS, Python, JSON, JavaScript, CSV, HTML, YAML
Description language
en

Maintenance

active

  • Last update or commit: 2026-08-31 (62 days before the snapshot).
  • Test files: 1.
  • GitHub Actions workflows: 1.
  • Commits in the last year: 13.
  • Issues: 10 open, 17 closed.
  • Pull requests: 1 open, 7 merged.
  • Median first response: 166 hours (5 answered issues and pull requests).
  • Outside pull requests: 67% of 3 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.125.09+2026-06-15
History across monthly snapshots

Loading…

Similar addons

Anki Chess Companion Addon

Automatically checks weekly for and installs updates to chess note templates, exposes an API for added template functionality, and saves configuration options to templates.

card-templatesbackup-maintenance

8 votes 68% approval 👍 8 · 👎 0 ⭐ 189 Anki 25.09.4~ Updated 2026-05-16
Chess FEN Visualizer

Renders chess positions written in FEN notation within [fen] tags on Anki cards as inline SVG boards, with configurable size, square colors, and coordinate display.

formatting

2 votes 34% approval 👍 2 · 👎 0 ⭐ 2 Anki 2.1.54~ Updated 2023-08-20

Description

This extension creates an Anki deck from a collection of chess games in PGN format.

Quickstart

To study an opening repertoire do this:

  1. Install the add-on.
  2. Create one or more studies on Lichess and export as PGN.
  3. Import it into Anki with Tools -> Chess Opening Trainer
  4. Study

PGNs imported for white should contain only white moves that you want to play and black moves that you want to be prepared against. For black do the same but with colours swapped.

Other Features

Update Repertoire

You can edit the studies/PGN files and re-import them without losing any learning progress. A new card is only created if a new position for the selected colour is added. Otherwise, the existing card is updated only.

Board Diagrams

All notes contain a graphical board representation of the position in question on both sides of the notes.

You can also add comments, annotations like "?" or "??", or lines, arrows, and circles. They are only displayed on the answer side of the card.

Variations

PGN files can contain multiple games and each game can be arbitrarily nested. The add-on uses all games and all variations and creates cards for them all.

Translations

The add-on is currently available in these languages:

  • (American) English
  • (British/Australian) English
  • German

Please get in touch with the author if you want to contribute a new translation!

More Information

See the github page for more information!

There is a also a blog post that describes the add-on and its concept in great detail:

Feedback

Please use the issue tracker on GitHub for bug reports or email me directly.

You can rate the add-on below or give it a star on its GitHub page if you like it.

Changelog

This project uses Semantic Versioning.

1.1.0 - 2026-06-15

  • add "Open in Lichess link" (GitHub issue #28 and PR #29)

1.0.3 - 2024-07-23

  • fix GitHub issue #23 (ensure import dialog fits screen)

1.0.2 - 2024-07-05

  • fix GitHub issue #21 which could make some combinations of colour and deck no longer selectable

1.0.1 - 2024-07-04

  • fix a crash, when decks were deleted (GitHub issue #15)
  • allow custom start position (GitHub issue #16)
  • added Bulgarian translation

1.0.0 - 2024-06-12

  • allow multiple imports per colour (thanks to Norbert Hies for the suggestion)
  • validate the configuration on load against the JSON schema

0.1.2 - 2023-12-12

  • update deck overview after import
  • PGN files must now be in UTF-8

0.1.1 - 2023-12-01

  • minor fixes

0.1.0 - 2023-11-21

Initial version.

README

Anki Opening Trainer

This is the source code repository for the Anki-add-on "Chess Opening Trainer". Anki is a popular, open-source flashcard application. The add-on takes a collection of chess games and creates flashcards from it, helping you in building up an opening repertoire.

How It Works

You should have two decks, one deck for playing the opening with the white pieces, one for playing with black. I have a structure like the following

  • Chess
  • Chess::Opening
  • Chess::Opening::White
  • Chess::Opening::Black

If you select Chess::Opening for studying, you will study playing with white and black in parallel.

You import one or more collections of games in Portable Game Notation (PGN) format, and specify whether it is contains an opening repertoire for white or for black. If you specify white, all black moves are considered a question, and all white replies found in the collection are considered correct answers.

That differs from traditional opening libraries where the moves for both black and white are considered playable moves. But when you study an opening, you should also remember how to reply to non-optimal moves of your opponent. Therefore, it makes sense that you also include bad moves or blunders for the other side.

It is also important that you reserve one Anki deck exclusively for one collection of games. When you import that collection again, the deck is synchronized with the games in that collection. Modified lines are updated, and flashcards (called "notes" in Anki) that are no longer contained in the collection are deleted.

Usage

When you open Anki, you will find a new menu entry Tools -> Chess Opening Trainer. It shows a dialog box with four inputs:

  • a list of PGN files containing the collection
  • the deck where to import the collection
  • the side that you are training for (black or white)
  • the note type

The Anki "note type" is the layout of the flashcard. This add-on requires a note type with just two fields (front and back side) and no additional elements. This note type is one of the default types of Anki, usually called "Basic".

But first you need at least one game collection, either for black or white. Read on!

Creating a Game Collection

Experienced chess players will usually have their own tool for creating PGN files. One easy option is to create a "study" on the online chess platform lichess.org. Select the "Learn" menu item, and then "Studies". Go to "My studies", click the Plus (+) button in the upper right corner and name the collection something like "Opening Repertoire White". Leave the board orientation to white (switch to black if you want to learn from black's perspective).

Next, you have to give the name of the first chapter. Choose "A41 Old Indian Defence". You should now see a chess board that allows you to enter moves.

It makes sense to first enter the main line, for example 1. d4 Nf6 2. c4 d6 3. Nc3 e5 4. d5. Say, you want to prepare for other replies of black to 3. Nc3. Select that move in the move window, and then enter another move 3. ... Nf6. That will create a variation. A good continuation for white whould be 4. Nf3. Enter that move.

Black can also blunder here. Select 3. Nc3 again and enter 3. ... Be6. This is a blunder but you have to remember how to exploit it. The correct answer is 4. d5 because it attacks both the knight on c6 and the bishop on e6.

Later in Anki the move sequence 1. d4 Nf6 2. c4 d6 3. Nc3 Be6 will become a question. You will see the sequence of moves and a board representation of this position. The response will say 4. d5 and you will also see the position after that move.

In chess literature, moves are often annotated with interpunction. In lichess you will find a little toolbar under the board. Click on !? and then select ?? for blunder. You can now see that the bishop move changes to 3 ... Be6?? in the move window.

You may also want to explain what is going on. In the toolbar under the board click on the speech bubble and enter a text like "Attacks both the knight on c6 and the bishop on e6". The comment will appear in the move window, and later in Anki will also be visible in the response to the exercise.

It is also possible to visualise the attack. Right-click the pawn on d5 and drag the mouse pointer to the bishop while holding down the ctrl key. A red arrow will appear. Repeat this with the knight on c6. If you want to show that the pawn cannot be captured by the bishop, right-click on the knight on c3. It will be marked with a green circle. Right-click and drag the mouse pointer from c3 to d5, and a green arrow will appear showing that the knight defends the pawn. All these graphics will also be visible in Anki later.

You can explore all possibilities at https://lichess.org/study/ZRtfG7rP/gT2yFeb2

You can add more chapters to your study but in the end you have to get it into Anki. In the toolbar under the board, click on the "share" symbol. Select "study pgn" and you will find a file "lichess_study_*****.pgn" in your download directory.

Import into Anki

Open Anki, click Tools -> Chess Opening Trainer. Click the "Select files" button, and navigate to the file(s) containing your games. You can also select multiple files at once.

Choose a deck of your choice, leave the colour as white, and make sure that the note type is "Basic". You should now have a deck with cards from every position with white to move. If you later edit the study, you can import an updated version again, that gets merged into the existing deck. Your progress will be preserved to the extent possible.

Important! The PGN file must be in UTF-8 encoding!

You can import more files but you should always be sure whether the currently selected deck is holding games from white's or black's perspective.

Copyright

This is free software. Copyright © 2023, Guido Flohr guido.flohr@cantanea.com, all rights reserved.