A command line interface for managing Anki decks.
This is a proof-of-concept version which is currently only capable of adding new cards to your decks from a simple text file format.
- Install python3 and pip (for python3), e.g. with
sudo apt install python3 python3-pip.
- Install anki-connect (anki addon 2055492159) and restart Anki
- Clone this repository
pip3 install -r requirements.txtin the project root directory
Example: from the project root directory run
./bin/anki-cli --card_file docs/example-card.txt
-h for more details on other options.
./bin/anki-cli --markdown --card_file docs/example-card.md
@ character at the beginning of a line is used to mark the name of a
field. Everything else on the line is used as the field name (with leading and
trailing whitespace removed), everything from the next line until the start of
the next field is used as the contents of the field.
For example a standard "Basic" card type would be written as:
@Front What is a foo? @Back A particularly vicious variety of dandelion.
No other parsing or modification is done, so html, cloze deletions, LaTeX, etc. should all work as normal.
The current licence is AGPLv3 because that's what Anki uses and consistent licencing is nice. If you would like something less restrictive give me a shout.