Recipes

Recipes

Use this page when you want workflow-mechanic recipes for how humans can brief an agent harness to study, generate cards, attach images or ElevenLabs-style audio, and repair an existing deck through ankicli.

Copy this guide

Paste it into Claude, Codex, or OpenClaw for structured context.

Paste this page into your LLM chat for structured context.

When to use this

  • You want to understand what ankicli is for beyond basic inspection commands.
  • You are designing an agent workflow that studies, creates, updates, enriches, or repairs Anki cards.

What the agent should know

  • ankicli is the trusted local Anki control surface. External providers such as image models or ElevenLabs generate content, while ankicli validates targets and performs the actual note, media, backup, and sync operations.
  • Humans usually install, verify, and approve high-risk changes. Agents orchestrate the repeated retrieval, generation, and mutation workflows after the environment is healthy.

Recipe 1: Study copilot with error tracking

This is the simplest high-value operator flow. A human scopes the session, then the agent handles turn-taking, reveal timing, weak-card tracking, and an end-of-session summary.

Use this when you want a tutor-style conversation without pretending the CLI is the Anki desktop review screen.

  • Use this for language decks, interview prep decks, or any deck where the agent should explain mistakes after each reveal.
  • Keep in mind that study mode is local session state, not a direct write into Anki review scheduling.

Prompt for Claude, Codex, or OpenClaw

Use ankicli to run a 20-card study session from my Spanish deck.
Reveal the answer only after I respond.
Track cards I miss, explain the mistake briefly, and summarize weak areas at the end.
Use --json for every ankicli command.

ankicli flow

ankicli --json --profile "User 1" study start --deck Spanish --limit 20
ankicli --json study next
ankicli --json study reveal
ankicli --json study grade --rating again
ankicli --json study summary

Recipe 2: Turn notes into atomic cards

A strong creation flow is: human provides notes or a topic, the agent turns them into atomic cards, and ankicli performs the validated deck/model lookup plus note creation.

This is better than a blind bulk import because the agent can rewrite broad material into concise front/back pairs before ankicli touches the collection.

  • Use this for notes-to-cards, lecture-to-cards, or article-to-cards pipelines.
  • The agent should usually draft first and then create the notes only after the deck, model, and card quality are confirmed.

Prompt for Claude, Codex, or OpenClaw

Take these biology notes and draft good atomic flashcards.
Avoid duplicates, keep each card answerable in one step, and put the final cards in my Biology deck.
Show me the proposed fronts and backs first, then create them with ankicli after I approve.

ankicli flow

ankicli --json model list
ankicli --json deck list
ankicli --json --profile "User 1" note add --deck Biology --model Basic --field Front="What does the mitochondrion do?" --field Back="It produces ATP for the cell."

Recipe 3: Create image-backed vocabulary cards

ankicli becomes much more interesting when an external image provider generates the media and ankicli handles the note and collection side safely.

A good example is vocabulary training: the agent chooses a word list, generates educational image prompts, saves the images, and then creates or updates cards that reference those media files.

  • Best fit: vocabulary, anatomy, geography, object recognition, and children’s language decks.
  • Keep the image prompt educational and flashcard-friendly rather than photorealistic for its own sake.

Prompt for Claude, Codex, or OpenClaw

Create 15 beginner Japanese noun cards in my "Japanese Core" deck.
For each word, generate one clear educational image with my image provider.
Put the image on the back of the card, keep the text concise, and verify the created notes with ankicli when finished.

Image prompt pattern

Word: りんご
Prompt: "Simple educational illustration of a red apple on a plain light background, high clarity, flashcard-friendly, no text overlay"

ankicli flow

ankicli --json --profile "User 1" search preview --kind notes --query 'deck:"Japanese Core" note:Basic' --limit 10
ankicli --json --profile "User 1" note update --id 123 --field Back="<img src=\"apple.png\">\nA red apple."

Recipe 4: Fill missing pronunciation audio with ElevenLabs-style TTS

Text-to-speech providers like ElevenLabs fit naturally into a media-enrichment workflow. The agent can search for cards missing audio, generate pronunciation files, and then update the note fields with `[sound:...]` references.

This is especially strong for language decks where humans want consistent pronunciation, listening drills, or sentence audio without recording every file manually.

  • Use one voice for prompt-side pronunciation and another only if you intentionally want contrast or translation audio.
  • The agent should deduplicate audio generation rather than recreating files each run.

Prompt for Claude, Codex, or OpenClaw

Find French cards in my collection that are missing pronunciation audio.
Use ElevenLabs to generate native-sounding audio only for missing items.
Attach the audio to the card, avoid duplicates, and mark updated notes so I can review them later.

ankicli flow

ankicli --json --profile "User 1" search preview --kind notes --query 'deck:French "Bonjour"' --limit 5
ankicli --json --profile "User 1" note update --id 456 --field Back="[sound:bonjour-elevenlabs.mp3]\nHello"

Optional tagging for review

ankicli --json --profile "User 1" note add-tags --id 456 --tag audio-generated --dry-run
ankicli --json --profile "User 1" note add-tags --id 456 --tag audio-generated --yes

Recipe 5: Build a polished multimodal deck

The highest-leverage workflow combines LLM drafting, image generation, and TTS. The agent builds a polished note package, while ankicli remains the safe local write layer.

A typical pipeline is: take a word list or notes, generate concise card text, create an image prompt, synthesize audio, then create the note with all media linked correctly.

  • This is the clearest flagship use case for image + TTS providers around ankicli.
  • It turns ankicli into the reliable Anki mutation layer inside an agent-built learning workflow.

Prompt for Claude, Codex, or OpenClaw

Make me a polished deck for 50 beginner Italian nouns.
Each card should include the Italian word, an English gloss, a generated image, ElevenLabs pronunciation audio, and one simple example sentence.
Show me 5 sample cards first, then create the rest after I approve.

ankicli flow

ankicli --json --profile "User 1" note add --deck Italian --model Basic --field Front="la mela" --field Back="<img src=\"la-mela.png\">\n[sound:la-mela.mp3]\nThe apple"
ankicli --json --profile "User 1" search preview --kind notes --query 'deck:Italian "la mela"' --limit 3

Recipe 6: Repair and upgrade an existing deck

Not every valuable workflow is about new content. ankicli is also a good repair surface for agents that find missing audio, poor tags, verbose cards, duplicate notes, or cards that should be split into smaller units.

These flows are practical because an agent can audit the collection, propose targeted fixes, and then apply them through dry-run-first note and card commands instead of brittle UI automation.

  • Good targets: missing media, leech cleanup, tag normalization, deck moves, and card wording refactors.
  • Use `--dry-run` first when the agent is making structural cleanup decisions.

Prompt for Claude, Codex, or OpenClaw

Audit my Spanish deck for cards that are too verbose, duplicated, poorly tagged, or missing audio.
Show me a repair plan first.
Then apply only the approved fixes with ankicli, using dry-run where possible and tagging touched notes for review.

ankicli flow

ankicli --json --profile "User 1" search preview --kind notes --query 'deck:Spanish tag:needs-audio' --limit 20
ankicli --json --profile "User 1" note add-tags --id 789 --tag audio-generated --dry-run

Recipe 7: Build a deck from source material

A strong end-to-end workflow is: give the agent source material, have it extract testable concepts, draft cards, and then create the approved notes with ankicli.

This is a better fit than hand-authoring every card when you have lecture notes, article notes, transcripts, or a chapter outline and want a fast first pass.

  • Best fit: lecture notes, article summaries, transcripts, textbook chapters, and interview prep packets.
  • Keep a human approval step before bulk creation if the source material is long or nuanced.

Prompt for Claude, Codex, or OpenClaw

Turn these lecture notes into a new study deck.
Extract the most testable facts, keep cards atomic, avoid duplicates, and group related cards with sensible tags.
Show me a proposed set first, then create the approved cards with ankicli.

ankicli flow

ankicli --json deck list
ankicli --json model list
ankicli --json --profile "User 1" note add --deck "History 201" --model Basic --field Front="Question" --field Back="Answer"

Recipe 8: Draft cards first, then review before creation

Sometimes the right workflow is not immediate mutation. The agent drafts cards, the human reviews the proposal, and only then does ankicli create the accepted notes.

This is especially useful when deck quality matters more than speed or when the source material is subtle enough that a human wants to inspect the proposed cards first.

  • This is one of the safest high-autonomy authoring workflows.
  • It works well for serious learners who want agent speed without losing editorial control.

Prompt for Claude, Codex, or OpenClaw

Draft 30 flashcards from these notes but do not create them yet.
Show me the fronts, backs, tags, and target deck first.
After I approve the set, create the approved cards with ankicli and tag them needs-review.

ankicli flow

ankicli --json deck list
ankicli --json --profile "User 1" note add --deck Default --model Basic --field Front="Approved front" --field Back="Approved back"
ankicli --json --profile "User 1" note add-tags --id 123 --tag needs-review

Recipe 9: Ongoing deck maintenance automation

Some of the best uses of ankicli are recurring maintenance jobs rather than one-shot prompts. A human defines the policy once, and an agent periodically applies it through safe reads and targeted writes.

Examples include filling missing audio, creating backups, reviewing leeches, or tagging cards that need attention.

  • Best fit: recurring cleanup, media completion, and supervised maintenance workflows.
  • Keep low-risk fixes automatic and high-risk changes reviewable.

Prompt for Claude, Codex, or OpenClaw

Review my Spanish deck for missing audio and badly tagged notes.
Create a backup first, then generate a short repair plan.
Apply only the low-risk fixes automatically, and tag anything ambiguous for manual review.

ankicli flow

ankicli --json --profile "User 1" backup create
ankicli --json --profile "User 1" search preview --kind notes --query 'deck:Spanish -tag:audio-generated' --limit 25
ankicli --json --profile "User 1" note add-tags --id 789 --tag needs-review --dry-run

General pattern for all recipes

The stable pattern is: a human installs and verifies ankicli, the human gives the agent a specific goal and guardrails, external providers generate optional media, and ankicli performs the collection reads and writes.

This is the product shape to preserve. ankicli should remain the trusted retrieval and mutation layer, while the agent and external providers handle content generation and orchestration.

  • Use `--json` consistently for agent-driven workflows.
  • For risky mutations, prefer a human approval step before the final create or update commands run.

Operator baseline before any recipe

ankicli --version
ankicli --json doctor env
ankicli --json doctor backend
ankicli --json profile list