A Rust CLI tool that automatically creates language learning decks for Anki.
Automatically generate Anki flashcard decks with the most frequently used words in your target language, paired with translations in your native language.
π¦π· β ππ· Spanish to Croatian language learning
Downloads Croatian word frequency data from Hermit Dave's FrequencyWords repository, then selects the top 100 most frequent words from each part of speech (nouns, verbs, adjectives, etc.), and creates Anki flashcards with Spanish translations.
Default: 100 words Γ 8 parts of speech = 800 words β 1,600 bidirectional cards
- π― Automatic deck generation - Create full Anki decks with one command
- π Bidirectional cards - Practice both recognition and production (default)
- οΏ½ Frequency-based - Learn the most common words first
- π€ Organized by grammar - Words categorized by part of speech
- π Auto-translation - Powered by LibreTranslate API
- πΎ Smart caching - Fast repeat runs, works offline
- π¨ Beautiful CLI - Interactive prompts with progress indicators
# Enter development environment (includes Rust and Anki)
nix-shell
# Or use direnv for automatic activation
direnv allow- Install Rust
- Install Anki Desktop
In Anki:
- Tools β Add-ons β Get Add-ons
- Enter code:
2055492159 - Restart Anki
make run ARGS="test"Interactive mode (recommended):
make run ARGS="create"The CLI will prompt you for:
- Target language (language to learn)
- Base language (your known language)
- Deck name
Command-line mode:
# Create bidirectional deck (default - 90 cards: 45 words Γ 2 directions)
make run ARGS="create -t hr -b es"
# Create unidirectional deck (45 cards: CroatianβSpanish only)
make run ARGS="create -t hr -b es --bidirectional=false"
# Customize word count
make run ARGS="create -t hr -b es --words-per-pos 50"
# Custom deck name
make run ARGS="create -t hr -b es -d 'My Vocabulary'"
# Test configuration without creating
make run ARGS="create --dry-run"$ make run ARGS="create -t Croatian -b Spanish"
π Anki Deck Builder - Language Learning Deck Creator
π Loading Croatian word frequency data...
β
Loaded Croatian word data (45 words)
π Translating 45 words from Croatian to Spanish...
[========================================] 45/45 (100%)
β
Translation complete
π Creating Anki deck...
β
Connected to AnkiConnect
β
Created deck: 'Croatian β Spanish (Top 800 Words)'
π Adding 45 cards to deck...
[========================================] 45/45 (100%)
β
Cards added
π Deck creation complete!
β
45 cards added successfully
π Deck: Croatian β Spanish (Top 800 Words)
π‘ Open Anki to start studying!By default, creates 2 cards per word for comprehensive learning:
Card 1 - Recognition: Croatian β Spanish
- Front:
dan - Back:
dΓa(Noun) - You see Croatian and recall the Spanish meaning
Card 2 - Production: Spanish β Croatian
- Front:
dΓa - Back:
dan(Noun) - You see Spanish and produce the Croatian word
Use --bidirectional=false for recognition-only (Croatian β Spanish):
- Front:
dan - Back:
dΓa(Noun)
# Optional: Custom AnkiConnect URL (default: http://localhost:8765)
export ANKICONNECT_URL="http://localhost:8765"
# Optional: Custom LibreTranslate server
export LIBRETRANSLATE_URL="https://libretranslate.com"make run ARGS="config --show"Data is cached in ~/.local/share/anki-deck-builder/:
frequency/- Word frequency liststranslations/- Translated words
Clear cache:
rm -rf ~/.local/share/anki-deck-builder/# Show all available commands
make help
# Build
make build # Debug mode
make build-release # Release mode
# Test
make test # Run unit tests
make check # Quick compile check
# Code quality
make fmt # Format code
make-lint # Run linter
make dev # Run all checksanki-deck-builder/
βββ src/
β βββ cli.rs # CLI interface
β βββ ankiweb/ # AnkiConnect client
β βββ language/ # Translation & frequency data
βββ tests/ # Integration tests
βββ docs/ # Documentation
βββ Makefile # Development commands
βββ shell.nix # NixOS environment
Serbo-Croatian variants: Croatian, Serbian, Bosnian, Montenegrin Other languages: Spanish, English, French, German, Italian, Portuguese, Ukrainian, Japanese, Korean, Chinese, Arabic, Hindi, Dutch, Polish, Swedish, Norwegian, Danish, Finnish, Greek, Turkish
Note: Full frequency data currently available for Croatian. Other Serbo-Croatian variants and languages have basic support and may use simplified word lists or require additional data sources.
- Make sure Anki is running
- Verify AnkiConnect is installed (code: 2055492159)
- Test with:
make run ARGS="test"
Complete troubleshooting guide β
- Requires internet connection for first run
- Subsequent runs use cached translations
- Try again if API is temporarily unavailable
This is normal if you've run the tool multiple times. Anki prevents duplicate cards. Use a different deck name or delete the existing deck first.
User Guides:
- User Guide - Complete usage manual
- AnkiConnect Setup - Installation & troubleshooting
Developer Docs:
- Project Complete - Project summary and statistics
- Project Plan - Technical architecture
- Expand word datasets (800+ words)
- External data sources (Leipzig Corpora)
- Audio pronunciation
- Example sentences
- Image support
- More language pairs
- DeepL API integration
MIT License
Contributions welcome! The project has a modular architecture that's easy to extend.
Built with: Rust 2021 | Dependencies: Tokio, reqwest, clap, dialoguer, indicatif
Platforms: Linux, macOS, Windows (via rustls-tls)