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

@henryqw/pi-bark

v0.9.0

Published

Send Pi session status and agent output to Bark on iOS.

Readme

@henryqw/pi-bark

Get Bark push notifications when Pi finishes, fails, or needs input.

Install

pi install npm:@henryqw/pi-bark
  1. Open the Bark App.
  2. Copy its test URL.
  3. Get the Device Key after the host, without sample content such as /Test.
  4. Run /set-bark in Pi.

For https://api.day.app/your-device-key/Test, use:

/set-bark your-device-key

For a self-hosted server, use:

/set-bark your-device-key https://bark.example.com

Treat the Device Key as a secret. Anyone with it can send push notifications to your device.

Works with

| Package | Relationship | Purpose | | --- | --- | --- | | @henryqw/pi-herdr-tools | Improves | Adds the same Pi session title to automatic Bark status notifications. |

Use

Type /bark to see described choices. After default, completion offers on and off. Completion does not suggest Device Keys or server addresses.

Run /copyb without arguments to copy the latest Pi response to your clipboard and send it to Bark.

| Surface | Type | Purpose | | --- | --- | --- | | /bark <on\|off\|inherit> \| default <on\|off> | command | Sets the current CWD override or notification default. | | /copyb | command | Copies and sends the last agent message. | | /set-bark <device-key> [server-url] | command | Saves the Device Key and Server URL. | | pi-bark-key [--force \| --disable] | command | Generates, replaces, or disables the Custom Encryption Key. |

All commands are for users. Run / commands in Pi and pi-bark-key in a terminal.

/copyb selects the same text as Pi's /copy, then trims outer whitespace. Markdown, code blocks, internal spacing, and line breaks stay unchanged. After copying, it sends a Bark V2 request to <serverUrl>/push. Without Push Encryption, the JSON uses standard Bark parameters:

{
  "device_key": "your-device-key",
  "body": "the last agent message"
}

Manual /copyb and automatic notifications share a sender. Push Encryption protects content; device_key stays plaintext. HTTPS protects transport.

Automatic status notifications

| Notification | When it sends | | --- | --- | | Pi needs input | Pi opens a blocking prompt, including ask_question. Closing a prompt sends nothing. | | Pi failed | The run ends with an unrecovered failure and will not continue automatically. | | Pi finished | The run ends normally and will not continue automatically. |

The last agent response decides the outcome: provider errors mean failure; successful retries clear them. Failed compaction during a run, including overflow recovery, also means failure. Each run starts clean; earlier runs and other branches do not affect it. Failed idle /compact sends nothing.

Cancelled runs, including Escape, and cancelled compactions send no settled notification. Input notifications and /copyb remain available. A new run cancels a pending settled notification.

Status notifications contain the Pi session name (Unnamed if unset), but no prompt, agent output, or error text. With pi-herdr-tools, Herdr shows the same name. pi-bark never calls Herdr or reads its state.

Automatic notifications default to enabled. Run /bark off or /bark on for a CWD override; /bark inherit removes it. /bark default off changes the default for CWDs without overrides. These global config settings do not affect /copyb.

Config

Package-owned: ~/.pi/agent/config/pi-bark/config.json

| Name | Description | Values | Default | | --- | --- | --- | --- | | serverUrl | Bark server base URL. | HTTP or HTTPS URL; optional path, no query or fragment delimiter. | Required. /set-bark writes "https://api.day.app" if omitted. | | deviceKey | Receiving Bark App installation. | Non-empty string. | Required. | | encryption | Custom Encryption Key and Bark settings. | AES256-GCM object or null. | Required. Commands write null to new files to disable Push Encryption. | | statusNotifications | Notification default and CWD overrides. | Global boolean default; absolute-CWD boolean overrides. | Enabled; no overrides. |

Changes apply on the next command or status event without restart. Queued notifications retain event-time settings.

Push Encryption

Optional Push Encryption prevents the Bark server and Apple Push Notification service from reading content in all pushes, including /copyb and status notifications.

  1. Configure the Device Key with /set-bark.

  2. Generate and save a Custom Encryption Key:

    npx --yes --package=@henryqw/pi-bark -- pi-bark-key

    npx temporarily downloads the package and runs pi-bark-key. It saves the key to config and prints it once.

  3. Open Bark App → Push Encryption.

  4. Enter these settings:

    | Setting | Value | | --- | --- | | Algorithm | AES256 | | Mode | GCM | | Padding | noPadding | | Key | Generated 32-character, 32-byte ASCII key. |

  5. If Bark requires an IV, enter any 12 ASCII characters, such as 000000000000.

  6. Save the settings.

  7. Run /copyb; confirm Bark shows the exact last agent message, not Decryption Failed.

The saved IV is an older-version placeholder. Each push uses a new 12-byte IV, sent with Ciphertext. Bark uses this per-push value. pi-bark appends the GCM authentication tag before Base64 encoding.

Never paste key command output into shared logs: the Custom Encryption Key can decrypt your push content.

The command preserves existing keys. To replace one, run this command and update the Bark App:

npx --yes --package=@henryqw/pi-bark -- pi-bark-key --force

To disable Push Encryption, run this command and disable it in the Bark App:

npx --yes --package=@henryqw/pi-bark -- pi-bark-key --disable

App and pi-bark settings must match. Config has this shape; use "encryption": null to disable encryption:

{
  "serverUrl": "https://api.day.app",
  "deviceKey": "your-device-key",
  "encryption": {
    "algorithm": "AES256",
    "mode": "GCM",
    "padding": "noPadding",
    "key": "your-32-character-custom-key"
  },
  "statusNotifications": {
    "defaultEnabled": true,
    "cwdOverrides": {
      "/srv/quiet-project": false
    }
  }
}

Use HTTPS. HTTP exposes the Device Key and, without Push Encryption, push content. Push Encryption never protects the Device Key.

Missing config stays missing until a command writes it. /set-bark preserves encryption and notification settings. Running pi-bark-key first writes "deviceKey": null; pi-bark stays disabled until /set-bark. Writes are private and atomic. Pi commands never print the Device Key, Server URL, or Custom Encryption Key.

Limits and recovery

Bark and Apple Push Notification service limit payload size. pi-bark never truncates content; oversized messages return a Bark error. /copyb waits at most 15 seconds. Failed pushes do not undo the clipboard copy.

Config checks occur at startup and each read. For the shared rules, see Config files. Results for pi-bark:

| Problem | Result and recovery | | --- | --- | | Unknown key or invalid statusNotifications | Warns, ignores unknown keys or uses the affected value's default, and continues sending. | | Missing file or invalid/missing deviceKey | Disables sending. Run /set-bark. | | Invalid/missing serverUrl, including serverURL | Disables sending, never substitutes the public server that would receive your Device Key. Run /set-bark with the correct URL. | | Invalid/missing encryption, including encyption | Disables sending, never substitutes unencrypted content. Run pi-bark-key --force or pi-bark-key --disable. | | File problem, such as malformed JSON | Disables sending. Fix or move the file. |

Disabled pi-bark reports errors. /set-bark and pi-bark-key remain available; /bark reports the problem without writing. Notification settings cannot enable a disabled configuration.

Before writing, commands report new problems through Pi notifications or key-script stderr. Repairable files are replaced; unknown keys and invalid notification entries are removed. Concurrent file changes stop the write with an error; run the command again.

Commands preserve malformed files. They stop if a required key is invalid or missing and the command cannot set it. /set-bark sets serverUrl and deviceKey; pi-bark-key --force and pi-bark-key --disable set encryption. Fix the file or use the matching repair command.

See Bark's Push Encryption documentation.