Anki-Multitool (Anki-MTool) - just useful multitool for Anki users. What it can do:
- Export decks to JSON and Markdown files 🃏 -> 📄
- Import decks from JSON and Markdown files 📄 -> 🃏
- List all decks in your Anki collection 📋
- Create a new deck ➕🃏
- To be continued... ⏩
- Rust 1.88.0+ (only if you are installing from source)
- Anki 25.02.7+
- AnkiConnect plugin with API version 6+
- OpenSSL 3.5.0+ (only for Linux users)
You can install manually by cloning the repository and running the following command:
sudo chmod +x install.sh
./install.sh
Or install through Homebrew (MacOS only):
brew tap gaussfff/anki-multitool
brew install anki-multitool
Details about homebrew formula you can find here.
Fish shell completions are available to provide command suggestions and autocompletion.
Script will automatically install completions for the Fish shell. After installation, restart your fish shell or run fish
to activate completions.
You'll now get suggestions when typing anki-mtool
commands.
anki-mtool <command> [options]
anki-mtool help [command]
- show help for a command or list all commandsanki-mtool info
- 📝 show description about anki-multitoolanki-mtool version
- 🏷️ show the version of anki-multitoolanki-mtool decklist
- 📋 list all decks in your Anki collectionanki-mtool newdeck <deck-name>
- ➕🃏 create a new deck in Anki, if deck exists, it will return erroranki-mtool json2deck <path-to-json-file>
- 📄 -> 🃏 import a deck from a JSON file into Anki, if deck exists, it will return erroranki-mtool deck2json <deck-name>
- 🃏 -> 📄 export a deck from Anki to a JSON file, if file exists, it will return erroranki-mtool md2deck <path-to-md-file>
- 📄 -> 🃏 import a deck from a Markdown file into Anki, if deck exists, it will return erroranki-mtool deck2md <deck-name>
- 🃏 -> 📄 export a deck from Anki to a Markdown file, if file exists, it will return error
You can define custom host and port for the server by setting the environment variables ANKI_MULTITOOL_HOST
and ANKI_MULTITOOL_PORT
. For example, you can run the following command in your terminal:
export ANKI_MULTITOOL_HOST="<cusotm-host>"
export ANKI_MULTITOOL_PORT="<custom-port>"
By default, tool will listening on localhost:8765
.
Anki-multitool supports two formats for importing and exporting decks: JSON and Markdown. Full examples you can find in examples
directory.
Name of file is deck name, so if you want to export deck named "My Deck" to JSON file, it will be saved as my_deck.json
.
Vice versa, if you want to import deck from JSON file, the name of the deck will be taken from the file name (without extension).
If deck doesn't exist in Anki, it will be created automatically.
Here is example of JSON format used for importing and exporting decks:
[
{
"front": "What is the capital of Ukraine?",
"back": "Kyiv"
},
{
"front": "What is the capital of Germany?",
"back": "Berlin"
}
]
Name of file is deck name, so if you want to export deck named "My Deck" to Markdown file, it will be saved as my_deck.md
.
Vice versa, if you want to import deck from Markdown file, the name of the deck will be taken from the file name (without extension).
If deck doesn't exist in Anki, it will be created automatically.
Here is an example of Markdown formats used for importing and exporting decks:
1. What is the capital of Ukraine? - Kyiv
2. What is the capital of Germany? - Berlin
and
- What is the capital of Ukraine? - Kyiv
- What is the capital of Germany? - Berlin
This software is under the MIT license. See details in license file.
So-so, just create issue or PR, I will try to fix or approve it as soon as possible 😉