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

ai-cli

v0.0.13

Published

Minimal terminal AI assistant.

Readme

ai-cli

Minimal terminal AI assistant.

Install

npm install -g ai-cli

Setup

ai init

Get your API key from Vercel AI Gateway

Usage

ai                           # interactive mode
ai "hello"                   # single message
ai -m gpt-5 "hello"          # use specific model
ai --image ./img.png "what?" # analyze image (single message)
ai -l                        # list models
echo "explain this" | ai     # pipe input
ai --system "respond in Spanish" "hola"  # custom system prompt

# in interactive mode, ctrl+v to paste image from clipboard

Headless Mode

Run the full agent non-interactively. Useful for CI pipelines, scripts, and automation.

ai -p "explain this codebase"                          # output to stdout
ai -p --json "write tests for src/auth.ts" > result.json  # structured JSON
ai -p --force "fix all type errors"                    # skip confirmations
ai -p --no-save "what dependencies are outdated?"      # ephemeral (no history)
git diff | ai -p "review this for bugs"                # pipe + headless
ai -p -m gpt-5 --force "refactor the database layer"  # combine flags
ai -p --plan "how should I refactor auth?"             # plan mode (read-only)
ai -p -r <chatId> "continue"                           # resume a session
ai -p --timeout 60 "fix type errors"                   # abort after 60s
ai -p -q "explain this codebase"                       # suppress stderr status

Exit codes: 0 success, 1 error, 2 agent stuck.

Note: When --timeout fires during a tool execution (e.g., mid-file-write), the agent is interrupted immediately. The workspace may contain partial changes. Combine with version control or review the working tree after a timeout.

JSON output format:

{
  "output": "...",
  "model": "anthropic/claude-sonnet-4.5",
  "tokens": 1234,
  "cost": 0.05,
  "exitCode": 0,
  "chatId": "abc123",
  "usage": {
    "inputTokens": 800,
    "outputTokens": 434,
    "cacheReadTokens": 0,
    "cacheWriteTokens": 0,
    "reasoningTokens": 0
  }
}

On error, includes an error field with the message.

Options

  • -m, --model - model (default: anthropic/claude-sonnet-4.5)
  • --image - attach image file
  • -r, --resume - resume a previous chat by ID
  • --plan - start in plan mode (think before acting)
  • -p, --print - headless mode: full agent, output to stdout, then exit
  • --json - structured JSON output (implies --print)
  • --system - append custom text to the system prompt
  • --fast - enable Anthropic fast mode (speed=fast)
  • --force - auto-approve all tool actions (--print only)
  • --no-save - don't persist the chat to history (--print only)
  • --timeout - abort after N seconds (--print only)
  • -q, --quiet - suppress stderr status output (--print only)
  • -l, --list - list models
  • --no-color - disable color output
  • -v, --version - show version
  • -h, --help - help

Commands

Chat

  • /new - new chat
  • /chats - list chats
  • /chat <n> - load chat
  • /delete - delete chat
  • /clear - clear screen

Files

  • /copy - copy response
  • /rollback - undo changes

Context

  • /usage - token usage and cost
  • /compress - compress history
  • /plan - toggle plan mode (think before acting)
  • /review - review loop (auto-reviews changes for bugs)

Model

  • /model - select model interactively
  • /model <query> - switch to matching model

System

  • /info - version, model, balance, storage
  • /processes - background processes
  • /memory - saved memories
  • /mcp - mcp servers
  • /settings - preferences
  • /permissions - tool permission rules
  • /alias - shortcuts
  • /purge - delete all chats
  • /help - commands

Skills

Skills extend the AI with specialized capabilities. They follow the Agent Skills open standard.

Managing Skills

/skills                    # list installed
/skills add <url>          # install from git
/skills remove <name>      # uninstall
/skills show <name>        # view content
/skills create <name>      # create new
/skills path               # show directory

Installing Skills

Shorthand (like skills.sh):

/skills add vercel-labs/agent-skills/skills/react-best-practices
/skills add anthropics/skills/skills/pdf
/skills add owner/repo

Full GitHub URL:

/skills add https://github.com/anthropics/skills/tree/main/skills/pdf

Local path:

/skills add /path/to/skill

Creating Skills

/skills create my-skill

Creates ~/.ai-cli/skills/my-skill/SKILL.md

Rules

Custom instructions loaded into every conversation:

  • ~/.ai-cli/AGENTS.md - global rules
  • ./AGENTS.md - project rules

Manage with /rules:

/rules show    # view rules
/rules edit    # open in editor
/rules clear   # remove rules
/rules path    # show path

Review Loop

After the coding agent finishes making file changes, a separate review agent automatically inspects all modifications for severe and high-priority bugs. If it finds issues, it fixes them and re-reviews, up to a configurable number of passes.

The review agent runs in its own isolated context with a strict system prompt -- it has no attachment to the code it's reviewing and is intentionally more critical than the coding agent.

Enabled by default. Toggle with:

/review on     # enable
/review off    # disable
/review        # show status

Configure max iterations in ~/.ai-cli/config.json:

{
  "review": {
    "enabled": true,
    "maxIterations": 3
  }
}

Tools

The AI can:

files - read, write, edit, delete, copy, rename, search

commands - run shell commands, background processes

memory - save facts across sessions ("remember X")

web - search, fetch urls, check weather

MCP

Connect to external tools via Model Context Protocol:

/mcp                                    # list servers
/mcp add weather http https://mcp.example.com
/mcp add db stdio npx @example/mcp-db
/mcp remove weather                     # remove server
/mcp reload                             # reconnect all

Transports

  • http - HTTP endpoint
  • sse - server-sent events
  • stdio - spawn local process

Config

Servers stored in ~/.ai-cli/mcp.json:

{
  "servers": {
    "weather": {
      "type": "http",
      "url": "https://mcp.example.com"
    },
    "db": {
      "type": "stdio",
      "command": "npx",
      "args": ["@example/mcp-db"]
    }
  }
}

Environment variables expand with ${VAR} or ${VAR:-default}.

MCP tools are prefixed with server name (e.g., weather_get_forecast).

Models

Supports fuzzy matching:

ai -m claude-4       # → anthropic/claude-sonnet-4
ai -m gpt-5          # → openai/gpt-5
ai -m sonnet         # → finds sonnet model

Storage

All data in ~/.ai-cli/:

~/.ai-cli/
├── config.json      # settings and api key
├── mcp.json         # mcp servers
├── chats/           # chat history
├── memories.json    # saved memories
├── skills/          # installed skills
└── AGENTS.md        # global rules

Environment

Alternatively set your API key:

export AI_GATEWAY_API_KEY=your-key