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

@aronnaxlin/bgm-cli

v1.0.0

Published

Command-line client for Bangumi.

Readme

bgm-cli

简体中文 | 繁體中文(台灣) | English

bgm-cli 是一個面向 Bangumi 的命令列工具,目標是讓使用者能快速在終端機中完成常見查詢、讀取與部分寫入操作。

快速開始

執行需求

  • Node.js >= 20

安裝

npm / npx:

npx @aronnax/bgm-cli --help
npm install -g @aronnax/bgm-cli

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/aronnaxlin/bgm-cli/main/scripts/install-remote.sh | sh

Windows PowerShell:

irm https://raw.githubusercontent.com/aronnaxlin/bgm-cli/main/scripts/install-remote.ps1 | iex

如果你已經在本地 clone 倉庫,也可以直接執行:

./bgm --help

認證

建議路徑是使用官方 Bangumi 登入:

bgm --init

bgm --init 會優先提供官方登入,也保留 Access Token 作為第二種渠道。如果你已經有 Token,也可以直接保存:

bgm auth set-token YOUR_ACCESS_TOKEN
bgm auth token-status

代理

如果你所在網路存取 Bangumi API 不穩定,可以為所有 CLI 請求設定 HTTP/HTTPS 代理:

bgm proxy set http://127.0.0.1:7890
bgm proxy show

也可以只對單次命令使用環境變數:

BGM_PROXY=http://127.0.0.1:7890 bgm subject get 8

代理優先級為:bgm proxy set 持久化設定 > BGM_PROXY > HTTPS_PROXY / HTTP_PROXY

常用命令

bgm user me
bgm subject search "Heike Monogatari" --type anime --limit 5
bgm subject get 348335
bgm subject comments 348335 --limit 5
bgm character search "明日香" --limit 3
bgm person search "庵野" --limit 3
bgm collection get 348335
bgm collection indexes --user sai --limit 5
bgm group list --sort members --limit 10
bgm group user sai --limit 5
bgm index user sai --limit 5
bgm trending subjects --type anime --limit 5
bgm --json user me

文件索引

拆分後的詳細文件目前統一以簡體中文維護於 docs/ 之下。

核心風險與邊界

  • 本專案不是 Bangumi 官方產品,與 Bangumi 官方沒有隸屬關係。
  • 一般使用者應優先使用 bgm --init 裡的官方登入;Access Token 保留給相容與腳本場景,OAuth / hosted backend 不應視為預設主路徑。
  • 一部分社群寫入操作依賴 Turnstile;本輪機器驗證已跳過這類人機驗證步驟,相關寫入操作仍需要人工複測,且部分實驗性寫入目前仍可能遇到 Bangumi 伺服器端失敗。
  • 若要做腳本整合,建議優先使用 --json,不要依賴人類可讀輸出的文字格式。
  • Bangumi 建議客戶端使用可識別開發者與應用程式身分的自訂 User-Agent

致謝與承認

  • 感謝 bgm.tv 提供 Bangumi 主站與社群生態。
  • 感謝 bangumi/server-private 提供 private API 相關實作參考。
  • 感謝 bangumi/api 提供公開 API 相關實作與文件基礎。
  • 感謝 bgm-status.ry.mk 提供社群維護的 Bangumi 可用性狀態觀測能力;該服務作者為 wataame
  • 本倉庫會盡量反映目前可驗證的 Bangumi 行為限制,但不承諾覆蓋網站上的全部功能,也不承諾第三方站點行為會長期穩定不變。

授權

本倉庫使用 AGPL-3.0-only 授權。詳見 LICENSE