npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

anki-xml

v0.0.6

Published

Git + Terraform for Anki knowledge. XML-first infrastructure-as-code toolkit for Anki collections.

Readme

anki-import (anki-xml)

Git + Terraform for Anki knowledge. XML-first infrastructure-as-code toolkit for managing Anki collections through structured data files.

Flashcards are treated as code: validate → plan → diff → apply → checkpoint → rollback → sync.

Current release: 0.0.6 — published to npm as anki-xml

This project is not an Anki replacement, a review app, or a GUI automation tool. It speaks to Anki through AnkiConnect only.

Install

npm install -g anki-xml          # install globally
npx anki-xml doctor              # or run without installing
# pin a version
npx [email protected] doctor

See docs/install.md for other methods (build from source).

Bins: anki-import and anki-xml. Requires Node 20+.

Contributor setup (from source): see CONTRIBUTING.md.

Quick start

Workflow: open → doctor → validate → plan → import → rollback.

anki-import open                            # launch the Anki desktop app
anki-import doctor                          # diagnose AnkiConnect with fix steps
anki-import validate cards.xml              # validate without touching Anki
anki-import plan cards.xml                  # preview changes vs collection
anki-import import cards.xml --dry-run      # validate + plan only
anki-import import cards.xml                # create notes (writes a checkpoint)
anki-import rollback import-1234            # undo with one command
<anki deck="Spanish">
  <note type="Basic">
    <field name="Front">Hola</field>
    <field name="Back">Hello</field>
  </note>
</anki>

Supported input formats

XML is canonical, but the same workflow works with:

| Format | Example | |------------|------------------------------------------| | XML | examples/basic.xml | | YAML | examples/cards.yaml | | JSON | examples/cards.json | | Markdown | examples/cards.md | | CSV | examples/cards.csv |

anki-import plan cards.yaml
anki-import sync cards.md --dry-run

Commands

open · doctor · validate · plan · diff · import · sync · rollback ·
checkpoint · watch · anki-sync · tags · models · stats · media · benchmark · mcp
  • open — launch the Anki desktop app (macOS: open -a Anki, Windows: anki.exe, Linux: anki); also via MCP open_anki
  • plan <file> — dry-run preview: adds / updates / duplicates / unchanged
  • diff <file> — per-note field diffs against the live collection
  • import <file> — create notes only (writes a checkpoint)
  • sync [<file>] — reconcile: create + update; without a file, report checkpoint drift. MCP sync mirrors every option (--batch-size, --allow-duplicate, --deck, --model, ...)
  • watch <file> — auto re-validate on change, show the plan, ask before applying (--yes for agents)
  • anki-sync [--check] — AnkiWeb auth + sync: diagnose, trigger sync to AnkiWeb (so phone can pull), cause: "auth" when not logged in
  • mcp — Model Context Protocol server over stdio (optional; 18 tools)
  • --json — machine-readable output with stable error codes everywhere

Troubleshooting AnkiConnect

anki-import doctor explains exactly what is wrong and what to do next:

[FAIL] anki-connect-reachable: Connection refused at http://127.0.0.1:8765 (ECONNREFUSED).
Fix:
  1. Start the Anki app — run: open -a Anki (or open /Applications/Anki.app). AnkiConnect is served from inside Anki and cannot run standalone.
  2. Or let this tool launch it for you: run "anki-import open".
  3. Install the AnkiConnect add-on: in Anki, Tools → Add-ons → Get Add-ons → enter 2055492159.
  4. Restart Anki after installing or enabling the add-on.
  5. Confirm the URL is correct; pass --url <addr> if you configured another port.
Run: anki-import doctor

Every AnkiConnect failure (CLI and MCP) carries the same stable cause/hints/suggestion envelope for AI agents.

Development

Monorepo (bun workspaces, 18 packages):

bun install
bun run test        # vitest — 90+ tests, all AnkiConnect traffic mocked
bun run typecheck
bun run build       # single-file rslib bundle → dist/cli.js (~25 ms startup)
node dist/cli.js --version

Architecture, interfaces, plugin API, testing strategy, release checklist and migration guide: docs/ (start at docs/monorepo-architecture.md).

See CHANGELOG.md for release notes.

License

MIT