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

rebang-cli

v1.0.4

Published

CLI 版每日热榜,聚合 tophub.today 与 46.la 热门资讯

Readme

rebang-cli

CLI 版每日热榜工具,聚合 tophub.today / 46.la 的热门资讯,支持:

  • 终端表格查看(支持中文宽度对齐)
  • 类别交互选择
  • 平台/分类筛选
  • JSON 输出(便于脚本处理)
  • 终端可点击链接(支持 OSC 8 的终端)

快速开始

推荐使用全局命令,安装一次后直接执行 rebang-clirb-cli

# 方式 1:如果你从源码目录使用本项目
npm link

# 方式 2:如果你已发布到 npm(按你的包名安装)
npm i -g rebang-cli

安装后可直接使用:

rebang-cli --platforms 抖音 --limit 10
# 或
rb-cli --platforms 抖音 --limit 10

常用命令示例

# 查看可用数据源(tophub / 46la)
rb-cli source list

# 查看帮助
rb-cli -h
rb-cli source -h
rb-cli limit -h

# 设置默认数据源(设置一次后持续生效)
rb-cli source use 46la

# 查看当前默认数据源
rb-cli source current

# 查看可用平台(当前数据源下的平台 sourceId)
rb-cli --list-sources

# 设置默认每平台条数(-1 = 全部)
rb-cli limit set -1

# 查看当前默认每平台条数
rb-cli limit current

# 指定多个平台(逗号分隔)
rb-cli --platforms 微博,知乎,抖音 --limit 5

# 临时指定数据源(仅本次生效,不修改默认值)
rb-cli --source tophub --platforms 微博 --limit 10

# 临时指定每平台条数(仅本次生效,不修改默认值)
rb-cli -l -1 --platforms 微博

# 指定平台并一次性显示全部(不进入逐条交互)
rb-cli -p 微博,百度 -a --limit 5

# 强制先进入分类选择(即使已带筛选条件)
rb-cli -c --limit 5

# 跳过类别选择,直接展示全部榜单
rb-cli --all --limit 5

# JSON 输出(适合重定向到文件)
rb-cli --platforms 知乎 --limit 10 --json > zhihu.json

参数说明

| 参数 | 说明 | 默认值 | | --- | --- | --- | | -l, --limit <number> | 每个平台展示条数,支持 -1(全部) | 读取本地默认值(初始为 10) | | -a, --all | 连续显示全部匹配平台并结束(可与 -p 组合) | 关闭 | | -p, --platforms <list> | 指定平台列表,逗号分隔,例如 微博,知乎,抖音 | 无 | | --source <name> | 临时指定数据源(tophub46la),不修改默认源 | 读取本地默认源(初始为 tophub) | | -c, --choose-category | 启用类别交互选择(先展示类别) | 关闭 | | --list-sources | 仅列出可用平台,不输出榜单详情 | 关闭 | | --json | 以 JSON 格式输出 | 关闭 | | -h, --help | 查看帮助信息(主命令或子命令) | 关闭 |

交互模式说明

  • TTY 终端下,且未设置 --json 时:
    • 默认直接展示平台内容,不再自动先选类别。
    • 传入 -c(或 --choose-category)时,会先显示类别列表并提示选择。
    • 可输入类别编号查看,直接回车表示“全部类别”,输入 q 退出。
    • 每次看完后可继续选择其他类别;不支持超链接时,也可直接输入类别编号快速切换。
  • 传入 --all 会连续显示全部匹配平台并结束,不进入逐条交互。
  • 传入 -c / --choose-category 可在有筛选条件时仍强制先选类别。
  • 非交互环境(如管道、CI)会自动跳过交互输入。

数据源管理命令

  • rb-cli source list:列出可用数据源,并标记当前默认值。
  • rb-cli source use <name>:设置默认数据源(持久化保存)。
  • rb-cli source current:查看当前默认数据源。
  • 默认源配置会保存到用户目录配置文件(Windows 通常为 %USERPROFILE%\.rebang-cli\config.json)。

条数管理命令

  • rb-cli limit set <number>:设置默认每平台条数(持久化保存),-1 表示全部。
  • rb-cli limit current:查看当前默认每平台条数。
  • 临时覆盖可用 -l <number>,例如 -l -1 表示本次抓取全部条目,不修改默认值。

输出说明

  • 默认输出为彩色表格,包含:排名标题其它(热度等信息)。
  • 标题列会自动换行;其它列会在超长时省略,保持单行整齐。
  • 支持终端超链接(OSC 8)时,标题和榜单名可直接点击跳转;可输入平台编号切换、输入 p 查看平台编号列表、输入 a 查看全部平台(从第一个到最后一个)、输入 01-15 查看范围、输入 01,05,88 查看指定平台集合。
  • 若终端不支持 OSC 8,可输入 TOP1#03 打开新闻;也支持输入平台编号切换、p 查看平台编号列表、a 查看全部平台、01-15 范围查看、01,05,88 指定平台查看。
  • 交互模式下不会自动退出,只有输入 q 才退出;回车会继续查看下一个平台(末尾后循环回到第一个)。

环境变量

  • NO_COLOR=1:关闭彩色输出。
  • NO_HYPERLINK=1:关闭终端超链接(显示纯文本)。
  • FORCE_HYPERLINK=1:在支持 OSC 8 的终端里强制开启超链接。

示例:

NO_COLOR=1 rb-cli --platforms 微博
NO_HYPERLINK=1 rb-cli --limit 5
FORCE_HYPERLINK=1 rb-cli --all --limit 5

Windows 乱码处理

在 PowerShell 中如遇中文乱码,可先执行:

chcp 65001

数据来源与免责说明

  • 默认数据来源:https://tophub.today/
  • 可选数据来源:https://www.46.la/hot
  • tophub.today 默认会过滤购物相关的分类与平台(如电商/热卖类)。
  • 本项目仅做信息聚合与学习使用,数据版权归原站点及各内容来源方所有。