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

bark-bark

v0.2.1

Published

A tiny portable CLI for Bark notifications.

Downloads

621

Readme

bark-bark

中文 | 英语文档

一个用于发送 Bark 通知的轻量命令行工具。

快速开始

bb push 'hello from bark-bark'
bb push 'hello' --title 'Dogxi' --icon 'https://weavatar.com/avatar/554b1d16bf407ccaedc51d762eeb8cd2.jpg'

Bark 通知截图

它没有运行时依赖,适合直接通过 npxbunx 或全局安装使用。

安装

不安装,直接运行:

npx bark-bark push 'hello'
bunx bark-bark push 'hello'

全局安装:

npm install -g bark-bark
bb push 'hello'

不安装验证:

npx bark-bark --version
npx bark-bark push 'hello' --key <bark-key>

Skill

npx skills add dogxii/bark-bark

配置

初始化配置文件:

bb init <your-bark-key>

也可以逐项设置:

bb config set key <your-bark-key>
bb config set server https://api.day.app
bb config set title Dogxi
bb config set group cli
bb config unset title

覆盖已有值时加 --force

查看配置文件路径:

bb config path

bb 默认读取:

~/.config/bark-bark/config.json

可以通过 BB_CONFIG 指定其他配置文件:

BB_CONFIG=/path/to/config.json bb push 'hello'

使用 Bark App 测试 URL 中间这一段作为 key:

https://api.day.app/CVGw837*******2ULrEyEh/Body
bb config set key <bark-key>

不要在这里填原始 APNs device token。当前 CLI 走的是 Bark Server 模式,服务端必须能在数据库里找到这个 push key。

推送

bb push '构建完成'
bb push '发布成功' --title Deploy --group ci
bb push '打开控制台' --url https://example.com
bb push '服务器告警' --level timeSensitive
bb push '带图标的通知' --icon 'https://example.com/avatar.png'
echo '来自 stdin 的消息' | bb push -
echo '来自 stdin 的消息' | bb push --stdin
bb ping

常用选项:

-t, --title <text>       通知标题
--subtitle <text>        通知副标题
-k, --key <key>          Bark key,多个设备可用英文逗号分隔
-s, --server <url>       Bark 服务地址,默认 https://api.day.app
-g, --group <name>       通知分组
-u, --url <url>          点击通知时打开的 URL
--level <level>          active, timeSensitive, passive, critical
--badge <number>         应用角标数字
--sound <name>           Bark 铃声名称
--icon <url>             通知图标 URL
--copy                   在 Bark 中自动复制消息内容
--archive                保存到 Bark 历史记录
--timeout <ms>           请求超时时间,默认 15000
--dry-run                只打印请求内容,不真正发送
--json                   输出完整 JSON 结果

带查询参数的 URL 建议整体加引号,不要在引号里转义 ?=&

bb push 'hello' --icon 'https://weavatar.com/avatar/hash.png?s=80&d=identicon'

如果不小心写成了 \?\=\&bb 会在发送前自动修正。iOS 通知图标优先使用 PNG 或 JPEG URL,兼容性最好。

环境变量

命令行参数优先级最高,其次是环境变量,最后是配置文件。

BARK_KEY=<your-bark-key> bb push 'hello'
BARK_SERVER=https://api.day.app bb push 'hello'
BARK_GROUP=ci bb push 'deploy done'

也支持 BB_KEYBB_SERVERBB_GROUP

开发

npm test
node ./bin/bb.js --help
node ./bin/bb.js push 'hello' --key test --dry-run

致谢