Create a new Anki flashcard - provide both sides or just one and let Claude generate the other
Creates Anki flashcards with smart content generation. Provide both sides or just one, and Claude will generate the missing side or prompt you to select a deck.
/plugin marketplace add jtmuller5/anki-claude-plugin/plugin install jtmuller5-anki-claude-plugin@jtmuller5/anki-claude-pluginCreate a new Anki flashcard using the AnkiConnect API. You can provide both sides of the card, or just one side and Claude will intelligently generate the other.
Smart Content Generation:
--content alone, Claude will determine if it's a question or answer and generate the complementary side--front, Claude will generate an appropriate answer for the --back--back, Claude will generate an appropriate question for the --front--front and --back, they will be used as-is without generationProcess:
deckNames actionAPI Request Formats:
Get available decks (if deck not provided):
curl -X POST http://localhost:8765 \
-H "Content-Type: application/json" \
-d '{
"action": "deckNames",
"version": 6
}'
Then use AskUserQuestion to present the decks to the user:
Use the AskUserQuestion tool with:
- question: "Which deck should this flashcard be added to?"
- header: "Deck"
- options: Array of deck names returned from the API (convert to label/description format)
- multiSelect: false
Add the note with the selected deck:
curl -X POST http://localhost:8765 \
-H "Content-Type: application/json" \
-d '{
"action": "addNote",
"version": 6,
"params": {
"note": {
"deckName": "{{deck}}",
"modelName": "Basic",
"fields": {
"Front": "{{front}}",
"Back": "{{back}}"
},
"tags": {{tags_array}}
}
}
}'
Error Handling:
Success Response: Report the card ID that was created, confirm which deck it was added to, and show both the front and back content (including any generated content).
Example Usage:
Full specification (both sides provided):
/create-flashcard --front "What is the capital of France?" --back "Paris" --deck "Geography" --tags "europe,capitals"
Quick mode with just content (Claude generates the other side):
/create-flashcard --content "Paris is the capital of France"
# Will prompt: "Which deck should this flashcard be added to?" with options from your Anki decks
/create-flashcard --content "What is the capital of France?" --deck "Geography"
# Skips prompt because deck is specified
Provide one side only:
/create-flashcard --front "What is photosynthesis?" --deck "Biology"
/create-flashcard --back "The process by which plants convert sunlight into energy"
# Will prompt for deck selection
Minimal usage (will prompt for deck):
/create-flashcard --content "mitochondria is the powerhouse of the cell"
# You'll be asked to select a deck from your available decks