Local-first, automation-grade Anki collection management CLI
Project description
ankicli
Docs and product site: takhoffman.github.io/ankicli
Standalone agent skills: agent skills
Goal-driven study: learning plans
ankicli is a local-first Anki CLI for humans who want to install and supervise a safe, scriptable
control surface for agent harnesses like Claude, Codex, OpenClaw, and custom automation.
Installed by humans. Operated by agents.
Supported platforms: macOS, Windows, and Linux.
License: AGPL-3.0-or-later.
Why It Exists
Use ankicli when you want:
- a terminal-native Anki control surface that agents can drive safely
- a human-friendly install and verification path
- profile-aware local collection access
- explicit dry-run, confirmation, backup, and sync-preflight flows
- stable JSON output for automation instead of fragile desktop UI scripting
Install
macOS and Linux:
curl -fsSL https://raw.githubusercontent.com/Takhoffman/ankicli/main/scripts/install.sh | sh
Windows:
irm https://raw.githubusercontent.com/Takhoffman/ankicli/main/scripts/install.ps1 | iex
Fallback package path:
pipx install ankicli
Verify
Run these before handing ankicli to an agent:
ankicli --version
ankicli --json doctor env
ankicli --json doctor backend
ankicli --json profile list
First Steps
Inspect the local environment and confirm the target profile before real work:
ankicli --json profile default
ankicli --json --profile "User 1" collection info
ankicli --json --profile "User 1" search preview --kind notes --query 'deck:Default' --limit 5
ankicli --json --profile "User 1" note add-tags --id 123 --tag review --dry-run
What You Can Do
- inspect profiles, collections, decks, models, tags, cards, and media
- search and preview notes/cards before changing anything
- mutate notes and card state with explicit dry-run and confirmation paths
- create local backups and run explicit restore flows
- inspect auth state and run sync preflight before real sync work
- run local tutor-style study sessions from the terminal
Safety Defaults
- Prefer
--jsonfor scripts and agents. - Use
--dry-runfirst on write-capable commands. - Prefer
--profilefor normal local usage and--collectionfor explicit low-level targeting. - Use
sync statusas the safe preflight before running a real sync. - Sync is not backup. Use
backup createor the built-in auto-backup flow when rollback matters. - Riskier local
python-ankiwrites create an automatic pre-mutation backup unless you pass--no-auto-backup. - Real
note delete,card suspend, andcard unsuspendrequire--yes.
Docs
- Product site: takhoffman.github.io/ankicli
- Agent skills: agent skills
- Learning plans: learning plans
- Recipes: recipes
- CLI guide: cli guide
- Common tasks: common tasks
- Quickstart: quickstart
- Install guide: install
- Profiles and collections: profiles and collections
- Sync and backups: sync and backups
- Study mode: study
- Troubleshooting: troubleshooting
Every major docs page is designed to be readable by humans and easy to copy into an LLM chat.
License
ankicli is licensed under AGPL-3.0-or-later. It depends on the upstream Anki runtime, which is
also AGPL-licensed. See LICENSE.
For Contributors And Advanced Backend Work
The top-level README is intentionally product-oriented. Contributor and backend-contract detail still exists, but it lives in deeper docs and repo files:
- CLI and backend contract:
docs/spec.md - Release/install workflows: product site
- Source and workflows: repository
Common contributor commands:
uv sync --extra dev --frozen
PYTEST_PLUGINS=ankicli.pytest_plugin uv run pytest -c pyproject.toml -m "unit or smoke" --proof-report /tmp/ankicli-proof-report.json
uv run ruff check .
uv build
uv run pytest -m distribution
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anki_agent_toolkit-0.1.0.tar.gz.
File metadata
- Download URL: anki_agent_toolkit-0.1.0.tar.gz
- Upload date:
- Size: 2.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa92e5b98bcb3f8cd422a443efdd0e63f61a71a75c2729154bcfd0edd4ab140a
|
|
| MD5 |
6dcc29895f120a3577c28784082cc5ab
|
|
| BLAKE2b-256 |
e50f8d1ac7510453d605aeefdc224804dd94a985fadb621aced526ce2382e0c5
|
File details
Details for the file anki_agent_toolkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: anki_agent_toolkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 72.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed40630d990fbd705dabdd34d27d101c944e49640f30027e9468c87693b281a6
|
|
| MD5 |
79e7f33d0fae0ad786e8e90a87bf5fac
|
|
| BLAKE2b-256 |
9964668ca4dee85b5dde68ca731a876a8d8463b5d90e621dba24faf9353e5aed
|