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

refbase

v0.0.2

Published

rb 命令:打印本地 ~/refbase-workspace/data 资料区中指定索引的 Markdown 内容,支持按 Agent runtime(codex/cursor)优先匹配专属版本。

Readme

refbase

npm version CI

refbase 是独立的 ccli 命令工作区,用来维护 rb 命令和它读取的 Markdown 资料区。

安装

npm install -g refbase
rb <索引>

资料区

资料区固定位于 ~/refbase-workspace/data(不在本仓库内,也不随 npm 包分发)。这样个人笔记内容不会被提交进 git 仓库,也不会发布到公共 npm registry。

首次运行 rb 时,该目录若不存在会被自动创建,直接把 Markdown 资料放进去即可,无需手动 mkdir

也可以通过 REFBASE_DATA_DIR 环境变量临时覆盖资料区路径(主要用于测试/调试)。

资料区内部可以按树形目录组织 Markdown 文件。每个 Markdown 文件的文件名就是索引名,文件内容就是 rb 命令要打印的依据内容。

示例:

~/refbase-workspace/data/
  concepts/
    attention.md
  project/
    cpu-cli-tool.md

对应命令:

rb attention
rb cpu-cli-tool

rb 会检测当前 Agent runtime,并优先读取 runtime 专属版本:

~/refbase-workspace/data/
  project/
    cpu-cli-tool.codex.md
    cpu-cli-tool.cursor.md
    cpu-cli-tool.md

在 Codex 发起的终端中,rb cpu-cli-tool 会优先查找 cpu-cli-tool.codex.md,找不到时回退到 cpu-cli-tool.md

在 Cursor Agent 发起的终端中,rb cpu-cli-tool 会优先查找 cpu-cli-tool.cursor.md,找不到时回退到 cpu-cli-tool.md

当前版本暂不处理多个文件同名的情况;如果资料区里存在重复索引,命令会返回对应候选文件名递归扫描过程中遇到的第一个文件。

本地开发

npm install
npm run update
ccli activate
rb <索引>

npm run update 只会编译并写入 package.json.bin。需要让本机命令生效时,再运行 ccli activate

仓库根目录下的 workspace 是一个(被 .gitignore 忽略的)本地软链,指向 ~/refbase-workspace,方便在编辑器里直接从仓库内浏览 workspace/data/ 下的真实资料区内容。rb 运行时并不依赖这个软链,而是始终按固定路径 ~/refbase-workspace/data 解析,所以软链缺失也不影响命令运行,只是少了这个浏览入口:

ln -s ~/refbase-workspace workspace

测试

npm test