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

autoanki

v1.0.5

Published

CLI tool for newAutoAnki - generate Anki cards from local files

Readme

AutoAnki CLI

把本地 .txt / .md 文件转换成可直接导入 Anki 的 .apkg 卡包。

适合处理课程笔记、文章、章节稿和较长的学习材料。CLI 会自动分块调用 AutoAnki 服务,并把结果合并成一个 Anki 卡包。

安装

npm install -g autoanki@latest

要求 Node.js 14 或更高版本。

检查版本:

autoanki --version

登录

autoanki login

使用 AutoAnki 网页端账号登录。登录后,CLI 会在本机保存登录凭证。

生成卡包

autoanki generate \
  --input notes.md \
  --cards 5 \
  --output notes-deck

生成成功后会得到:

notes-deck.apkg

在 Anki 中选择“文件 -> 导入”,导入这个 .apkg 文件即可。

长文档规则

CLI 会自动切分长文档:

  • 中文:每块约 3500 字
  • 英文:每块约 5500 字符

--cards 表示“每块生成多少张卡”,不是整篇文档总卡数。

例如文档被切成 4 块:

autoanki generate --input chapter.txt --cards 5 --output chapter-deck

预计生成:

4 块 x 5 张/块 = 约 20 张

单块最多 20 张。

模型提供方

默认模型:

autoanki generate \
  --input notes.md \
  --cards 5 \
  --output notes-deck \
  --provider default

Longcat:

autoanki generate \
  --input notes.md \
  --cards 5 \
  --output notes-deck \
  --provider longcat

当服务端开放 Longcat 时,Longcat 路径不消耗 AutoAnki 积分,预览会显示:

预计消耗:0 积分(Longcat 免费试用)

Longcat 是否可用取决于上游服务。如果上游限流,生成可能返回 rate limit 错误。

命令参数

autoanki generate --input <file> --cards <number> --output <name> [options]

必填参数:

| 参数 | 说明 | | --- | --- | | -i, --input <file> | 输入文件,支持 .txt / .md | | -c, --cards <number> | 每块卡片数,最多 20 | | -o, --output <name> | 输出文件名,不需要写 .apkg 后缀 |

可选参数:

| 参数 | 说明 | | --- | --- | | -d, --dir <folder> | 输出目录,默认当前目录 | | -l, --language <zh/en> | 指定语言,默认自动识别 | | -p, --provider <default/longcat> | 模型提供方,默认 default | | --deck <name> | Anki 卡组名,支持 :: 分层 | | -y, --yes | 跳过确认提示 |

常用示例

指定输出目录:

autoanki generate \
  --input notes.md \
  --cards 5 \
  --output notes-deck \
  --dir ~/anki-cards

指定 Anki 卡组名:

autoanki generate \
  --input notes.md \
  --cards 5 \
  --output notes-deck \
  --deck "Study Notes::Chapter 1"

跳过确认:

autoanki generate \
  --input notes.md \
  --cards 5 \
  --output notes-deck \
  --yes

账号命令

查看登录状态:

autoanki whoami

退出登录:

autoanki logout

积分说明

  • default 使用 AutoAnki 正常积分系统。
  • longcat 当前为免费试用路径,CLI 会显示 0 积分。
  • 实际扣费和可用性以服务端配置为准。

常见问题

unknown option '--provider'

说明全局 CLI 版本过旧。升级:

npm install -g autoanki@latest
hash -r
autoanki --version

登录过期

重新登录:

autoanki login

为什么生成数量比 --cards 多?

因为 --cards 是每块数量。长文档会被切成多块:

总卡片数 ≈ 分块数 x --cards

想要更少、更核心的卡片,可以降低 --cards

链接

  • AutoAnki Web: https://www.autoanki.xyz
  • npm: https://www.npmjs.com/package/autoanki