fox-anki is a command-line tool for managing Anki flashcards.
It supports common deck, note, card, tag, media, and import/export workflows for Anki collections.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .[dev]
python -m fox_anki --helpCreate one basic card:
fox-anki notes add \
--deck Default \
--type Basic \
--field Front="What is TCP three-way handshake?" \
--field Back="SYN, SYN-ACK, ACK" \
--collection /path/to/collection.anki2python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .[dev]ruff check .
mypy src tests
pytest
bash scripts/smoke.sh /path/to/collection.anki2
python -m buildfox-anki collection info --collection /path/to/collection.anki2
fox-anki decks create Spanish --collection /path/to/collection.anki2
fox-anki notes add --deck Default --type Basic --field Front="hello" --field Back="world" --collection /path/to/collection.anki2
fox-anki cards move "deck:Default" --deck Spanish --collection /path/to/collection.anki2
fox-anki media check --collection /path/to/collection.anki2
fox-anki export apkg ./default.apkg --deck Default --collection /path/to/collection.anki2See docs/cli.md for the full command reference.
import csvis atomic: if any row fails, earlier rows from the same file are rolled back.export csvandexport apkgrefuse to overwrite an existing file unless--forceis passed.- Avoid writing to the same collection while the Anki desktop app is actively using it.