# Anki Cli

> A CLI tool for Anki — manage cards, notes, and decks from the terminal, with MCP Server and Skill integration for AI clients. / Anki 命令行工具 — 在终端管理卡片、笔记和牌组，支持 MCP Server 和 Skill 集成，可对接 AI 客户端。

- **Type:** MCP server
- **Install:** `agentstack add mcp-cicbyte-anki-cli`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [cicbyte](https://agentstack.voostack.com/s/cicbyte)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [cicbyte](https://github.com/cicbyte)
- **Source:** https://github.com/cicbyte/anki-cli

## Install

```sh
agentstack add mcp-cicbyte-anki-cli
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# anki-cli

[English](README.en.md) | 简体中文

> Anki 命令行工具 — 在终端管理你的 Anki 卡片、笔记和牌组。

[](https://github.com/cicbyte/anki-cli/releases)
[](https://goreportcard.com/report/github.com/cicbyte/anki-cli)
[](https://img.shields.io/github/license/cicbyte/anki-cli)
[](https://github.com/cicbyte/anki-cli/commits/main)

通过 [anki-connect](https://github.com/FooSoft/anki-connect) 插件与本地 Anki 桌面版通信，提供完整的 CLI 命令和 TUI 复习界面。

## 功能特性

- **卡片管理** — 查询、暂停、搁置、标记、删除卡片
- **笔记管理** — 创建、更新、删除、批量浏览笔记
- **牌组管理** — 列出、创建、重命名、删除牌组
- **TUI 复习** — 基于 Bubbletea 的终端复习界面，支持计时、评分反馈、标记、撤销、帮助面板
- **搜索** — 按关键词搜索笔记和卡片
- **统计** — 今日/周/月复习统计、复习预测
- **AI 辅助** — 利用 LLM 生成卡片、解释知识点、推荐复习计划
- **MCP Server** — 通过 stdio 协议暴露 Anki 操作给 LLM 客户端（如 Claude）
- **Skill Ready** — 通过 Skill 机制集成到 Cherry Studio 等 AI 客户端
- **导入导出** — 导入和导出 `.apkg` 文件
- **媒体管理** — 上传、下载、删除媒体文件

## 快速开始

### 前提条件

1. 安装 [Anki 桌面版](https://apps.ankiweb.net/)
2. 安装 [anki-connect](https://github.com/FooSoft/anki-connect) 插件
3. 启动 Anki 并保持运行

### 安装

```bash
git clone https://github.com/cicbyte/anki-cli.git
cd anki-cli
go build -o anki-cli
```

### 基本使用

```bash
# 测试连接
./anki-cli ping

# 查看所有牌组
./anki-cli deck list

# 复习指定牌组
./anki-cli review --deck "Default"

# 进入 TUI 界面
./anki-cli tui

# 搜索笔记
./anki-cli search "deck:Default java"
```

## 命令一览

| 命令 | 说明 |
|------|------|
| `ping` | 测试 anki-connect 连接 |
| `deck` | 管理牌组（list / create / rename / delete / info） |
| `note` | 管理笔记（list / get / create / update / delete） |
| `card` | 管理卡片（list / get / info / suspend / bury / delete） |
| `review` | 复习卡片（TUI 模式，支持 --deck / --limit / --preview） |
| `tui` | 启动 TUI 界面（支持 --deck / --browse） |
| `search` | 搜索笔记或卡片 |
| `stats` | 查看复习统计（支持 --period / --forecast） |
| `ai` | AI 辅助（generate / explain / suggest / chat） |
| `import` | 导入 `.apkg` 文件 |
| `export` | 导出牌组为 `.apkg` 文件 |
| `media` | 管理媒体文件（list / get / store / delete） |
| `tag` | 管理标签 |
| `model` | 管理笔记模型 |
| `config` | 管理配置（list / get / set） |
| `mcp` | 启动 MCP Server（stdio 模式） |
| `version` | 显示版本信息 |

所有命令支持 `-f json` 输出 JSON 格式。

## 界面展示

### TUI 复习界面

### AI 辅助

### MCP Server

### Skill 集成

## TUI 复习界面

```bash
# 直接进入指定牌组复习
./anki-cli review --deck "English"

# 预览模式（不提交评分）
./anki-cli review --deck "English" --preview

# 限制复习数量
./anki-cli review --deck "English" --limit 10
```

TUI 快捷键：

| 按键 | 功能 |
|------|------|
| `Space / Enter` | 翻转卡片 |
| `1 / 2 / 3 / 4` | 评分（Again / Hard / Good / Easy） |
| `j / k / ↑ / ↓` | 滚动内容 |
| `h / l / ← / →` | 导航卡片 |
| `f` | 循环标记颜色 |
| `e` | 编辑笔记 |
| `u` | 撤销上次评分 |
| `r` | 刷新待复习卡片 |
| `s` | 跳过卡片 |
| `?` | 帮助面板 |
| `q / Esc` | 退出 |

## MCP Server

将 anki-cli 作为 MCP Server 暴露给 LLM 客户端：

```json
{
  "mcpServers": {
    "anki": {
      "command": "anki-cli",
      "args": ["mcp"]
    }
  }
}
```

可用工具：`anki_search_notes`、`anki_get_note`、`anki_create_note`、`anki_update_note`、`anki_delete_note`、`anki_list_decks`、`anki_get_due_cards`、`anki_review_card`、`anki_get_stats`、`anki_list_models`

## 配置

配置文件位置：`~/.ciclebyte/anki-cli/config/config.yaml`

```bash
# 查看所有配置项
./anki-cli config list

# 获取单个配置
./anki-cli config get server.url

# 设置配置
./anki-cli config set server.url http://localhost:8765
```

## 技术栈

- [Go](https://go.dev/) 1.25+
- [Cobra](https://github.com/spf13/cobra) — CLI 框架
- [Bubble Tea](https://github.com/charmbracelet/bubbletea) — TUI 框架
- [Glamour](https://github.com/charmbracelet/glamour) — Markdown 终端渲染
- [GORM](https://gorm.io/) — ORM
- [Zap](https://github.com/uber-go/zap) — 日志
- [mcp-go](https://github.com/mark3labs/mcp-go) — MCP 协议

## 许可证

[MIT](LICENSE) © 2026 cicbyte

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [cicbyte](https://github.com/cicbyte)
- **Source:** [cicbyte/anki-cli](https://github.com/cicbyte/anki-cli)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-cicbyte-anki-cli
- Seller: https://agentstack.voostack.com/s/cicbyte
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
