Skip to main content

Terminal-based Anki review client using native Anki backend

Project description

Clanki

Clanki

Clanki is a terminal-based Anki review client that lets you review your Anki flashcards directly from the terminal. It uses the same underlying database and scheduling as Anki Desktop, so your progress stays perfectly in sync.

Clanki demo

Features

Feature Supported
Anki scheduling algorithms
Image rendering
Audio playback ✅ (macOS/Linux/Windows)
Basic cards
Cloze cards
Type in the answer 🚧 (planned)
Image occlusion
Custom card styling

Prerequisites

  • Python 3.10 or later
  • Anki Desktop installed with at least one synced profile
  • Anki Desktop must be closed when running clanki
  • For Linux/Windows audio playback: ffplay (from FFmpeg) available in PATH

Installation

Using uv (Recommended)

uv is the fastest way to install Python tools.

uv tool install clanki

This installs clanki as a global command - no venv activation needed.

Using pipx

pipx install clanki

Using pip (with venv)

python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install clanki

Setup

Initial Sync (Required)

Before using clanki, you must sync your Anki collection at least once using Anki Desktop. This ensures your collection database exists and authentication credentials are cached.

If you already have Anki Desktop installed and synced with your AnkiWeb account, you can skip these steps.

  1. Open Anki Desktop
  2. Sign in to your AnkiWeb account
  3. Sync your collection (Sync button or press Y)
  4. Close Anki Desktop

Verify Installation

# Check version
clanki --version

# Or run as a module
python -m clanki --version

Usage

Simply run clanki to launch the TUI:

clanki

Sync with AnkiWeb

Clanki writes directly to your local Anki database. Syncing is not automatic, run this command to push your progress to AnkiWeb:

clanki sync

Sync after reviewing, or before starting if you've reviewed on another device. You can also sync as you would normally through the Anki Desktop app.

Troubleshooting

"No Anki profiles found"

Cause: Clanki cannot find your Anki data directory or no profiles exist.

Solutions:

  1. Ensure Anki Desktop has been installed and run at least once
  2. Sync your collection in Anki Desktop at least once
  3. Check that profiles exist in your Anki data directory:
    • macOS: ~/Library/Application Support/Anki2/
    • Linux: ~/.local/share/Anki2/ (or $XDG_DATA_HOME/Anki2/)
    • Windows: %APPDATA%/Anki2/

"Collection not found for profile"

Cause: The profile directory exists but doesn't contain a collection database.

Solution: Open Anki Desktop, select the profile, and sync to create the collection.

Sync fails with "No sync credentials found"

Cause: AnkiWeb credentials are not cached locally.

Solution: Open Anki Desktop, sign in to AnkiWeb, and sync at least once. This caches your credentials for clanki to use.

Advanced Configuration

Custom Anki Data Directory

If your Anki data is stored in a non-standard location, set the ANKI_BASE environment variable:

export ANKI_BASE="/path/to/custom/Anki2"
clanki

This is useful for:

  • Portable Anki installations
  • Multiple Anki installations
  • Testing with a separate data directory

Roadmap

Planned

  • More review actions (bury, suspend, flag, etc.)

    added v0.1.3

  • Audio playback on Linux/Windows (via ffplay)

    added v0.1.4

  • Custom decks (filtered decks)

  • Support for type in answer cards

  • Profile switching within the TUI

  • Review statistics

  • Ability to run program with Anki desktop app open

Not Currently Planned

  • Ability to create or edit cards/decks
  • Rendering custom card styles
  • Plugin support
  • Math/LaTeX rendering

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

clanki-0.1.4.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

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

clanki-0.1.4-py3-none-any.whl (87.7 kB view details)

Uploaded Python 3

File details

Details for the file clanki-0.1.4.tar.gz.

File metadata

  • Download URL: clanki-0.1.4.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","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

Hashes for clanki-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8bc4e4e1b8ecdf3d2796cb6ee9e8ff073ed8a84415936df0221266f2c54827d5
MD5 ac3b61e62e71d4099d8f889ac5fd261c
BLAKE2b-256 31641785c6fd1d8fb6b4cac9bc02b7b210b0f5878f213b6feff4ea91ebac4636

See more details on using hashes here.

File details

Details for the file clanki-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: clanki-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 87.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","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

Hashes for clanki-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 85627cac74ad63403239ac2321185e87b38dca3c74562e0a2a07ff9be4547b7e
MD5 f1a380585b49b0bf03d2d418fa4fd81d
BLAKE2b-256 a47a2b7076787df8e75b67e2cf8b3760584d81b9aa4c9de493be600700127c17

See more details on using hashes here.

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