ChatGPT → Anki

This folder is a small inbox for English flashcards. The cards are generated during our English conversations; GitHub stores the inbox, while AnkiWeb is responsible for the actual synchronization between Linux and AnkiMobile on iPhone.

Desktop SOCKS5 proxy

Required on this Linux desktop: Anki must reach AnkiWeb through the SOCKS5 proxy at 127.0.0.1:10808. The sync request is executed inside the running Anki process, not by the Python importer. Setting a proxy on the importer alone will not fix AnkiWeb access.

From the repository root, quit any already-running Anki instance completely and start it using the included launcher:

bash '5 Английский/Anki/anki_proxy.sh'

The launcher sets HTTP_PROXY and HTTPS_PROXY to socks5://127.0.0.1:10808 and sets NO_PROXY for local addresses before running anki. The SOCKS5 proxy itself must already be listening. If your installed executable is named something other than anki, adjust the last line of anki_proxy.sh.

Important: launching Anki normally from your desktop app menu will not necessarily apply these settings. Configure that launcher to invoke the wrapper if you want every graphical launch to use the proxy. The timer itself does not launch Anki.

Local AnkiConnect requests use http://127.0.0.1:8765 directly, even if the importer’s environment has proxy variables. GitHub fetching uses your existing Git network configuration rather than forcing it through this Anki-specific proxy.

Initial setup (Linux)

  1. Install the official Anki desktop app, start it via the SOCKS5 wrapper above, and sign in to the same AnkiWeb account you already use in AnkiMobile. If the iPhone is your existing source of cards, sync it first, then choose Download on an initially empty Linux Anki profile. Do not overwrite a populated collection without first making a backup.

  2. On Linux Anki, open Tools → Add-ons → Get Add-ons, install AnkiConnect using code 2055492159, and restart Anki. Keep Anki running whenever you want new cards imported.

  3. In your local clone of this repository, pull the latest commit once and run:

    python3 ‘5 Английский/Anki/anki_sync.py’

  4. If the manual run succeeds, install the user-level systemd timer:

    python3 ‘5 Английский/Anki/anki_sync.py’ —install-timer

Check it with systemctl --user status chatgpt-anki-import.timer and see logs with journalctl --user -u chatgpt-anki-import.service -n 30 --no-pager.

On each run, the script fetches the remote main card inbox without modifying your local working tree, adds new cards through AnkiConnect (without adding duplicates), and requests an AnkiWeb sync. The systemd timer runs around every 15 minutes while Linux is running, but Anki must be open and started with the proxy for AnkiWeb sync to work. On iPhone, tap Synchronize in AnkiMobile to receive the cards. This is not an always-online cloud Anki importer.

Cards

  • cards.jsonl is the source of truth for candidate new cards, not for your Anki reviews or scheduling. One JSON object per line with id, type, front, back and tags.
  • Cards are kept in the separate English::ChatGPT deck by default. If you want an existing deck instead, change the ANKI_DECK environment variable for the systemd service (or ask me to configure it).
  • Use one focused question per card and short examples in English. We capture explicitly unfamiliar items and meaningful recurring errors, not every small typo.
  • A card’s Front must stay stable after import. Edit imported notes in Anki itself; this simple importer does not propagate GitHub edits or deletions to existing notes.
  • Never commit AnkiWeb login details, private conversations, or collection database files here. This repository may feed a public Quartz website.

Disable the timer

Run systemctl --user disable --now chatgpt-anki-import.timer. The cards already in Anki will remain there.

Sources: AnkiWeb syncing guide, AnkiMobile syncing, AnkiConnect, Anki SOCKS5 troubleshooting.