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

agent-sh

v0.8.0

Published

A shell-first terminal where AI is one keystroke away

Readme

agent-sh

npm version license

Not a shell that lives in an agent — an agent that lives in a shell.

I live in a terminal. I don't want an agent that can run shell commands when it needs to — I want my shell, with an agent I can reach for when I need to. Most AI tools get this backwards: the LLM drives the experience and the shell is bolted on as an afterthought. No real PTY, no job control, no vim, fragile cd tracking. The agent is the main character and your terminal is a prop.

agent-sh flips this. It's your shell first — full PTY, your rc config, your aliases, everything just works. But type > at the start of a line, and you're talking to an agent that has full context of what you've been doing.

⚡ src $ ls -la                          # real shell command
⚡ src $ cd ../tests && npm test          # real cd, env, aliases — all just work
⚡ src $ vim file.ts                      # opens vim in the same PTY
⚡ src $ > explain the last error          # agent investigates using its own tools
⚡ src $ > deploy to staging              # agent runs it in your live shell

Key Features

Real terminal, zero compromise. Full PTY with your shell config, aliases, and environment. Shell starts instantly — the agent connects asynchronously in the background.

Context-aware agent. Every query includes your cwd, recent commands, and their output. Run a failing test, type > fix this, and the agent knows exactly what happened. It has built-in tools for file read/write/edit, bash, grep, glob — no external setup needed. Context management works like shell history — continuous, persistent across restarts, no sessions to manage. See Context Management.

Agent decides how to help. One entry point (>), three tool categories. The agent uses scratchpad tools to investigate, display to show you output, and user_shell for commands with lasting effects. No need to pick a mode — the agent reasons about which tools to use based on your intent.

Any LLM, any backend. Works with any OpenAI-compatible API out of the box. Define multiple providers in settings and cycle between models at runtime with Shift+Tab. Or swap in a completely different agent — Claude Code and pi run as drop-in backend extensions.

Extensible by design. The entire system is built on a typed event bus. Extensions can add custom input modes, content transforms (render LaTeX as images, Mermaid as diagrams), themes, slash commands, or replace the agent backend entirely. The built-in TUI renderer is itself just an extension — nothing is special.

Embeddable as a library. The core is a headless kernel — import { createCore } from "agent-sh" to build WebSocket servers, REST APIs, Electron apps, or test harnesses. No terminal required.

Quick Start

npm install -g agent-sh
agent-sh

Set OPENAI_API_KEY in your environment (or configure providers in ~/.agent-sh/settings.json). Works with any OpenAI-compatible API — see the Usage Guide for provider examples (OpenAI, Ollama, OpenRouter, Together, Groq, LM Studio, vLLM).

Requires Node.js 18+.

Agent Mode

Type > at the start of a line to talk to the agent. The agent decides how to help:

  • Scratchpad tools (bash, read_file, grep, glob, etc.) — for investigation. Output goes to the agent, not your terminal.
  • display — shows output in your terminal (e.g. cat, git log). You see it; the agent doesn't process it.
  • user_shell — runs commands with lasting effects (cd, npm install, etc.) in your live shell.

Everything else works as a normal shell — commands go straight to the PTY. Input modes are extensible — see Extensions: Custom Input Modes.

Slash Commands

| Command | Description | |---|---| | /help | Show available commands | | /model [name] | Cycle to the next model, or switch to a specific one | | /backend [name] | List backends, or switch to a named backend | | /compact | Compact conversation (free up context space) | | /context | Show context budget usage | | /thinking [level] | Set reasoning effort (off, low, medium, high) |

Configuration

Configure via ~/.agent-sh/settings.json. See the Usage Guide for the full settings reference (providers, models, extensions, skills, and more).

Documentation

Development

git clone https://github.com/guanyilun/agent-sh.git
cd agent-sh
npm install
npm run build
npm start

License

MIT