WhackSmacker is a Node.js command-line application for reviewing Anki cards from a terminal. It talks to a locally running Anki instance through the AnkiConnect add-on.
Milestone: v0.001
Package version: 0.0.1
Future Git tag after manual validation: v0.0.1
- Node.js 18 or newer.
- Anki running on the same machine.
- The AnkiConnect add-on installed and enabled in Anki.
- AnkiConnect reachable at
http://127.0.0.1:8765.
Install AnkiConnect from Anki with Tools -> Add-ons -> Get Add-ons, then use the add-on code published by AnkiConnect. Restart Anki after installing the add-on.
For local development:
npm install
npm run build
npm linkAfter linking, the executable is:
whacksmackerFor a no-publish package smoke test:
npm pack
npm install -g ./whacksmacker-0.0.1.tgz
whacksmacker status
npm uninstall -g whacksmackerDo not publish this milestone to npm.
Check whether AnkiConnect is reachable and usable:
whacksmacker statusList available Anki decks:
whacksmacker decksStart a terminal review session for a deck:
whacksmacker review Default
whacksmacker review Languages::Japanese
whacksmacker review "Deck With Spaces"During review:
- Press Enter to reveal the answer.
- Enter one of the answer choices shown for the current card.
- Enter
qbefore reveal or at the rating prompt to stop cleanly. - Press Ctrl-C to interrupt the session.
The review command continues until the Anki review queue is empty or you quit.
If whacksmacker status prints Unable to reach AnkiConnect:
- Start Anki.
- Confirm the AnkiConnect add-on is installed and enabled.
- Restart Anki after installing or changing add-ons.
- Check that no firewall or local security tool is blocking
127.0.0.1:8765.
If a command prints AnkiConnect API error, WhackSmacker reached AnkiConnect but AnkiConnect rejected the request. Common causes include a missing deck, an unavailable deck, or Anki not being in a state where the requested review action is valid.
If a command prints Malformed AnkiConnect response, AnkiConnect or another service on port 8765 returned a response WhackSmacker does not understand.
Build:
npm run buildRun tests with mocked AnkiConnect responses:
npm testRun the built CLI directly:
node dist/main.js statusTests use local mock HTTP servers and do not require a running Anki instance.
Before creating Git tag v0.0.1, validate against a real local Anki instance:
- Start Anki with AnkiConnect enabled.
- Run
whacksmacker status; confirm it reports AnkiConnect available and shows an API version. - Run
whacksmacker decks; confirm known deck names are listed. - Run
whacksmacker review <deck-name>for a deck with due cards. - Reveal a card, answer with each available choice style that appears, and confirm Anki accepts the answer.
- Let a short queue complete and confirm WhackSmacker reports the number of answered cards.
- Run review on a deck with no due cards and confirm it reports an empty queue cleanly.
- Start a review and enter
q; confirm it stops without answering the current card. - Start a review and press Ctrl-C; confirm the terminal returns cleanly with exit code
130. - Stop Anki and run
whacksmacker status; confirm it reports a connection failure.
Only create tag v0.0.1 after this checklist succeeds.