Skip to main content

Local-first, automation-grade Anki collection management CLI

Project description

ankicli

ankicli hero

Docs and product site: takhoffman.github.io/ankicli

Standalone agent skill: bundled 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 anki-agent-toolkit

The PyPI distribution is anki-agent-toolkit; the installed command is still ankicli.

Verify

Run the human setup wizard first, then use JSON checks before handing ankicli to an agent:

ankicli --version
ankicli configure
ankicli --json doctor env
ankicli --json doctor backend
ankicli --json profile list
ankicli skill install --target codex

If you skip collection, sync, or agent skill setup, run ankicli configure later to reopen the same wizard.

First Steps

Save your default Anki profile once, then normal commands can omit repeated --profile flags:

ankicli --json profile default
ankicli workspace set --profile "User 1"
ankicli --json workspace show
ankicli --json collection info
ankicli --json search preview --kind notes --query 'deck:Default' --limit 5
ankicli --json note add-tags --id 123 --tag review --dry-run

Human-facing workspace config lives under ~/.ankicli/workspaces/<name>/config.json. The active workspace is default, and you can add more named workspaces for different workflows:

ankicli workspace set --name travel --profile "Travel" --activate
ankicli --workspace travel --json collection info
ankicli workspace use --name default

Sync credentials are stored separately in the system keyring when available, with a platform-specific file fallback if no usable keyring exists.

For a fully explicit setup, use a collection path instead of a profile:

ankicli workspace set --collection /path/to/collection.anki2

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 --json for scripts and agents.
  • Use --dry-run first on write-capable commands.
  • Prefer saved workspace config for day-to-day use: ankicli workspace set --profile "User 1".
  • Prefer --profile for normal local usage and --collection for explicit low-level targeting.
  • Use sync status as the safe preflight before running a real sync.
  • Sync is not backup. Use backup create or the built-in auto-backup flow when rollback matters.
  • Riskier local python-anki writes create an automatic pre-mutation backup unless you pass --no-auto-backup.
  • Real note delete, card suspend, and card unsuspend require --yes.

Docs

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:

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

anki_agent_toolkit-0.1.2.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anki_agent_toolkit-0.1.2-py3-none-any.whl (105.8 kB view details)

Uploaded Python 3

File details

Details for the file anki_agent_toolkit-0.1.2.tar.gz.

File metadata

  • Download URL: anki_agent_toolkit-0.1.2.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anki_agent_toolkit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6bbd8ec1c3e77315f15a2d0842345d91626d3b049c69af0b6322068fe5fb6daa
MD5 bb0d0c4d94639e1d740bc04e0e5d8b86
BLAKE2b-256 80e4c0db43a4f223645812e44eb6f2e9687babd49703bdb4e3a06372dea3164b

See more details on using hashes here.

Provenance

The following attestation bundles were made for anki_agent_toolkit-0.1.2.tar.gz:

Publisher: release.yml on Takhoffman/ankicli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anki_agent_toolkit-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for anki_agent_toolkit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 efbb4404eac33c1ff9b44ebb527537fa0fa9e5eef7f926acba83aac445007794
MD5 b92707862648ddad10f7b7473b335e87
BLAKE2b-256 0434cd7aa336e8de648e7fdf813d05744e2d3206cfd503b1f42e38aafe920ac9

See more details on using hashes here.

Provenance

The following attestation bundles were made for anki_agent_toolkit-0.1.2-py3-none-any.whl:

Publisher: release.yml on Takhoffman/ankicli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page