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

shell-use

v0.0.1-beta.3

Published

Node client for the shell-use terminal daemon

Readme

@microsoft/shell-use

A Node client for the shell-use terminal daemon.

The shell-use binary must be on your PATH (or point to it with the SHELL_USE_BIN environment variable or the binary option). The client talks to the per-session daemon directly over its local socket (a named pipe on Windows, a Unix socket elsewhere) and starts the daemon automatically.

Install

npm install @microsoft/shell-use # Node 20+

bun add @microsoft/shell-use # Bun

deno add npm:@microsoft/shell-use # Deno 2

The package is only ESM

Runtime Requirements

  • Node: 20+
  • Deno: 2
  • Bun: *

Note: On Windows, Deno requires all permissions (-A / --allow-all) instead of just --allow-read --allow-write due to the use of named pipes for IPC with the daemon.

Quick start

import { ShellUse } from "@microsoft/shell-use";

const su = new ShellUse();
await su.open();
await su.submit("echo hello");
await su.waitCommand();
await su.expectText("hello");
await su.expectExitCode(0);
await su.close();

Errors

Every failure maps to one of the daemon's exit codes:

| Class | exitCode | Meaning | | --- | --- | --- | | ExpectationError | 1 | an expect/wait condition was not met | | UsageError | 2 | invalid argument (e.g. a bad regex) | | NoSessionError | 3 | no active session | | DaemonError | 4 | daemon could not be reached or started | | VersionMismatchError | 4 | the daemon's version differs from this package | | InternalError | 5 | internal daemon error |

All derive from ShellUseError and carry kind and exitCode. waitX and expectX reject with ExpectationError on failure.

On its first call, a client checks that the running daemon's version matches the package version and throws VersionMismatchError if they differ. Stop the daemon (daemonStop) so it restarts with the current binary, or point SHELL_USE_BIN at a matching one.

API

new ShellUse(session?, { binary?, home? }) mirrors the CLI: open / run, type / write, submit, press / keys, mouse.click|move|down|up|drag|scroll, resize, signal / kill, state, text, cells, get (+ getCommand / getOutput / getExitCode / getCwd / getCursor / getSize), screenshot, waitText / waitIdle / waitCommand / waitExit, expectText / expectExitCode / expectOutput / expectSnapshot, and close.

Module-level helpers: sessions(), closeAll(), daemonStatus(), daemonStop(), getRecording().

Configuration

| Variable | Purpose | | --- | --- | | SHELL_USE_BIN | path to the shell-use binary | | SHELL_USE_SESSION | default session name | | SHELL_USE_HOME | daemon state directory (sockets, pids) |