Manual Chapters
Introduction
Where CQL and CQLi came from, the notation used in this manual, and system requirements.
CQL Fundamentals
How a query is evaluated, a brief tour of the language, operators, strings, regular expressions, and common pitfalls.
Comments
Adding comments to matching games, and how CQLi orders, merges, and deduplicates them.
Board State Filters
Attacks, check and mate, side to move, FEN strings, pawn structure, and promoted pieces.
Board Geometry Filters
Directions from a square, squares between two others, light and dark squares, files, and ranks.
Ray Filters
Lines of pieces along ranks, files, and diagonals, including x-rays and pins.
Metadata Filters
Game results, PGN tags, and game numbers.
The Gametree Filters
Moving around the game tree: parents and children, variations, the main line, and distances between positions.
Position Relationship Filters
Finding an earlier or later position that meets a condition, and comparing pairs of positions with echo.
The sort Filter
Ordering the output games by a value the query computes, and how ties and multiple sort filters are handled.
The move Filter
Matching moves by piece, square, capture, promotion, or castling, including legal moves that were not played.
The line Filter
Matching sequences of positions through a game, such as a run of checks or a series of captures.
Selection and Iteration Filters
The if filter, and loops over squares, pieces, dictionary keys, and characters of a string.
Functions
Writing reusable functions and importing them from other files.
Transform Filters
Writing a pattern once and matching it in every orientation and color with flips, rotations, and shifts.
Imaginary Position Exploration
Trying moves that were not played, changing the board, and testing whether a position is legal or reachable.
Chess Variants
Chess960, Crazyhouse, Atomic, Horde, and other variants, and how filters behave in each.
Other Features
Piece tracking, splitting output across files, JSON output, multithreading, Command Pipe, and the HHdb interface.
Synoptic Examples
Short queries for pawn structures, castling, promotions, tactics, tags, comments, and output files.
Expository Examples
Longer worked examples, from repetition detection and statistics to chess problems and 30 mating patterns.
Filter Conspectus
Tables of every filter and keyword, operator precedence, and order of evaluation.
Commandline Options
Every command line option, from selecting input games to PGN output formatting and filter injection.
Diagnostics
How errors, warnings, and infos are reported, with every warning and info message listed.
Revision History
What changed in each release since 1.0.1.
Appendix A: Differences Between CQL 6.1
Language and command line differences from CQL 6.1.
Appendix B: Open Source Declarations
The notice for ICU, the Unicode library CQLi uses.
Appendix C: Other Resources
Other CQL resources, game and study databases, and books and periodicals.
Appendix D: License
The license covering CQLi and its documentation.