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

libretto

v0.6.13

Published

AI-powered browser automation library and CLI built on Playwright

Readme

Libretto

npm version License: MIT GitHub Discussions Discord

Libretto is a toolkit for building robust web integrations. It gives your coding agent a live browser and a token-efficient CLI to:

  • Inspect live pages with minimal context overhead
  • Capture network traffic to reverse-engineer site APIs
  • Record user actions and replay them as automation scripts
  • Debug broken workflows interactively against the real site

We at Saffron Health built Libretto to help us maintain our browser integrations to common healthcare software. We're open-sourcing it so other teams have an easier time doing the same thing.

https://github.com/user-attachments/assets/9b9a0ab3-5133-4b20-b3be-459943349d18

Quick Links

Installation

npm install libretto

# First-time onboarding: install skills and download Chromium
npx libretto setup

# Check workspace readiness at any time
npx libretto status

setup creates the .libretto/ directory, installs agent skills, and downloads Chromium unless you pass --skip-browsers.

Use cases

Libretto is designed to be used as a skill through your coding agent. Here are some example prompts:

One-shot script generation

Use the Libretto skill. Go on LinkedIn and scrape the first 10 posts for content, who posted it, the number of reactions, the first 25 comments, and the first 25 reposts.

Your coding agent will open a window for you to log into LinkedIn, and then automatically start exploring.

Interactive script building

I'm gonna show you a workflow in the eclinicalworks EHR to get a patient's primary insurance ID. Use libretto skill to turn it into a playwright script that takes patient name and dob as input to get back the insurance ID. URL is ...

Libretto can read your actions you perform in the browser, so you can perform a workflow, then ask it to use your actions to rebuild the workflow.

Convert browser automation to network requests

We have a browser script at ./integration.ts that automates going to Hacker News and getting the first 10 posts. Convert it to direct network scripts instead. Use the Libretto skill.

Libretto can read network requests from the browser, which it can use to reverse engineer the API and create a script that directly calls those requests. Directly making API calls is faster, and more reliable, than UI automation. You can also ask Libretto to conduct a security analysis which analyzes the requests for common security cookies, so you can understand whether a network request approach will be safe.

Fix broken integrations

We have a browser script at ./integration.ts that is supposed to go to Availity and perform an eligibility check for a patient. But I'm getting a broken selector error when I run it. Fix it. Use the Libretto skill.

Agents can use Libretto to reproduce the failure, pause the workflow at any point, inspect the live page, and fix issues, all autonomously.

CLI usage

You can also use Libretto directly from the command line. All commands accept --session <name> to target a specific session.

npx libretto open <url>                    # launch browser and open a URL
npx libretto run ./integration.ts --headless # run a workflow and close on success
npx libretto run ./integration.ts --headless --stay-open-on-success # keep a successful run inspectable
npx libretto snapshot --session <name>     # capture a screenshot and compact accessibility tree
npx libretto exec "<code>"                 # execute Playwright TypeScript against the open page
npx libretto close                         # close the browser

run sessions are inspectable through the same daemon-backed commands as open sessions. Successful runs close the browser by default; pass --stay-open-on-success to keep the browser open for pages, snapshot, and exec. Failed or paused workflows keep the browser open so you can inspect the exact page state before fixing or resuming the workflow.

Run npx libretto help for the full list of commands.

Configuration

All Libretto state lives in a .libretto/ directory at your project root. See the configuration docs for details on config files, sessions, and profiles.

Join the Community

Join our Discord to connect with other developers, get help, and share what you've built:

Discord

For longer-form threads, head to GitHub Discussions. Found a bug? Open an issue.

License

MIT License — use it freely in commercial and open-source projects.

Development

For local development in this repository:

pnpm i
pnpm build
pnpm type-check
pnpm test

Source layout:

  • {{LIBRETTO_PATH_PREFIX}}src/cli/ — CLI commands
  • {{LIBRETTO_PATH_PREFIX}}src/runtime/ — browser runtime (network, recovery, downloads, extraction)
  • {{LIBRETTO_PATH_PREFIX}}src/shared/ — shared utilities (config, LLM client, logging, state)
  • {{LIBRETTO_PATH_PREFIX}}test/ — test files (*.spec.ts)
  • {{LIBRETTO_PATH_PREFIX}}README.template.md — source of truth for the repo and package READMEs
  • {{LIBRETTO_PATH_PREFIX}}skills/libretto/ — source of truth for the Libretto skill

Run pnpm sync:mirrors after editing {{LIBRETTO_PATH_PREFIX}}README.template.md or anything under {{LIBRETTO_PATH_PREFIX}}skills/libretto/.

To check that generated READMEs, skill mirrors, and skill version metadata are in sync without fixing them, run pnpm check:mirrors. To release, run pnpm prepare-release.


[!NOTE] This is an early-stage project under active development. APIs may change before version 1.0. We recommend pinning to specific versions in production.

Built by the team at Saffron Health.