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

glimpse-cli

v0.2.5

Published

Show native UI windows from scripts and agents. Glimpse lets shell scripts open small HTML-based windows, prompt the user, update persistent UI, and exchange JSON events without sending users to a browser.

Readme

Glimpse CLI

Show native UI windows from scripts and agents. Glimpse lets shell scripts open small HTML-based windows, prompt the user, update persistent UI, and exchange JSON events without sending users to a browser.

Installation

npm install -g glimpse-cli

Or run from this repository:

bun install
bun run build
bun src/cli.ts --help

Usage

Glimpse commands print JSON envelopes so scripts and agents can consume results reliably.

One-shot prompts

Use prompt when the window should return one result and close:

glimpse prompt --title "Confirm" --html '<button onclick="window.glimpse?.send?.({type:&quot;ok&quot;})">OK</button>'

Page scripts send data back with:

window.glimpse?.send?.({ type: 'form.submitted', value: 'hello' })

Persistent windows

Use open for windows that stay alive and can be updated, polled, or messaged later:

glimpse open --name demo --replace --width 420 --height 300 --html '<h1>Hello</h1>'
glimpse set-html -w demo --html '<h1>Updated</h1>'
glimpse wait -w demo --timeout 30s
glimpse close -w demo

Window refs can be either a stable --name or the returned windowId.

HTML sources

Most HTML commands accept:

  • an inline snippet via --html
  • a file path argument
  • stdin via -
  • URLs via --url

Examples:

glimpse open ./panel.html --watch --name panel
glimpse open --url http://localhost:3000 --width 1000 --height 700
cat panel.html | glimpse prompt -

Events

Use wait, read, peek, or events to consume or inspect page events:

glimpse wait -w demo
glimpse read -w demo --type counter.changed
glimpse peek -w demo
glimpse events -w demo --include-consumed

wait and read consume events. peek and events inspect without consuming. App event types must not use reserved prefixes: window.*, html.*, or glimpse.*.

Security notes

Loopback URLs are trusted by default. Non-loopback remote URLs require --allow-remote. Remote pages only receive the Glimpse bridge with --allow-bridge. Inline and file-backed HTML use a restrictive default CSP unless you pass --allow-remote-resources or --csp.

Examples

The examples/ directory contains runnable scripts. They assume a global glimpse command from npm install -g glimpse-cli or a local bun link:

./examples/01_prompt.sh
./examples/02_counter.sh
./examples/02b_counter_w_state.sh
./examples/03_watch.sh

examples/01_prompt.sh — one-shot prompt

Opens a small form, returns the submitted value as JSON, and exits. This is the simplest pattern for scripts that need one piece of user input.

examples/02_counter.sh — discrete event stream

Opens a persistent counter window. Each button click sends one counter.changed event back to the shell, where the script waits and prints events until the window closes.

examples/02b_counter_w_state.sh — latest-state reconciliation

A variant of the counter that emits click events plus short-lived counter.snapshot repeats. Use this pattern when a consumer cares about the latest state more than every individual click.

examples/03_watch.sh — file-backed watch mode

Writes an HTML file, opens it with --watch, then rewrites the file once per second. Glimpse reloads the window as the file changes.

Development

bun run typecheck
bun run test
bun run build

The npm playground verifies the published package shape:

npm install --prefix playground/npm
npm test --prefix playground/npm

License

MIT