mankey-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mankey CLI & MCP Tool Reference

Mankey CLI 与 MCP 工具参考文档

Mankey is an MCP server and CLI for managing Anki via Anki-Connect. Works with Node.js (npx) or Bun.
Mankey 是一款通过Anki-Connect管理Anki的MCP服务器与CLI工具,支持Node.js(npx)或Bun环境。

Prerequisites

前置条件

  1. Anki Desktop must be running
  2. Anki-Connect add-on must be installed: Anki > Tools > Add-ons > Get Add-ons > Code:
    2055492159
    > Restart Anki
  1. 必须运行**Anki Desktop**
  2. 必须安装Anki-Connect 插件:打开Anki > 工具 > 插件 > 获取插件 > 输入代码:
    2055492159
    > 重启Anki

Setup

设置步骤

MCP Server (Claude Desktop / Claude Code)

MCP服务器(Claude Desktop / Claude Code)

Add to your MCP config (
claude_desktop_config.json
or
.mcp.json
):
json
{
  "mcpServers": {
    "anki": {
      "command": "npx",
      "args": ["mankey"]
    }
  }
}
将以下内容添加到你的MCP配置文件(
claude_desktop_config.json
.mcp.json
)中:
json
{
  "mcpServers": {
    "anki": {
      "command": "npx",
      "args": ["mankey"]
    }
  }
}

CLI

CLI 快速使用

bash
npx mankey deck list                    # List decks
npx mankey tools                        # List all 96 tools
npx mankey note add --deck Default --model Basic --front "Q" --back "A"
npx mankey run <toolName> '<json>'      # Run any tool by name
bash
npx mankey deck list                    # 列出所有卡组
npx mankey tools                        # 列出全部96个工具
npx mankey note add --deck Default --model Basic --front "Q" --back "A"
npx mankey run <toolName> '<json>'      # 通过工具名称调用任意工具

Configuration

配置选项

OptionDescription
--url <url>
Anki-Connect server URL
ANKI_CONNECT_URL
Environment variable (default:
http://127.0.0.1:8765
)
选项描述
--url <url>
Anki-Connect服务器URL
ANKI_CONNECT_URL
环境变量(默认值:
http://127.0.0.1:8765

Troubleshooting

故障排除

  • Cannot connect: Ensure Anki is running with Anki-Connect installed
  • Permission dialog: Click "Yes" on first Anki-Connect connection
  • macOS background: Run
    defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true
    if Anki sleeps
  • 无法连接:确保Anki已运行且已安装Anki-Connect
  • 权限弹窗:首次连接Anki-Connect时点击「是」
  • macOS后台问题:如果Anki进入睡眠状态,运行命令
    defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true

CLI Subcommands

CLI 子命令

deck

卡组管理(deck)

CommandDescription
deck list
List all deck names
deck create <name>
Create a deck (use
::
for nesting)
deck stats <names...>
Get new/learn/review/total counts
deck delete <names...>
Delete decks and their cards
命令描述
deck list
列出所有卡组名称
deck create <name>
创建卡组(使用
::
表示嵌套)
deck stats <names...>
获取新卡片/学习中/复习/总数统计
deck delete <names...>
删除卡组及其中的卡片

note

笔记管理(note)

CommandDescription
note add --deck D --model M --front F --back B [--tags t1,t2] [--allow-duplicate]
Create a note
note find <query> [--offset N] [--limit N]
Search notes
note info <ids...>
Get note details
note update <id> [--fields '{}'] [--tags t1,t2]
Update a note
note delete <ids...>
Delete notes permanently
note tags <id>
Get tags for a note
命令描述
note add --deck D --model M --front F --back B [--tags t1,t2] [--allow-duplicate]
创建笔记
note find <query> [--offset N] [--limit N]
搜索笔记
note info <ids...>
获取笔记详情
note update <id> [--fields '{}'] [--tags t1,t2]
更新笔记
note delete <ids...>
永久删除笔记
note tags <id>
获取笔记的标签

card

卡片管理(card)

CommandDescription
card find <query> [--offset N] [--limit N]
Search cards
card info <ids...>
Get card details
card suspend <ids...>
Suspend cards
card unsuspend <ids...>
Unsuspend cards
card answer <cardId> <ease>
Answer card (1=Again 2=Hard 3=Good 4=Easy)
card next [--deck D] [--limit N]
Get next due cards in review order
命令描述
card find <query> [--offset N] [--limit N]
搜索卡片
card info <ids...>
获取卡片详情
card suspend <ids...>
暂停卡片
card unsuspend <ids...>
恢复暂停的卡片
card answer <cardId> <ease>
标记卡片掌握程度(1=重来 2=困难 3=良好 4=简单)
card next [--deck D] [--limit N]
获取按复习顺序排列的下一批待复习卡片

model

模型管理(model)

CommandDescription
model list
List all note types
model fields <name>
Get field names for a model
model create --name N --fields f1,f2 --templates '<json>' [--css C] [--cloze]
Create model
命令描述
model list
列出所有笔记类型
model fields <name>
获取模型的字段名称
model create --name N --fields f1,f2 --templates '<json>' [--css C] [--cloze]
创建笔记模型

stats

统计信息(stats)

CommandDescription
stats today
Today's review count
stats due [--deck D]
Due cards with learning/review breakdown
stats collection
Full collection statistics HTML
命令描述
stats today
今日复习统计
stats due [--deck D]
待复习卡片的学习中/复习分类统计
stats collection
完整的集合统计HTML内容

Generic Runner

通用调用器(Generic Runner)

bash
npx mankey run <toolName> '<jsonArgs>'
bash
npx mankey run <toolName> '<jsonArgs>'

Example:

示例:

npx mankey run addNote '{"deckName":"Default","modelName":"Basic","fields":{"Front":"Hello","Back":"World"}}' npx mankey run findCards '{"query":"deck:Default is:due","limit":20}'

Any of the 96 tools below can be called via `run`. Arguments are validated with Zod before execution.
npx mankey run addNote '{"deckName":"Default","modelName":"Basic","fields":{"Front":"Hello","Back":"World"}}' npx mankey run findCards '{"query":"deck:Default is:due","limit":20}'

以下96个工具均可通过`run`命令调用,参数会在执行前通过Zod进行验证。

Complete Tool Reference

完整工具参考

For full parameter schemas, types, and defaults, see
references/tools-by-category.md
.
如需查看完整的参数 schema、类型定义和默认值,请参考
references/tools-by-category.md

Deck Tools (6)

卡组工具(6个)

  • deckNames - List all decks with pagination (
    offset
    ,
    limit
    )
  • createDeck - Create deck (
    deck
    name,
    ::
    for nesting) returns ID
  • getDeckStats - Stats for decks (
    decks[]
    ) returns new/learn/review/total
  • deckNamesAndIds - Deck name-to-ID mapping with pagination
  • getDeckConfig - Get config group for a deck (
    deck
    )
  • deleteDecks - Delete decks (
    decks[]
    ,
    cardsToo
    default true)
  • deckNames - 分页列出所有卡组
  • createDeck - 创建卡组(支持
    ::
    嵌套),返回卡组ID
  • getDeckStats - 获取指定卡组的新卡片/学习中/复习/总数统计
  • deckNamesAndIds - 分页返回卡组名称与ID的映射关系
  • getDeckConfig - 获取卡组的配置组信息
  • deleteDecks - 删除卡组(默认同时删除卡片)

Note Tools (16)

笔记工具(16个)

  • addNote - Create single note (
    deckName
    ,
    modelName
    ,
    fields{}
    ,
    tags[]
    ,
    allowDuplicate
    )
  • addNotes - Bulk create (
    notes[]
    ) returns array of IDs (null for failures)
  • findNotes - Search (
    query
    ,
    offset
    ,
    limit
    ) returns IDs + pagination
  • notesInfo - Full note data (
    notes[]
    ) auto-batches >100
  • updateNote - Update fields/tags (
    id
    ,
    fields{}
    ,
    tags[]
    )
  • updateNoteFields - Update only fields (
    note.id
    ,
    note.fields{}
    )
  • deleteNotes - Delete permanently (
    notes[]
    )
  • getTags - All collection tags with pagination
  • getNoteTags - Tags for one note (
    note
    ID)
  • addTags - Add tags to notes (
    notes[]
    ,
    tags
    space-separated)
  • removeTags - Remove tags from notes (
    notes[]
    ,
    tags
    space-separated)
  • replaceTags - Replace tag in specific notes (
    notes[]
    ,
    tagToReplace
    ,
    replaceWithTag
    )
  • replaceTagsInAllNotes - Global tag replace (
    tagToReplace
    ,
    replaceWithTag
    )
  • clearUnusedTags - Remove orphaned tags (no params)
  • removeEmptyNotes - Delete notes with no cards (no params)
  • notesModTime - Modification timestamps (
    notes[]
    )
  • addNote - 创建单条笔记(参数包含卡组名、模型名、字段、标签、是否允许重复)
  • addNotes - 批量创建笔记,返回ID数组(创建失败的项为null)
  • findNotes - 搜索笔记,返回ID及分页信息
  • notesInfo - 获取笔记完整数据,超过100条时自动分批处理
  • updateNote - 更新笔记的字段与标签
  • updateNoteFields - 仅更新笔记的字段
  • deleteNotes - 永久删除笔记
  • getTags - 分页返回集合中的所有标签
  • getNoteTags - 获取单条笔记的标签
  • addTags - 为指定笔记添加标签(支持空格分隔字符串)
  • removeTags - 移除指定笔记的标签
  • replaceTags - 替换指定笔记中的标签
  • replaceTagsInAllNotes - 全局替换标签
  • clearUnusedTags - 移除未使用的标签
  • removeEmptyNotes - 删除无卡片关联的笔记
  • notesModTime - 获取笔记的修改时间戳

Card Tools (19)

卡片工具(19个)

  • findCards - Search (
    query
    ,
    offset
    ,
    limit
    ) returns IDs + pagination
  • getNextCards - Due cards in review order (
    deck
    ,
    limit
    ,
    offset
    )
  • cardsInfo - Full card data (
    cards[]
    ) auto-batches >100
  • answerCards - Batch answer (
    answers[].cardId
    ,
    answers[].ease
    1-4)
  • suspend / unsuspend - Toggle suspension (
    cards[]
    )
  • areSuspended - Check suspension status (
    cards[]
    ) returns booleans
  • areDue - Check due status (
    cards[]
    ) returns booleans
  • getEaseFactors / setEaseFactors - Get/set ease (
    cards[]
    ,
    easeFactors[]
    )
  • getIntervals - Current intervals in days (
    cards[]
    ,
    complete
    )
  • cardsToNotes - Map card IDs to note IDs (
    cards[]
    )
  • cardsModTime - Modification timestamps (
    cards[]
    )
  • forgetCards - Reset to new state (
    cards[]
    )
  • relearnCards - Move to relearning queue (
    cards[]
    )
  • setSpecificValueOfCard - Modify internal properties (
    card
    ,
    keys[]
    ,
    newValues[]
    )
  • getDecks - Deck names for cards (
    cards[]
    )
  • changeDeck - Move cards to deck (
    cards[]
    ,
    deck
    )
  • canAddNotes - Validate without creating (
    notes[]
    ) returns booleans
  • findCards - 搜索卡片,返回ID及分页信息
  • getNextCards - 按复习顺序获取待复习卡片
  • cardsInfo - 获取卡片完整数据,超过100条时自动分批处理
  • answerCards - 批量标记卡片掌握程度
  • suspend / unsuspend - 暂停/恢复卡片
  • areSuspended - 检查卡片的暂停状态,返回布尔值数组
  • areDue - 检查卡片是否待复习,返回布尔值数组
  • getEaseFactors / setEaseFactors - 获取/设置卡片的掌握系数
  • getIntervals - 获取卡片的当前复习间隔(天数)
  • cardsToNotes - 将卡片ID映射到对应的笔记ID
  • cardsModTime - 获取卡片的修改时间戳
  • forgetCards - 将卡片重置为新卡片状态
  • relearnCards - 将卡片移至重新学习队列
  • setSpecificValueOfCard - 修改卡片的内部属性
  • getDecks - 获取卡片所属的卡组名称
  • changeDeck - 将卡片移动到指定卡组
  • canAddNotes - 验证笔记是否可创建(不实际创建),返回布尔值数组

Model Tools (9)

模型工具(9个)

  • modelNames - List all models with pagination
  • modelFieldNames - Field names for model (
    modelName
    )
  • modelNamesAndIds - Model name-to-ID mapping with pagination
  • createModel - Create note type (
    modelName
    ,
    inOrderFields[]
    ,
    cardTemplates[]
    ,
    css
    ,
    isCloze
    )
  • modelFieldsOnTemplates - Fields used per template (
    modelName
    )
  • modelTemplates - Get templates for model (
    modelName
    )
  • modelStyling - Get CSS for model (
    modelName
    )
  • updateModelTemplates - Update templates (
    model.name
    ,
    model.templates{}
    )
  • updateModelStyling - Update CSS (
    model.name
    ,
    model.css
    )
  • modelNames - 分页列出所有笔记模型
  • modelFieldNames - 获取指定模型的字段名称
  • modelNamesAndIds - 分页返回模型名称与ID的映射关系
  • createModel - 创建笔记类型(包含模型名、字段、模板、CSS、是否为完形填空类型)
  • modelFieldsOnTemplates - 获取模型各模板中使用的字段
  • modelTemplates - 获取模型的模板信息
  • modelStyling - 获取模型的CSS样式
  • updateModelTemplates - 更新模型的模板
  • updateModelStyling - 更新模型的CSS样式

Media Tools (5)

媒体工具(5个)

  • storeMediaFile - Store file (
    filename
    , one of:
    data
    base64 /
    url
    /
    path
    ,
    deleteExisting
    )
  • retrieveMediaFile - Get file as base64 (
    filename
    )
  • getMediaFilesNames - List files (
    pattern
    with wildcards)
  • deleteMediaFile - Delete file (
    filename
    )
  • getMediaDirPath - Get media folder path (no params)
  • storeMediaFile - 存储媒体文件(支持base64数据、URL或本地路径)
  • retrieveMediaFile - 获取媒体文件的base64编码
  • getMediaFilesNames - 列出符合通配符规则的媒体文件
  • deleteMediaFile - 删除媒体文件
  • getMediaDirPath - 获取媒体文件夹路径

Stats Tools (7)

统计工具(7个)

  • getNumCardsReviewedToday - Today's review count (no params)
  • getDueCardsDetailed - Due cards breakdown (
    deck
    optional)
  • getNumCardsReviewedByDay - Reviews by day (no params)
  • getCollectionStatsHTML - Full stats HTML (
    wholeCollection
    )
  • cardReviews - Review history (
    deck
    ,
    startID
    )
  • getLatestReviewID - Latest review ID (
    deck
    )
  • getReviewsOfCards - Reviews for specific cards (
    cards[]
    )
  • getNumCardsReviewedToday - 获取今日复习卡片数量
  • getDueCardsDetailed - 获取待复习卡片的详细分类统计
  • getNumCardsReviewedByDay - 获取按天统计的复习历史
  • getCollectionStatsHTML - 获取完整的集合统计HTML内容
  • cardReviews - 获取卡片的复习历史
  • getLatestReviewID - 获取最新的复习记录ID
  • getReviewsOfCards - 获取指定卡片的复习记录

GUI Tools (17)

GUI工具(17个)

  • guiBrowse - Open browser (
    query
    ,
    reorderCards{}
    )
  • guiAddCards - Open add dialog (
    note{}
    )
  • guiCurrentCard - Current review card (no params)
  • guiAnswerCard - Answer current card (
    ease
    1-4)
  • guiShowQuestion / guiShowAnswer - Toggle card sides
  • guiStartCardTimer - Start review timer
  • guiDeckOverview - Open deck overview (
    name
    )
  • guiDeckBrowser - Open deck list
  • guiDeckReview - Start reviewing (
    name
    )
  • guiSelectedNotes - Get selected notes in browser
  • guiSelectCard - Select card in browser (
    card
    )
  • guiEditNote - Open edit dialog (
    note
    )
  • guiUndo - Undo last action
  • guiCheckDatabase - Run integrity check
  • guiImportFile - Open import dialog (
    path
    )
  • guiExitAnki - Close Anki
  • guiBrowse - 打开卡片浏览器
  • guiAddCards - 打开添加卡片对话框
  • guiCurrentCard - 获取当前正在复习的卡片
  • guiAnswerCard - 标记当前复习卡片的掌握程度
  • guiShowQuestion / guiShowAnswer - 切换卡片的问题/答案面
  • guiStartCardTimer - 启动复习计时器
  • guiDeckOverview - 打开卡组概览界面
  • guiDeckBrowser - 打开卡组列表界面
  • guiDeckReview - 开始复习指定卡组
  • guiSelectedNotes - 获取浏览器中选中的笔记
  • guiSelectCard - 在浏览器中选中指定卡片
  • guiEditNote - 打开笔记编辑对话框
  • guiUndo - 撤销上一步操作
  • guiCheckDatabase - 运行数据库完整性检查
  • guiImportFile - 打开文件导入对话框
  • guiExitAnki - 关闭Anki

System Tools (17)

系统工具(17个)

  • sync - Sync with AnkiWeb
  • getProfiles / loadProfile / getActiveProfile - Profile management
  • exportPackage - Export .apkg (
    deck
    ,
    path
    ,
    includeSched
    )
  • importPackage - Import .apkg (
    path
    )
  • version - Anki-Connect version
  • requestPermission - Request API permission
  • apiReflect - API metadata (
    scopes[]
    ,
    actions[]
    )
  • reloadCollection - Reload from disk
  • multi - Batch multiple actions (
    actions[]
    )
  • setDueDate - Override due date (
    cards[]
    ,
    days
    )
  • suspended - Check single card suspension (
    card
    )
  • saveDeckConfig - Update deck config (
    config{}
    )
  • setDeckConfigId - Assign config to decks (
    decks[]
    ,
    configId
    )
  • cloneDeckConfigId - Clone config (
    name
    ,
    cloneFrom
    )
  • removeDeckConfigId - Delete config (
    configId
    )
  • sync - 与AnkiWeb同步
  • getProfiles / loadProfile / getActiveProfile - 配置文件管理
  • exportPackage - 导出.apkg格式的数据包
  • importPackage - 导入.apkg格式的数据包
  • version - 获取Anki-Connect版本
  • requestPermission - 请求API权限
  • apiReflect - 获取API元数据
  • reloadCollection - 从磁盘重新加载集合
  • multi - 批量执行多个操作
  • setDueDate - 覆盖卡片的到期日期
  • suspended - 检查单张卡片的暂停状态
  • saveDeckConfig - 更新卡组配置
  • setDeckConfigId - 为卡组分配配置组
  • cloneDeckConfigId - 克隆卡组配置
  • removeDeckConfigId - 删除卡组配置

Common Workflows

常见工作流程

Check learning progress and mastery

查看学习进度与掌握情况

bash
undefined
bash
undefined

Deck overview: new/learning/review/total counts

卡组概览:新卡片/学习中/复习/总数统计

npx mankey deck stats "Japanese::JLPT N5"
npx mankey deck stats "Japanese::JLPT N5"

Today's study stats

今日学习统计

npx mankey stats today
npx mankey stats today

Due cards with queue breakdown (learning vs review vs new)

待复习卡片的学习中/复习/新卡片分类统计

npx mankey stats due --deck "Japanese::JLPT N5"
npx mankey stats due --deck "Japanese::JLPT N5"

Find well-known cards (high interval = strong retention)

查找已熟练掌握的卡片(复习间隔>30天)

npx mankey run findCards '{"query":"deck:Default prop:ivl>30"}'
npx mankey run findCards '{"query":"deck:Default prop:ivl>30"}'

Get full learning data for specific cards (interval, ease, reps, lapses)

获取指定卡片的完整学习数据(间隔、掌握系数、复习次数、遗忘次数)

npx mankey card info <cardId1> <cardId2>
npx mankey card info <cardId1> <cardId2>

Returns: interval (days until review), factor (ease multiplier),

返回内容包含:interval(下次复习间隔天数)、factor(掌握系数)、

reps (successful reviews), lapses (times forgotten),

reps(成功复习次数)、lapses(遗忘次数)、

queue (0=new, 1=learning, 2=review, 3=relearning),

queue(0=新卡片, 1=学习中, 2=复习, 3=重新学习)、

type (0=new, 1=learning, 2=review, 3=relearn)

type(0=新卡片, 1=学习中, 2=复习, 3=重新学习)

undefined
undefined

Find struggling cards

查找掌握薄弱的卡片

bash
undefined
bash
undefined

Cards failed many times (high lapse count)

查找遗忘次数超过5次的卡片

npx mankey run findCards '{"query":"deck:Default prop:lapses>5"}'
npx mankey run findCards '{"query":"deck:Default prop:lapses>5"}'

Cards with low ease (difficulty multiplier, 2500 = default)

查找掌握系数较低的卡片(默认系数为2500)

npx mankey run findCards '{"query":"deck:Default prop:ease<2.0"}'
npx mankey run findCards '{"query":"deck:Default prop:ease<2.0"}'

Cards currently in relearning (recently forgotten)

查找当前处于重新学习队列的卡片

npx mankey run findCards '{"query":"deck:Default is:learn -is:new"}'
npx mankey run findCards '{"query":"deck:Default is:learn -is:new"}'

Get ease factors for specific cards

获取指定卡片的掌握系数

npx mankey run getEaseFactors '{"cards":[123,456]}'
undefined
npx mankey run getEaseFactors '{"cards":[123,456]}'
undefined

Create cards from content

从内容创建卡片

bash
undefined
bash
undefined

Single card

创建单张卡片

npx mankey note add --deck "Japanese" --model Basic --front "日本語" --back "Japanese language" --tags japanese,vocabulary
npx mankey note add --deck "Japanese" --model Basic --front "日本語" --back "Japanese language" --tags japanese,vocabulary

Bulk create via generic runner

通过通用调用器批量创建卡片

npx mankey run addNotes '{"notes":[ {"deckName":"Japanese","modelName":"Basic","fields":{"Front":"猫","Back":"cat"},"tags":["japanese"]}, {"deckName":"Japanese","modelName":"Basic","fields":{"Front":"犬","Back":"dog"},"tags":["japanese"]} ]}'
npx mankey run addNotes '{"notes":[ {"deckName":"Japanese","modelName":"Basic","fields":{"Front":"猫","Back":"cat"},"tags":["japanese"]}, {"deckName":"Japanese","modelName":"Basic","fields":{"Front":"犬","Back":"dog"},"tags":["japanese"]} ]}'

Cloze deletion

创建完形填空笔记

npx mankey run addNote '{"deckName":"Science","modelName":"Cloze","fields":{"Text":"The {{c1::mitochondria}} is the powerhouse of the cell"}}'
npx mankey run addNote '{"deckName":"Science","modelName":"Cloze","fields":{"Text":"The {{c1::mitochondria}} is the powerhouse of the cell"}}'

Check what fields a model needs before creating

创建前先检查模型所需字段

npx mankey model fields "Basic (and reversed card)"
undefined
npx mankey model fields "Basic (and reversed card)"
undefined

Review cards programmatically

程序化复习卡片

bash
undefined
bash
undefined

Get next due cards in review order (Learning > Review > New)

获取按复习顺序排列的下一批待复习卡片(学习中 > 复习 > 新卡片)

npx mankey card next --deck Default --limit 5
npx mankey card next --deck Default --limit 5

Answer cards: 1=Again 2=Hard 3=Good 4=Easy

标记卡片掌握程度:1=重来 2=困难 3=良好 4=简单

npx mankey card answer <cardId> 3
npx mankey card answer <cardId> 3

Batch answer multiple cards

批量标记多张卡片

npx mankey run answerCards '{"answers":[ {"cardId":123,"ease":3}, {"cardId":456,"ease":4} ]}'
undefined
npx mankey run answerCards '{"answers":[ {"cardId":123,"ease":3}, {"cardId":456,"ease":4} ]}'
undefined

Manage tags and organize

标签管理与内容整理

bash
undefined
bash
undefined

Find all cards with a tag

查找所有包含指定标签的卡片

npx mankey note find "tag:japanese"
npx mankey note find "tag:japanese"

Add tags to notes

为指定笔记添加标签

npx mankey run addTags '{"notes":[123,456],"tags":"vocab important"}'
npx mankey run addTags '{"notes":[123,456],"tags":"vocab important"}'

Replace a tag across entire collection

全局替换标签

npx mankey run replaceTagsInAllNotes '{"tagToReplace":"old-tag","replaceWithTag":"new-tag"}'
npx mankey run replaceTagsInAllNotes '{"tagToReplace":"old-tag","replaceWithTag":"new-tag"}'

Clean up unused tags

清理未使用的标签

npx mankey run clearUnusedTags '{}'
npx mankey run clearUnusedTags '{}'

Move cards between decks

将卡片移动到指定卡组

npx mankey run changeDeck '{"cards":[123,456],"deck":"Japanese::Advanced"}'
undefined
npx mankey run changeDeck '{"cards":[123,456],"deck":"Japanese::Advanced"}'
undefined

Bulk operations and search

批量操作与搜索

bash
undefined
bash
undefined

Search with Anki query syntax

使用Anki查询语法搜索

npx mankey card find "deck:Japanese is:due" --limit 50 npx mankey note find "tag:vocab added:7" # Added in last 7 days npx mankey card find "prop:ivl>90 deck:Default" # Well-known cards
npx mankey card find "deck:Japanese is:due" --limit 50 npx mankey note find "tag:vocab added:7" # 最近7天添加的笔记 npx mankey card find "prop:ivl>90 deck:Default" # 已熟练掌握的卡片

Suspend/unsuspend cards

暂停/恢复卡片

npx mankey card suspend 123 456 789 npx mankey card unsuspend 123 456 789
npx mankey card suspend 123 456 789 npx mankey card unsuspend 123 456 789

Reset cards to new state (clear scheduling)

将卡片重置为新卡片状态(清除复习进度)

npx mankey run forgetCards '{"cards":[123,456]}'
npx mankey run forgetCards '{"cards":[123,456]}'

Reschedule cards

重新设置卡片到期日期

npx mankey run setDueDate '{"cards":[123,456],"days":"0"}' # Due today npx mankey run setDueDate '{"cards":[123,456],"days":"7"}' # Due in 7 days
undefined
npx mankey run setDueDate '{"cards":[123,456],"days":"0"}' # 今日到期 npx mankey run setDueDate '{"cards":[123,456],"days":"7"}' # 7天后到期
undefined

Search Query Syntax

搜索查询语法

QueryMatches
deck:Name
Cards in deck (use quotes for
::
:
"deck:A::B"
)
tag:name
Notes with tag
-tag:name
Notes without tag
is:due
Cards due for review
is:new
New cards (never reviewed)
is:review
Review cards (graduated from learning)
is:learn
Cards in learning phase
is:suspended
Suspended cards
prop:ivl>N
Cards with interval > N days
prop:ease<N
Cards with ease factor < N
prop:lapses>N
Cards failed more than N times
prop:reps>N
Cards reviewed more than N times
added:N
Cards added in last N days
rated:N
Cards rated in last N days
"field:value"
Cards where field contains value
Combine queries with spaces (AND). Example:
deck:Japanese is:due prop:lapses>3
查询语句匹配内容
deck:Name
卡组中的卡片(包含
::
的卡组名需加引号:
"deck:A::B"
tag:name
包含指定标签的笔记
-tag:name
不包含指定标签的笔记
is:due
待复习的卡片
is:new
从未复习过的新卡片
is:review
已从学习阶段毕业的复习卡片
is:learn
处于学习阶段的卡片
is:suspended
已暂停的卡片
prop:ivl>N
复习间隔超过N天的卡片
prop:ease<N
掌握系数低于N的卡片
prop:lapses>N
遗忘次数超过N次的卡片
prop:reps>N
复习次数超过N次的卡片
added:N
最近N天添加的卡片
rated:N
最近N天复习过的卡片
"field:value"
字段包含指定值的卡片
可使用空格组合多个查询条件(逻辑与),示例:
deck:Japanese is:due prop:lapses>3

Key Patterns

核心特性

Pagination: Tools returning lists support
offset
/
limit
. Response includes
pagination: { total, offset, limit, hasMore, nextOffset }
.
Auto-batching:
notesInfo
and
cardsInfo
auto-split requests >100 items.
Input flexibility: IDs accept number/string/array. Tags accept array, space-separated string, or JSON string.
分页功能:返回列表的工具支持
offset
/
limit
参数,响应结果包含
pagination: { total, offset, limit, hasMore, nextOffset }
自动分批
notesInfo
cardsInfo
工具会自动将超过100条的请求分批处理。
输入灵活性:ID参数支持数字、字符串或数组格式;标签参数支持数组、空格分隔字符串或JSON字符串。