Content
# Tool List
[English](README.en.md) |
> Anki Command Line Tool — Manage your Anki cards, notes, and decks in the terminal.
[](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)
Communicate with local Anki desktop via [anki-connect](https://github.com/FooSoft/anki-connect) plugin, providing complete CLI commands and TUI review interface.
## Features
- **Card Management** — Query, suspend, bury, mark, delete cards
- **Note Management** — Create, update, delete, browse notes
- **Deck Management** — List, create, rename, delete decks
- **TUI Review** — Terminal review interface based on Bubbletea, supporting timing, rating feedback, marking, undoing, help panel
- **Search** — Search notes and cards by keywords
- **Statistics** — Today/week/month review statistics, review forecast
- **AI Assistance** — Use LLM to generate cards, explain knowledge points, recommend review plans
- **MCP Server** — Expose Anki operations to LLM clients (e.g., Claude) via stdio protocol
- **Skill Ready** — Integrate into AI clients like Cherry Studio via Skill mechanism
- **Import/Export** — Import and export `.apkg` files
- **Media Management** — Upload, download, delete media files
## Quick Start
### Prerequisites
1. Install [Anki Desktop](https://apps.ankiweb.net/)
2. Install [anki-connect](https://github.com/FooSoft/anki-connect) plugin
3. Launch Anki and keep it running
### Installation
```bash
git clone https://github.com/cicbyte/anki-cli.git
cd anki-cli
go build -o anki-cli
```
### Basic Usage
```bash
# Test connection
./anki-cli ping
# List all decks
./anki-cli deck list
# Review a specific deck
./anki-cli review --deck "Default"
# Enter TUI interface
./anki-cli tui
# Search notes
./anki-cli search "deck:Default java"
```
## Command List
| Command | Description |
|------|------|
| `ping` | Test anki-connect connection |
| `deck` | Manage decks (list / create / rename / delete / info) |
| `note` | Manage notes (list / get / create / update / delete) |
| `card` | Manage cards (list / get / info / suspend / bury / delete) |
| `review` | Review cards (TUI mode, supporting --deck / --limit / --preview) |
| `tui` | Launch TUI interface (supporting --deck / --browse) |
| `search` | Search notes or cards |
| `stats` | View review statistics (supporting --period / --forecast) |
| `ai` | AI assistance (generate / explain / suggest / chat) |
| `import` | Import `.apkg` files |
| `export` | Export decks as `.apkg` files |
| `media` | Manage media files (list / get / store / delete) |
| `tag` | Manage tags |
| `model` | Manage note models |
| `config` | Manage configuration (list / get / set) |
| `mcp` | Launch MCP Server (stdio mode) |
| `version` | Display version information |
All commands support `-f json` output in JSON format.
## Interface Display
### TUI Review Interface

### AI Assistance


### MCP Server

### Skill Integration

## TUI Review Interface
```bash
# Directly review a specific deck
./anki-cli review --deck "English"
# Preview mode (no rating submission)
./anki-cli review --deck "English" --preview
# Limit review quantity
./anki-cli review --deck "English" --limit 10
```
TUI shortcuts:
| Key | Function |
|------|------|
| `Space / Enter` | Flip card |
| `1 / 2 / 3 / 4` | Rating (Again / Hard / Good / Easy) |
| `j / k / ↑ / ↓` | Scroll content |
| `h / l / ← / →` | Navigate cards |
| `f` | Cycle mark color |
| `e` | Edit note |
| `u` | Undo last rating |
| `r` | Refresh cards to review |
| `s` | Skip card |
| `?` | Help panel |
| `q / Esc` | Exit |
## MCP Server
Expose anki-cli as MCP Server to LLM clients:
```json
{
"mcpServers": {
"anki": {
"command": "anki-cli",
"args": ["mcp"]
}
}
}
```
Available tools: `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`
## Configuration
Config file location: `~/.ciclebyte/anki-cli/config/config.yaml`
```bash
# List all config items
./anki-cli config list
# Get a single config
./anki-cli config get server.url
# Set config
./anki-cli config set server.url http://localhost:8765
```
## Tech Stack
- [Go](https://go.dev/) 1.25+
- [Cobra](https://github.com/spf13/cobra) — CLI framework
- [Bubble Tea](https://github.com/charmbracelet/bubbletea) — TUI framework
- [Glamour](https://github.com/charmbracelet/glamour) — Markdown terminal rendering
- [GORM](https://gorm.io/) — ORM
- [Zap](https://github.com/uber-go/zap) — Logging
- [mcp-go](https://github.com/mark3labs/mcp-go) — MCP protocol
## License
[MIT](LICENSE) © 2026 cicbyte