lichess.org
Donate
PGN Editor in action

https://siderite.dev/blog/lichess-tools---user-manual#pgnEditor

Using the PGN Editor feature of LiChess Tools

ChessAnalysisChess engineSoftware Development
Filter games, merge, split and evaluate right here, on the lichess website

In this post I will describe some of the functionalities of the PGN Editor, one of the newest features of LiChess Tools (browser extension that enhances the functionality of lichess completely free and without ads - https://chromewebstore.google.com/detail/lichess-tools-by-siderite/langlhlcknngldkeliapahbhbcmlcbcj).

Intro

There are some great tools that lichess offers for loading, manipulating and exporting PGNs. You have the Analysis Board, which allows you to see the moves in a nice tree, move pieces around, run computer analysis, but doesn't allow comments and annotations and shapes or multiple games. Then you have Studies, where you have all of those, but you can only add new moves, delete branches or promote variations. If you want to make significant changes to the PGN, you're on your own. Both are limited in the number of games and size of input they handle.

Enter PGN Editor, a tool that supports tens of MB of PGN content, which you manage and process in text format. No fancy trees or charts, this is a text editor, but it adds a lot of fantastic functionalities. And its integrated seamlessly into the lichess website.

First wave: merging and splitting

If you have a lot of games you want to use on lichess, you are usually out of luck. Studies support a maximum of 32 or 64 chapters, depending on how you create them. Any more and you have to use a different study.

PGN Editor can Merge multiple games starting from the same position into a single one with many branches. You can then import this as a single study chapter (and use it with the Extended Interactive Lesson feature, for example).
image.png

The reverse operation is also there, you can take a game PGN with many variations and Split each of them into its own single line game.
image.png

Bonus: the Normalize operation, which will eliminate duplicate branches (coming from transposing positions)
image.png

I have merged successfully not 32, not 64, but tens of thousands of games in a single operation, the only limit being the memory available to the browser.

Second wave: searching and filtering

How many times have you wanted to find games in a large pool of them and didn't have the proper tool? If you are more tech savvy you used regular expressions in text editors, but those cannot understand chess games and are cumbersome to use with PGN notation.

With the Search functionality of the PGN Editor you can search by:

  • partial PGN notation
  • partial FEN notation
  • index (nth game)
  • validity
  • PGN tags
  • number of ply (half-moves)

Wildcards like * and ? are supported.
image.png

Search will only add a Found PGN tag, but then you can press the Result button and keep only what you found, or use the Result prompt for the Cut operation.

And speaking of Cut, you can remove comments, annotations, PGN tags or moves after a certain ply on every branch.
image.png

Third wave: evaluation

With Evaluate you can evaluate automatically the last positions of every game. Not just the mainline, all the branches. This is new, so probably I will add more targets soon. Let me know what you need.
image.png

All of the features above come with an easy to use copy/paste/upload/download/undo/redo stack.

The future

The PGN Editor feature is ever evolving, like LiChess Tools itself, but it's a very specific tool, designed to work with text. The most common use case is downloading a list of your games (or someone else's), then search, filter, manipulate and analyse the data for a lot of different purposes for maximum effect.

However, stuff like tree visualization, with dragging and dropping branches, reordering, various types of exotic visualizations and analyses is in my plan for the future. Probably a different tool. I've added a lot of stuff to both Analysis and Studies, but I feel like without a complete redesign, those tools are now limiting what is possible instead of enabling it. New vision requires new concepts.

So let me know how you like PGN Editor, what you use it for and what you would want more (or less). With your input I can craft the best tool for your purposes.

Thanks for reading thus far and have fun!