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

novel-site-cli

v1.1.1

Published

Official Novel Site management CLI for authors and administrators.

Readme

Novel Site CLI

官方 CLI 面向高级作者、站点管理员和平台管理员,用于在 Windows 或 Ubuntu 本机通过远程 API 导入、管理和发布小说内容。

安装方式

正式版从 npm 安装:

npm install -g novel-site-cli
novel --help

要求 Node.js 22 或更新版本。

卸载:

npm uninstall -g novel-site-cli

离线或内部环境也可以使用 .tgz 包安装:

npm install -g ./novel-site-cli-1.1.1.tgz

打包

在仓库根目录执行:

pnpm cli:pack

输出:

release/cli/novel-site-cli-1.1.1.tgz
release/cli/novel-site-cli-1.1.1.tgz.sha256

.tgz.sha256 一起交给离线安装人员。安装前可用系统工具核对 sha256。

配置

CLI 不支持用户密码登录,也不替其他用户创建 API Key。用户必须先在受控后台或自助接口中创建自己的 API Key,然后把 key 配置给 CLI。

管理员 profile 示例:

novel profile add \
  --name prod-admin \
  --base-url https://platform.example.com \
  --api-key nj_live_xxxxx.yyyyy \
  --mode admin \
  --site 10 \
  --author 123

高级作者 profile 示例:

novel profile add \
  --name my-author \
  --base-url https://noveljungle.com \
  --api-key nj_live_xxxxx.yyyyy \
  --mode author

环境变量也可覆盖 profile:

NOVEL_API_BASE_URL
NOVEL_API_KEY
NOVEL_CLI_MODE
NOVEL_SITE_ID
NOVEL_AUTHOR_ID

通用规则

  • 列表命令支持 --page--page-size--all
  • 输出支持 --format table|json,默认表格,脚本集成建议使用 JSON。
  • 破坏性命令使用 --yes 或交互式确认。
  • 管理员内容命令必须显式传 --site <siteId>
  • API 错误会保留 HTTP status、后端 code、message、requestId 和字段错误。

导入命令

novel import preview ./my-import
novel import dry-run ./my-import --site 10 --author 123
novel import push ./my-import --site 10 --author 123 --confirm
novel import jobs
novel import job <jobId>

高级作者可省略 --site--author

novel import dry-run ./my-book
novel import push ./my-book --confirm

导入包的 book.jsonimport.json 中,chapters[] 可带结构化脚注:

{
  "externalChapterId": "001",
  "title": "Chapter 1",
  "file": "chapters/001.md",
  "footnotes": [{ "key": "1", "content": "Footnote text." }]
}

作者作品和章节

novel books list --deleted active
novel books get <bookId>
novel books create --title "Title" --summary "..." --language en --category-ids 1,2
novel books update <bookId> --title "New Title"
novel books trash <bookId> --yes
novel books restore <bookId> --yes
novel books delete <bookId> --permanent --yes
novel books submit-review <bookId> --yes
novel books complete <bookId> --yes
novel books cover set <bookId> --file ./cover.jpg
novel books cover remove <bookId> --yes

novel chapters list --book <bookId>
novel chapters get <chapterId>
novel chapters create --book <bookId> --title "Chapter 1" --file ./001.md
novel chapters update <chapterId> --title "Chapter 1 fixed" --file ./001-fixed.md
novel chapters update <chapterId> --footnotes-file ./001-footnotes.json
novel chapters update <chapterId> --footnotes '[{"key":"1","content":"..."}]'
novel chapters trash <chapterId> --yes
novel chapters restore <chapterId> --yes
novel chapters delete <chapterId> --permanent --yes

草稿、发布和修订

novel drafts books
novel drafts chapters --book <bookId>
novel drafts publish --books 1,2 --chapters 10,11 --dry-run
novel drafts publish --books 1,2 --chapters 10,11 --yes

novel chapters publish <chapterId> --yes
novel chapters schedule <chapterId> --at "2026-06-01T10:00:00Z" --yes
novel chapters free-schedule <chapterId> --at "2026-07-01T10:00:00Z" --yes
novel chapters free-schedule <chapterId> --clear --yes
novel chapters revisions <chapterId>
novel chapters revision get <chapterId> <revisionId>
novel chapters revision restore <chapterId> <revisionId> --yes

管理员内容管理

novel admin books list --site <siteId>
novel admin books get <bookId> --site <siteId>
novel admin books update <bookId> --site <siteId> --title "..."
novel admin books trash <bookId> --site <siteId> --yes
novel admin books restore <bookId> --site <siteId> --yes
novel admin books delete <bookId> --site <siteId> --permanent --yes
novel admin books review <bookId> approve --site <siteId> --note "ok"

novel admin chapters list --site <siteId> --book <bookId>
novel admin chapters get <chapterId> --site <siteId>
novel admin chapters update <chapterId> --site <siteId> --file ./fixed.md
novel admin chapters update <chapterId> --site <siteId> --footnotes-file ./fixed-footnotes.json
novel admin chapters trash <chapterId> --site <siteId> --yes
novel admin chapters restore <chapterId> --site <siteId> --yes
novel admin chapters delete <chapterId> --site <siteId> --permanent --yes
novel admin chapters review <chapterId> reject --site <siteId> --note "reason"

novel admin reviews list --site <siteId> --moderation-status visible
novel admin reviews moderate <reviewId> hidden --site <siteId> --note "spoiler"

分类、标签和译本组

novel admin categories list --site <siteId>
novel admin categories create --site <siteId> --name "Fantasy"
novel admin categories update <categoryId> --site <siteId> --name "Adventure"
novel admin categories delete <categoryId> --site <siteId> --yes

novel admin tags list --site <siteId>
novel admin tags create --site <siteId> --name "Hot"
novel admin tags update <tagId> --site <siteId> --description "..."
novel admin tags delete <tagId> --site <siteId> --yes

novel admin translation-groups list
novel admin translation-groups create --canonical-title "Clockwork Orchard"
novel admin translation-groups update <groupId> --description "Shared timeline"
novel admin translation-groups add-book <groupId> --book <bookId> --role translation --source-book <bookId>
novel admin translation-groups remove-book <groupId> --book <bookId> --yes

媒体、统计和收益

novel admin chapters audio list <chapterId> --site <siteId>
novel admin chapters audio upload <chapterId> --site <siteId> --file ./chapter.mp3 --language en
novel admin chapters audio delete <chapterId> <audioId> --site <siteId> --yes

novel stats --range 30d
novel revenue summary
novel revenue books --source membership
novel revenue ledger --book <bookId> --status settleable

novel admin users list --site <siteId> --role author
novel admin users get <userId> --site <siteId>
novel admin users book-revenue <userId> --site <siteId> --from 2026-05-01 --to 2026-05-31
novel admin revenue ledger --site <siteId> --author <userId>
novel admin revenue reconciliation --site <siteId> --from 2026-05-01 --to 2026-05-31

版本策略

  • 1.0.0:npm public 正式版,稳定 profile、导入和打包合同。
  • 1.1.0:补齐作者作品/章节/草稿/发布/修订、管理员内容、分类标签、译本组、媒体、统计和收益只读命令。
  • 1.1.1:补齐章节脚注写入、导入包脚注透传、书籍直接提审和标记完结命令。
  • patch:修 bug,不改变命令合同。
  • minor:新增兼容命令或字段。
  • major:破坏性命令或目录格式变更。