Hi all — I just published AnkiTextLayer (ATL), a small CLI that lets you write and maintain Anki decks in Markdown, then sync changes both ways (Markdown → Anki and Anki → Markdown).
Why it’s useful
- Edit hundreds of cards quickly in your editor (search/replace, refactors, reordering)
- Keep everything in Git (ATL auto-creates a commit before each sync so you can roll back)
- Markdown is AI-friendly for drafting/rephrasing while you keep final control
How it works (high level)
- Each Markdown file represents an Anki deck
- On first sync, ATL adds HTML comment IDs to track decks/cards
- After that, it detects what’s new/changed/moved/deleted and syncs accordingly
- It only manages its own provided note types, so your existing collection isn’t touched
Included note types + format
- Note types:
LayerQAandLayerCloze - Fields are written as simple prefixed lines:
Q:,A:,T:(cloze text), optionalE:andM: - Cards are separated by a blank line,
---, blank line
Requirements
- Anki running + AnkiConnect enabled:
Install + quick start
pipx install ankitextlayer
cd into-any-empty-folder-path
ankitextlayer init --tutorial
ankitextlayer ma # markdown-to-anki (conversly am)
# If it worked there should be a new deck in your Anki
Repo for more information: https://github.com/visserle/AnkiTextLayer
Issues/feedback welcome — This is only tested on a Mac and I expect some rough edges.
Cheers