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

pi-keyboard

v0.1.8

Published

Dynamic VIA/QMK keyboard RGB lighting indicator reflecting Pi states (idle, thinking, unread, need-approval, error)

Readme

pi-keyboard

Lighting commands use via-rgb, which owns HID packet encoding.

Dynamic VIA/QMK keyboard RGB lighting indicator reflecting Pi's internal states.

Ambient physical awareness of what your AI coding agent is doing right on your mechanical keyboard:

| Pi State | Color & Effect | Trigger Condition | | :--- | :--- | :--- | | Idle | White Breathing (白色 呼吸灯) | Session started, ready & waiting for user input | | Thinking | Blue Breathing (蓝色 呼吸灯) | Model generating, reasoning, or executing tools | | Unread Chat | Green Breathing (绿色 呼吸灯) | Agent settled with a completed response for user | | Need Approval | Yellow Blinking (黄色 闪烁) | User prompt, question, or interactive permission gate | | Error | Red Blinking (红色 闪烁) | API failure, tool error, or abort |


Zero Flash Wear (--no-save)

All hardware updates are executed strictly in memory (--no-save mode). Lighting changes modify active RAM state on the keyboard's MCU without writing to EEPROM/Flash, avoiding storage wear across thousands of state transitions.


Multi-Zone Control

Supports discrete control for keyboard lighting channels:

  • All Zones (all): Both per-key backlight and underglow/side strips.
  • Per-Key Matrix (matrix): Keycap backlight (Channel 3 in VIA/QMK).
  • Underglow / Side Strips (underglow): Bottom and edge light strips (Channel 2 in VIA/QMK).

Shared Directory Session Registry

Per-session glow records use pi-kit’s canonical directory identity, hashed into the registry directory name. Existing paths are resolved through realpath, while missing paths use their absolute path; this keeps slash-versus-hyphen project names separate. Reads, cleanup, and clean shutdown verify the stored cwd belongs to the requested directory. Older registry directory names are not migrated.


Structure

keyboard/
├── index.ts           — Package-root extension entry point
├── src/
│   ├── config.ts      — Keyboard config read/write helpers
│   ├── driver.ts      — via-rgb binary resolution & CLI execution
│   ├── state-machine.ts — State transitions and LED apply logic
│   ├── global-sessions.ts — Per-cwd session glow record registry
│   ├── types.ts       — KeyboardState, KeyboardZone, KeyboardConfig
│   └── index.ts       — Pi lifecycle hooks, /keyboard command
├── features/          — BDD contract
├── tests/             — Package E2E tests
└── README.md

Installation

pi install npm:pi-keyboard

Usage

Interactive Menu

Type /keyboard in any Pi session:

  • Toggle On / Off
  • Test Lighting States (preview Idle, Thinking, Unread, Approval, Error)
  • Active Zone Selection (all, matrix, underglow)
  • Brightness Scaling (100%, 75%, 50%, 25%)
  • Hardware Connection Info

CLI Commands inside Pi

/keyboard on            # Enable lighting indicators
/keyboard off           # Disable lighting indicators
/keyboard status        # View active status and hardware info
/keyboard test thinking # Test blue thinking light
/keyboard test error    # Test red blinking light
/keyboard test unread   # Test green unread chat light

Standalone CLI: via-rgb

This package coordinates with the native macOS/Linux via-rgb binary (~/.local/bin/via-rgb), allowing shell scripts, cron jobs, Raycast, and Hammerspoon to control lighting outside Pi as well:

# Query status
via-rgb status

# Turn off / on
via-rgb off
via-rgb on -b 200

# Set specific color & zone
via-rgb --zone matrix set -c blue
via-rgb --zone side set -c warmwhite

Configuration

Settings are saved in ~/.pi/agent/keyboard.json:

{
  "enabled": true,
  "zone": "all",
  "brightnessScale": 1.0,
  "saveToEeprom": false
}

License

MIT