Study, lessons and training

study — The cross-import study queue

Lists the blunders of the database’s reference player, all imports together, that nothing has handled yet: no comment, no Anki card, outside any collection and without a “seen” mark (see Blunders nothing has handled yet). Each subcommand takes --db.

./blunderdb study <subcommand> [options]

Subcommands:

  • queue [--limit <n>] [--format text|json] — The queue, from the most costly to the least costly; at most fifty positions.

  • mark --id <id> — Marks the position as seen: it leaves the queue. The mark is data in the database, never exported.

  • unmark --id <id> — Removes the mark: the position returns to the queue.

  • status --id <id> — Tells whether the position carries the mark.

Examples:

./blunderdb study queue --db base.db --limit 20
./blunderdb study mark --db base.db --id 1234

lesson — Manage lessons

Manages lessons: ordered sequences of steps that a coach writes once for a student. Each step has a title, a text and can show a collection, a position, both or neither. A lesson is handed over in a .dbx file (export subcommand) and read in the graphical interface with the :le command. Every subcommand takes --db; list and show accept --format text (default) or json.

./blunderdb lesson <subcommand> [options]

Subcommands:

  • list — Lists the lessons: id, name, number of steps.

  • show --id <id> — The steps of a lesson, in order: step id, title, text, and the collection and position shown.

  • create --name <nom> [--description <texte>] — Creates an empty lesson.

  • edit --id <id> [--name <nom>] [--description <texte>] — Renames a lesson or changes its description; what is not given is kept.

  • delete --id <id> --confirm — Deletes the lesson and its steps, permanently (lessons have no trash). The collections and positions that its steps showed remain in the database.

  • add-step --lesson <id> [--title <titre>] [--text <texte> | --text-file <fichier>] [--collection <id>] [--position <id>] — Adds a step at the end of the lesson.

  • edit-step --lesson <id> --step <id> [--title …] [--text … | --text-file …] [--collection <id>] [--position <id>] — Edits a step; only the fields given change, --collection 0 or --position 0 remove what the step showed.

  • remove-step --lesson <id> --step <id> — Removes a step.

  • reorder --lesson <id> --steps <id,id,…> — Sets the order of the steps; the list gives all the steps of the lesson.

  • export --id <id[,id…]> --out <fichier> [--analysis=false] [--comments=false] [--watermark <texte>] [--watermark-note <texte>] [--password <mot de passe>] — Exports one or more lessons, with the collections and positions that their steps show, to a new database file; with --password, the file is a protected .dbx (see the export command for the watermark). With --html (a single lesson, --lang fr|en|de|el|es|fi|it|ja|ru), --out is a self-contained HTML page: title, description, each step with its text and board, the stored analysis of each position folded away like a quiz answer, and the origin of the database’s watermark at the foot, if it has one. The file holds no script and no network address.

  • done --step <id> [--undo] — Marks a step as done in this database, or removes the mark with --undo: this is the progress of the person reading the lesson, and no export carries it.

  • progress --id <id> [--format text|json] — Shows the steps of the lesson marked as done, with the date of the gesture.

Importing a file that contains a lesson creates it with its steps; a lesson whose name already exists in the database is left untouched, so importing the same file again changes nothing. Reading a lesson records nothing on the reader’s side; only done writes its progress.

Exporting the whole library (export --type database) carries all the lessons with what their steps show; a partial export carries only those named, through lesson export.

Examples:

./blunderdb lesson create --db base.db --name "Jouer contre un prime"
./blunderdb lesson add-step --db base.db --lesson 1 \
    --title "Le temps" --text "Comptez les pips." --collection 3
./blunderdb lesson show --db base.db --id 1

# Remettre la leçon à un élève, protégée et marquée de son origine
./blunderdb lesson export --db base.db --id 1 --out lecon.dbx \
    --password secret --watermark "Cours du 12 mars"

anki — Spaced-repetition decks

Consults and maintains the spaced-repetition (FSRS) decks of the GUI’s Anki panel. Reviewing a card needs the board and stays in the GUI; the CLI lists, measures and resynchronises.

./blunderdb anki <subcommand> [options]

Subcommands:

  • decks [--format text|json|csv] — List of decks: source, number of cards, due cards, new cards.

  • stats --deck <id> [--format text|json] — Review statistics for a deck: total, new, learning, review, due now, and its FSRS parameters.

  • forecast [--deck <id>] [--days <n>] [--format text|json|csv] — Cards coming due per calendar day (UTC) over the next n days (default 30, maximum 365); day 0 absorbs all overdue cards; --deck 0 (default) covers all decks.

  • sync --deck <id> — Adds a card for every position of the deck’s source that does not have one yet; existing cards keep their schedule.

  • retention --deck <id> [--format text|json] — a deck’s measured retention, against the target its owner chose.

  • card --id <id> --action suspend|unsuspend|bury|remove|undo [--format text|json] — acts on one card. Suspending sets it aside without losing its history (it no longer comes up in a session); burying hides it until the next day, saying nothing about its worth; removing deletes it from the deck — the position itself stays in the library, a deck being only a study list laid over it. undo reverts the card’s last rating, which returns to its state before that rating, and shows that state. With no rating to undo, the command refuses: “the card has no review to undo”.

  • log [--deck <id>] [--limit <n>] [--format text|json] — the review log, most recent first (--deck 0, the default, covers every deck; --limit defaults to 20). The log is what the scheduler was actually told, as opposed to what it plans today: the only place a grade entered by mistake can be seen.

  • export --deck <id> | --collection <id> --out <file.apkg> [--format apkg] [--lang <lang>] — Writes a deck, or a collection, as an Anki package .apkg that the Anki application imports on a computer or a phone: one card per position, with the board, score, cube and dice on the front, and the best move or right cube decision, its equity and the played move’s error on the back, labelled in the --lang language (en by default). A living collection is evaluated at export, within its ceiling. The export writes nothing to the database; a re-export imported into Anki updates its cards instead of duplicating them. The daemon serves the same file on POST /v1/anki.exportApkg.

A deck based on a collection re-reads its collection; based on a living collection, it replays its query under the same ceiling of 5,000 positions and reports a truncated source on the error output. A deck based on a search keeps the search as the GUI saved it (command, board and the identifiers of the positions found at that time): the search grammar lives in the GUI, so the CLI resynchronises from the saved identifiers and reports it on the error output — open the deck in the GUI to replay the search itself.

Examples:

./blunderdb anki decks --db base.db
./blunderdb anki stats --db base.db --deck 2 --format json
./blunderdb anki forecast --db base.db --deck 2 --days 14
./blunderdb anki sync --db base.db --deck 2
./blunderdb anki card --db base.db --id 12 --action suspend
./blunderdb anki card --db base.db --id 12 --action undo
./blunderdb anki log --db base.db --deck 2 --limit 50
./blunderdb anki export --db base.db --deck 2 --out paquet.apkg --lang fr

# Day         Due
# ---         ---
# 2026-09-02  12
# 2026-09-03  4
# ...
#
# 37 card(s) due over 14 day(s)

training — The training log

Reads back the log of the Training tab (see Training Panel) and turns missed questions into something to review. The log is written by the graphical application, or by a daemon client through the training.save route; the command line does not ask questions.

training sessions — The sessions, most recent first, with their identifier; the PR exists only for Decision.

./blunderdb training sessions --db <fichier> [options]

Options:

  • --exercise <name> — A single exercise: scores, pips, bearoff, evaluation or decision.

  • --limit <n> — Number of sessions (default 20; 0 = all).

  • --format text|json — Output format.

training missed — The missed positions, each once, most recently missed first; a question that timed out counts as missed. Only Decision questions keep their position.

./blunderdb training missed --db <fichier> [options]

Options:

  • --exercise <name> — The sessions of a single exercise.

  • --session <id> — A single session (an identifier from training sessions).

  • --limit <n> — Number of positions (default 0 = all).

  • --deck <name> — Creates an Anki deck of these positions.

  • --collection <name> — Creates a collection of these positions.

  • --format text|json — Output format; in JSON, PositionIDs, and DeckID or CollectionID when they are created.

Examples:

./blunderdb training sessions --db base.db --exercise decision
./blunderdb training missed --db base.db --session 12 --deck "Ratés de lundi"
./blunderdb training missed --db base.db --collection "Mes ratés" --format json