Zum Inhalt springen

Skills / anki connect skill

anki connect skill

AI agent skill for controlling Anki flashcards via Anki-Connect HTTP API. Works with Claude Code, OpenCode, and GitHub Copilot CLI. Create cards, manage decks, search notes, and automate Anki entirely through curl commands.

1von @crisakvor 0d aktualisiertGitHub →

Installation

Kompatibilitaet

Claude CodeVS Code

Beschreibung

anki-connect skill

AI agent skill for controlling Anki flashcards via the Anki-Connect HTTP API. Works with Claude Code, OpenCode, and GitHub Copilot CLI. Built from the official Anki-Connect documentation.

Enable your AI coding assistant to create flashcards, manage decks, search notes, customize card templates, and fully automate Anki — all through curl commands via the Anki-Connect REST API.

Features

  • Create flashcards — single or bulk, with media (audio/images/video)
  • Manage decks — create, delete, move cards, configure scheduling
  • Search notes and cards — full Anki query syntax support
  • Customize note types — templates, fields, CSS styling
  • Manage tags — add, remove, replace, clear unused
  • Control Anki GUI — browse, review, card dialogs
  • Handle media files — upload, retrieve, delete
  • Statistics and review history — per-deck and collection-wide
  • Full card control — suspend, unsuspend, forget, relearn, answer
  • Export/import decks.apkg file support
  • Sync with AnkiWeb

Compatibility

| AI Tool | Supported | |---|---| | Claude Code | ✅ | | OpenCode | ✅ | | GitHub Copilot CLI | ✅ |

Prerequisites

  1. Anki installed and running
  2. Anki-Connect add-on installed (code: 2055492159)

Install Anki-Connect

  1. Open Anki
  2. Go to Tools → Add-ons → Get Add-ons...
  3. Enter code: 2055492159
  4. Restart Anki

Anki-Connect exposes a local HTTP server at http://localhost:8765.

Installation

Claude Code

claude mcp install https://github.com/crisak/anki-connect-skill

Or manually copy SKILL.md to your skills directory:

macOS / Linux:

mkdir -p ~/.claude/skills/anki-connect
curl -o ~/.claude/skills/anki-connect/SKILL.md \
  https://raw.githubusercontent.com/crisak/anki-connect-skill/main/SKILL.md

Windows (PowerShell):

New-Item -ItemType Directory -Force "$env:APPDATA\Claude\skills\anki-connect"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/crisak/anki-connect-skill/main/SKILL.md" `
  -OutFile "$env:APPDATA\Claude\skills\anki-connect\SKILL.md"

OpenCode

macOS / Linux:

mkdir -p ~/.config/opencode/skills/anki-connect
curl -o ~/.config/opencode/skills/anki-connect/SKILL.md \
  https://raw.githubusercontent.com/crisak/anki-connect-skill/main/SKILL.md

Windows (PowerShell):

New-Item -ItemType Directory -Force "$env:APPDATA\opencode\skills\anki-connect"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/crisak/anki-connect-skill/main/SKILL.md" `
  -OutFile "$env:APPDATA\opencode\skills\anki-connect\SKILL.md"

GitHub Copilot CLI

mkdir -p ~/.config/gh-copilot/skills/anki-connect
curl -o ~/.config/gh-copilot/skills/anki-connect/SKILL.md \
  https://raw.githubusercontent.com/crisak/anki-connect-skill/main/SKILL.md

Quick Verification

Before using, verify Anki-Connect is running:

curl -s localhost:8765 -X POST -d '{"action": "requestPermission", "version": 6}'

Expected response:

{"result": {"permission": "granted", "requireApikey": false, "version": 6}, "error": null}

If connection is refused: open Anki and make sure the add-on is installed.

Usage Examples

Once installed, ask your AI assistant naturally:

"Create a Spanish vocabulary flashcard: 'casa' means 'house'"

"Add 10 Japanese vocabulary cards to my JLPT N5 deck"

"Show me all cards tagged 'important' that are due today"

"Export my Default deck to /tmp/backup.apkg"

The skill handles everything via curl — no Python, no Node, no dependencies.

Direct API examples

Create a flashcard:

curl localhost:8765 -X POST -d '{
  "action": "addNote",
  "version": 6,
  "params": {
    "note": {
      "deckName": "Default",
      "modelName": "Basic",
      "fields": {"Front": "What is photosynthesis?", "Back": "Process plants use to convert light into energy"},
      "tags": ["biology", "science"]
    }
  }
}'

List all decks:

curl localhost:8765 -X POST -d '{"action": "deckNames", "version": 6}'

Search notes:

curl localhost:8765 -X POST -d '{
  "action": "findNotes",
  "version": 6,
  "params": {"query": "deck:Default tag:biology is:due"}
}'

API Coverage

This skill covers all Anki-Connect v6 API actions, organized by category:

| Category | Actions | |---|---| | Cards | getEaseFactors, suspend, unsuspend, findCards, cardsInfo, forgetCards, answerCards, setDueDate, ... | | Decks | deckNames, createDeck, deleteDecks, getDeckConfig, getDeckStats, ... | | Notes | addNote, addNotes, updateNote, deleteNotes, findNotes, notesInfo, ... | | Models | modelNames, createModel, updateModelTemplates, updateModelStyling, ... | | Tags | getTags, addTags, removeTags, replaceTags, clearUnusedTags, ... | | Media | storeMediaFile, retrieveMediaFile, deleteMediaFile, ... | | GUI | guiBrowse, guiAddCards, guiEditNote, guiAnswerCard, ... | | Statistics | getNumCardsReviewedToday, cardReviews, getCollectionStatsHTML, ... | | Misc | sync, exportPackage, importPackage, multi, getProfiles, ... |

Troubleshooting

| Error | Cause | Fix | |---|---|---| | Connection refused | Anki not running | Open Anki | | Permission denied | API key required | Add "key": "your-key" to requests | | Model not found | Wrong model name | Check exact name (case-sensitive) with modelNames | | Deck not found | Deck doesn't exist | Create it first with createDeck | | Note update failed | Note open in browser | Close the note in Anki's card browser |

Based on Official Documentation

This skill was built entirely from the official Anki-Connect documentation by FooSoft Productions. All API behavior, parameters, and examples reflect the documented v6 API.

License

MIT

Aehnliche Skills

anki connect skill | hub.ai-engineering.at