Files
wrong-notebook/packaging/npm
margrop 7d3f75a6a6 docs: 修正 npm 启动提示并补全中英文 README 参数
- 监听成功前提示「正在启动服务」而非访问地址,避免端口冲突误导
- npm README 补全 --host/version/help 参数与英文说明
- 单测覆盖启动提示文案与地址映射
- Refs: https://github.com/margrop/wrong-notebook/issues/158
2026-12-04 22:41:40 +08:00
..

wrong-notebook

错题本:上传题目图片或文字,由 AI 识别、解析并标注知识点,支持错题本管理、练习、统计与打印导出。

项目主页:https://github.com/margrop/wrong-notebook

安装与启动

需要 Node.js 22.15 及以上。

npm install -g wrong-notebook
wrong-notebook                          # 默认监听 0.0.0.0:3000
wrong-notebook --port 8080 --host 127.0.0.1 --data-dir ~/wrong-notebook-data
wrong-notebook version                  # 显示版本
wrong-notebook help                     # 显示帮助

浏览器打开 http://127.0.0.1:3000。首次启动时终端会打印一次性初始化链接(/initialize?token=…),打开后设置管理员邮箱和密码,再进入安装向导配置 AI 渠道并创建第一个错题本。

命令行参数

start 可省略;-h/--help 与 -v/--version 在任意位置都只打印帮助或版本,不启动服务。

参数 说明
-p, --port <端口> 监听端口,默认 3000,也可用环境变量 PORT
-H, --host <地址> 监听地址,默认 0.0.0.0;仅本机访问可设为 127.0.0.1,也可用环境变量 HOSTNAME
-d, --data-dir <目录> 数据目录,默认 ~/.wrong-notebook,也可用环境变量 WRONG_NOTEBOOK_HOME
version 显示当前版本
help 显示用法与全部参数

数据目录

默认 ~/.wrong-notebook,可用 --data-dir 或环境变量 WRONG_NOTEBOOK_HOME 修改,其中包含:

文件 说明
wrong-notebook.db SQLite 数据库
config/app-config.json 应用设置(含 AI API Key)
.nextauth_secret 登录会话密钥,首次启动自动生成

升级:npm install -g wrong-notebook@latest,启动时自动执行数据库迁移,已有数据保留。

常见问题

  • 安装时需要从 Prisma 下载数据库引擎。国内网络较慢时可设置镜像后重装: PRISMA_ENGINES_MIRROR=https://registry.npmmirror.com/-/binary/prisma npm install -g wrong-notebook
  • 使用 --ignore-scripts 安装时,首次启动会自动生成 Prisma Client,需要安装目录可写。
  • 其余环境变量(如 AI_PROVIDER、OPENAI_API_KEY、LOG_LEVEL)与 Docker 部署相同,见仓库 .env.example。

English

wrong-notebook is an AI-powered mistake notebook: upload question photos or text, and AI recognizes, solves and tags them; it also supports notebook management, practice, statistics, printing and export.

Project home: https://github.com/margrop/wrong-notebook. English documentation: README.en.md and doc/wiki/en.

Requires Node.js 22.15 or newer.

npm install -g wrong-notebook
wrong-notebook                          # listens on 0.0.0.0:3000 by default
wrong-notebook --port 8080 --host 127.0.0.1 --data-dir ~/wrong-notebook-data
wrong-notebook version                  # print the version
wrong-notebook help                     # print usage and all options

Open http://127.0.0.1:3000. On first start the terminal prints a one-time initialization link (/initialize?token=…); set the administrator email and password there, then finish the setup wizard to configure AI providers and create the first notebook.

CLI options

The start command may be omitted; -h/--help and -v/--version print help or the version without starting the server, wherever they appear.

Option Description
-p, --port <port> Listen port, default 3000; also PORT
-H, --host <address> Listen address, default 0.0.0.0; use 127.0.0.1 for local access only; also HOSTNAME
-d, --data-dir <dir> Data directory, default ~/.wrong-notebook; also WRONG_NOTEBOOK_HOME
version Print the current version
help Print usage and all options

Data directory

Defaults to ~/.wrong-notebook; change it with --data-dir or WRONG_NOTEBOOK_HOME. It contains wrong-notebook.db (SQLite database), config/app-config.json (settings including AI API keys) and .nextauth_secret (session secret generated on first start).

Upgrade with npm install -g wrong-notebook@latest; database migrations run at startup and existing data is kept.

Notes

  • Installation downloads the Prisma database engine. Behind a slow network in China, set the mirror and reinstall: PRISMA_ENGINES_MIRROR=https://registry.npmmirror.com/-/binary/prisma npm install -g wrong-notebook.
  • With --ignore-scripts, the first start generates Prisma Client itself; the install directory must be writable.
  • Other environment variables (such as AI_PROVIDER, OPENAI_API_KEY, LOG_LEVEL) are the same as Docker deployment; see .env.example in the repository.