Anki decks,
built from code.

Turn knowledge into Anki decks with Rust. Write your notes, add media, and keep identities stable as content changes.

Rust source → card preview
let (front, back) = ("hola", "hello");
let mut deck = Deck::new("Spanish");
deck.basic().note(front, back).stable_id("es:hola").add()?;
let report = deck.write_apkg(output.join("spanish.apkg"))?;
report.ensure_success()?;
Spanish
Spanish → English

hola

What does this mean?

Question shown.

Real code. Downloadable decks. A simplified preview of the cards inside.

Let your notes evolve.
Keep their identity.

Correct a definition or add an example. Stable IDs and a previous build help Anki Forge match existing notes when you export again.

Understand deck updates
Stable note IDes:hola
Front

hola

Back

hello

Try a content change.

Catch problems before export.

Inspect diagnostics for missing fields, media, and template problems. Make validation part of your build.

Explore validation

Your cards. Your templates.

Start with Basic and Cloze, or define your own note types. Keep HTML, CSS, and media in reusable template bundles.

Explore templates

Your first deck
starts here.

Run the smallest example from the source checkout, then open spanish.apkg in Anki. Requires Rust 1.92 or later.

Get started
Run from the source checkout
git clone https://github.com/morehardy/anki-forge.git
cd anki-forge
cargo run -q -p anki_forge --example target_api_basic

From the project