Skip to content

Command reference

This reference is generated from the command-line interface definition.

Bulk-process Anki flashcards with LLMs

Usage

Usage: anki-llm <COMMAND>

Options

  • -h, --help: Print help
  • -V, --version: Print version

Export an Anki deck to CSV or YAML

Usage

Usage: anki-llm export [OPTIONS] <DECK|--query <QUERY>>

Arguments

  • [DECK]: Deck name to export

Options

  • -q, --query <QUERY>: Anki search query (e.g. “tag:leech”, “prop:lapses>3”, “deck:Japanese -field:Audio”)
  • -o, --output <OUTPUT>: Output file path
  • -n, --note-type <NOTE_TYPE>: Filter by note type (required if deck contains multiple note types)
  • -h, --help: Print help

Import CSV or YAML file into an Anki deck

Usage

Usage: anki-llm import [OPTIONS] --deck <DECK> <INPUT>

Arguments

  • <INPUT>: Input file path (CSV or YAML)
    • Required: yes

Options

  • -d, --deck <DECK>: Target Anki deck name
    • Required: yes
  • -n, --note-type <NOTE_TYPE>: Anki note type name (inferred from deck if not specified)
  • -k, --key-field <KEY_FIELD>: Field name to use for identifying existing notes (auto-detected if not specified)
  • -h, --help: Print help

Process notes from a file with AI (supports resume)

Usage

Usage: anki-llm process-file [OPTIONS] --prompt <PROMPT> --output <OUTPUT> <INPUT>

Arguments

  • <INPUT>: Input file path (CSV or YAML)
    • Required: yes

Options

  • -p, --prompt <PROMPT>: Path to prompt template file (frontmatter declares output.field or output.fields)
    • Required: yes
  • -o, --output <OUTPUT>: Output file path (CSV or YAML)
    • Required: yes
  • -m, --model <MODEL>: Model name
  • --api-base-url <API_BASE_URL>: Custom API base URL (e.g. https://openrouter.ai/api/v1, http://localhost:11434/v1)
  • --api-key <API_KEY>: API key (overrides environment variables)
  • --reasoning-effort <REASONING_EFFORT>: Reasoning effort passed to the model provider
  • -b, --batch-size <BATCH_SIZE>: Number of concurrent requests
    • Default: 5
  • -t, --temperature <TEMPERATURE>: Sampling temperature (0-2)
  • --max-tokens <MAX_TOKENS>: Maximum tokens per completion
  • -r, --retries <RETRIES>: Number of retries on failure
    • Default: 3
  • -f, --force: Re-process all rows, ignoring existing output
    • Default: false
  • -d, --dry-run: Preview without making API calls
    • Default: false
  • -P, --preview: Process a sample of cards with the LLM and show what would change
    • Default: false
  • --preview-count <PREVIEW_COUNT>: Number of cards to process in preview mode (default: 3)
    • Default: 3
  • --limit <LIMIT>: Limit the number of rows to process
  • --log <LOG>: Append raw LLM prompts and responses to a log file (relative path)
  • --very-verbose: Print raw LLM prompts and responses to stderr
    • Default: false
  • -h, --help: Print help

Process notes directly from an Anki deck

Usage

Usage: anki-llm process-deck [OPTIONS] --prompt <PROMPT> <DECK|--query <QUERY>>

Arguments

  • [DECK]: Deck name to process

Options

  • -q, --query <QUERY>: Anki search query (e.g. “tag:leech”, “prop:lapses>3”, “deck:Japanese prop:lapses>5”)
  • -p, --prompt <PROMPT>: Path to prompt template file (frontmatter declares output.field or output.fields)
    • Required: yes
  • -n, --note-type <NOTE_TYPE>: Filter by note type (required if deck contains multiple note types)
  • -m, --model <MODEL>: Model name
  • --api-base-url <API_BASE_URL>: Custom API base URL (e.g. https://openrouter.ai/api/v1, http://localhost:11434/v1)
  • --api-key <API_KEY>: API key (overrides environment variables)
  • --reasoning-effort <REASONING_EFFORT>: Reasoning effort passed to the model provider
  • -b, --batch-size <BATCH_SIZE>: Number of concurrent requests
    • Default: 5
  • -t, --temperature <TEMPERATURE>: Sampling temperature (0-2)
  • --max-tokens <MAX_TOKENS>: Maximum tokens per completion
  • -r, --retries <RETRIES>: Number of retries on failure
    • Default: 3
  • -d, --dry-run: Preview without making API calls
    • Default: false
  • -P, --preview: Process a sample of cards with the LLM and show what would change
    • Default: false
  • --preview-count <PREVIEW_COUNT>: Number of cards to process in preview mode (default: 3)
    • Default: 3
  • --limit <LIMIT>: Limit the number of notes to process
  • -f, --force: Re-process notes even if the target field already has content
    • Default: false
  • --log <LOG>: Append raw LLM prompts and responses to a log file (relative path)
  • --very-verbose: Print raw LLM prompts and responses to stderr
    • Default: false
  • -h, --help: Print help

Query AnkiConnect API

Usage

Usage: anki-llm query <ACTION> [PARAMS]

Arguments

  • <ACTION>: AnkiConnect action name
    • Required: yes
  • [PARAMS]: JSON parameters

Options

  • -h, --help: Print help

Manage persistent configuration

Usage

Usage: anki-llm config <COMMAND>

Options

  • -h, --help: Print help

Get a configuration value

Usage

Usage: anki-llm config get <KEY>

Arguments

  • <KEY>: Config key
    • Required: yes

Options

  • -h, --help: Print help

Set a configuration value

Usage

Usage: anki-llm config set <KEY> <VALUE>

Arguments

  • <KEY>: Config key
    • Required: yes
  • <VALUE>: Config value
    • Required: yes

Options

  • -h, --help: Print help

Unset a configuration value

Usage

Usage: anki-llm config unset <KEY>

Arguments

  • <KEY>: Config key
    • Required: yes

Options

  • -h, --help: Print help

List all configuration settings

Usage

Usage: anki-llm config list

Options

  • -h, --help: Print help

Show the config file path

Usage

Usage: anki-llm config path

Options

  • -h, --help: Print help

Generate Anki cards using an LLM

Usage

Usage: anki-llm generate [OPTIONS] [TERM]

Arguments

  • [TERM]: Term to generate cards for (omit to enter interactively in TUI)

Options

  • -p, --prompt <PROMPT>: Path to prompt template file with frontmatter (auto-resolved from the workspace’s prompts/ if omitted)
  • -c, --count <COUNT>: Number of card examples to generate
    • Default: 3
  • -m, --model <MODEL>: Model name
  • --api-base-url <API_BASE_URL>: Custom API base URL (e.g. https://openrouter.ai/api/v1, http://localhost:11434/v1)
  • --api-key <API_KEY>: API key (overrides environment variables)
  • --reasoning-effort <REASONING_EFFORT>: Reasoning effort passed to the model provider
  • -d, --dry-run: Preview without importing to Anki
    • Default: false
  • -r, --retries <RETRIES>: Number of retries for failed requests
    • Default: 3
  • --max-tokens <MAX_TOKENS>: Maximum tokens per response
  • -t, --temperature <TEMPERATURE>: LLM temperature (0-2)
  • -o, --output <OUTPUT>: Export cards to a file instead of importing to Anki
  • --copy: Copy prompt to clipboard for manual LLM mode
    • Default: false
  • --log <LOG>: Append raw LLM prompts and responses to a log file (relative path)
  • --very-verbose: Print raw LLM prompts and responses to stderr
    • Default: false
  • -h, --help: Print help

Create a prompt template by querying your Anki collection

Usage

Usage: anki-llm generate-init [OPTIONS] [OUTPUT]

Arguments

  • [OUTPUT]: Output file path

Options

  • -m, --model <MODEL>: Model name
  • --api-base-url <API_BASE_URL>: Custom API base URL (e.g. https://openrouter.ai/api/v1, http://localhost:11434/v1)
  • --api-key <API_KEY>: API key (overrides environment variables)
  • --reasoning-effort <REASONING_EFFORT>: Reasoning effort passed to the model provider
  • -t, --temperature <TEMPERATURE>: LLM temperature (0-2)
  • --copy: Copy prompt to clipboard for manual LLM mode
    • Default: false
  • -h, --help: Print help

List past process-deck runs with snapshot data

Usage

Usage: anki-llm history

Options

  • -h, --help: Print help

Rollback a previous process-deck run

Usage

Usage: anki-llm rollback [OPTIONS] <RUN_ID>

Arguments

  • <RUN_ID>: Run ID to rollback (from history command)
    • Required: yes

Options

  • --force: Force rollback even if notes were modified after the run
    • Default: false
  • -d, --dry-run: Preview without making changes
    • Default: false
  • -h, --help: Print help

Generate text-to-speech audio for notes and upload to Anki’s media store

Usage

Usage: anki-llm tts [OPTIONS] [DECK]

Arguments

  • [DECK]: Deck name to process (defaults to deck from --prompt frontmatter)

Options

  • -q, --query <QUERY>: Anki search query (e.g. “tag:leech”, “deck:Japanese -Audio:”)
  • --prompt <PROMPT>: Path to a generate prompt YAML; reads its tts: block instead of taking deck-design flags on the CLI
  • --field <FIELD>: Target field to write [sound:…] into (flag mode; required)
  • -p, --template <TEMPLATE>: Path to prompt template file (flag mode)
  • --text-field <TEXT_FIELD>: Source field name (flag mode; alternative to --template)
  • --provider <PROVIDER>: TTS provider identifier (flag mode; defaults to “openai”)
  • --voice <VOICE>: Voice name (flag mode; provider-specific, e.g. alloy)
  • --tts-model <TTS_MODEL>: TTS backing model (flag mode; e.g. gpt-4o-mini-tts)
  • --format <FORMAT>: Output audio format (flag mode; defaults to “mp3”)
  • --speed <SPEED>: Playback speed (flag mode; 1.0 = normal)
  • --api-base-url <API_BASE_URL>: API base URL override (OpenAI or OpenAI-compatible providers)
  • --api-key <API_KEY>: API key override. Used as the OpenAI bearer token or the Azure subscription key depending on the active provider
  • --azure-region <AZURE_REGION>: Azure region override (flag mode; provider must be ‘azure’)
  • --aws-region <AWS_REGION>: AWS region override for Amazon Polly (flag mode; provider must be ‘amazon’)
  • --aws-access-key-id <AWS_ACCESS_KEY_ID>: AWS access key id for Amazon Polly (flag mode)
  • --aws-secret-access-key <AWS_SECRET_ACCESS_KEY>: AWS secret access key for Amazon Polly (flag mode)
  • -n, --note-type <NOTE_TYPE>: Filter by note type (flag mode; rejected in --prompt mode)
  • -b, --batch-size <BATCH_SIZE>: Number of concurrent TTS requests
    • Default: 5
  • -r, --retries <RETRIES>: Number of retries on transient failures
    • Default: 3
  • -f, --force: Regenerate audio even for notes whose target field already contains a sound tag
    • Default: false
  • -d, --dry-run: Preview without making API calls or mutating Anki
    • Default: false
  • --limit <LIMIT>: Limit the number of notes to process
  • -h, --help: Print help

Browse and audition TTS voices across OpenAI / Azure / Google / Polly

Usage

Usage: anki-llm tts-voices [OPTIONS]

Options

  • --lang <LANG>: Pre-filter by language code prefix, e.g. “ja” or “en-US”
  • --provider <PROVIDER>: Pre-filter by provider id (openai, azure, google, amazon, edge)
  • -q, --query <QUERY>: Initial text query for the omni-search field
  • -h, --help: Print help

Update anki-llm to the latest version

Usage

Usage: anki-llm update

Options

  • -h, --help: Print help

Show the complete documentation bundle offline

Usage

Usage: anki-llm docs

Options

  • -h, --help: Print help

Manage anki-llm workspaces

Usage

Usage: anki-llm workspace <COMMAND>

Options

  • -h, --help: Print help

Initialize a new workspace in the current or specified directory

Usage

Usage: anki-llm workspace init [DIR]

Arguments

  • [DIR]: Directory to initialize (defaults to current directory)

Options

  • -h, --help: Print help

Show information about the current workspace

Usage

Usage: anki-llm workspace info

Options

  • -h, --help: Print help

Manage Anki note type templates and CSS

Usage

Usage: anki-llm note-type <COMMAND>

Options

  • -h, --help: Print help

Pull note type templates and CSS from Anki into local files

Usage

Usage: anki-llm note-type pull [OPTIONS] <NAME>

Arguments

  • <NAME>: Note type name (as shown in Anki)
    • Required: yes

Options

  • --force: Overwrite existing local files without prompting
    • Default: false
  • -h, --help: Print help

Push local templates and CSS to Anki

Usage

Usage: anki-llm note-type push [OPTIONS] <NAME|--all>

Arguments

  • [NAME]: Note type name (as shown in Anki)

Options

  • --all: Push all note types in the workspace
    • Default: false
  • -d, --dry-run: Preview changes without modifying Anki
    • Default: false
  • --no-snapshot: Skip snapshot before push
    • Default: false
  • --force: Push even if Anki has diverged from the last known remote state
    • Default: false
  • -h, --help: Print help

Show which note types have un-pushed changes

Usage

Usage: anki-llm note-type status

Options

  • -h, --help: Print help

Diagnose configuration and provider connectivity

Usage

Usage: anki-llm doctor [OPTIONS]

Options

  • --check: Verify provider authentication and AnkiConnect reachability over the network
    • Default: false
  • -h, --help: Print help