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

cli-for-ai

v0.1.1

Published

AI-first CLI framework for Node — independent commands in a mixed-depth tree, generated help and programmatic schema descriptions, JSON results and errors as values

Readme

cli-for-ai

English · Korean

Build CLIs that AI agents can discover, call and feed results into the next command. Declare inputs, execution and output together so help and validation stay aligned as commands change. The same declarations are intended to be readable and maintainable by the agents building the tool.

Ordinary results use JSON by default; payload commands can stream records directly to other programs. Services arrive through an injected context, so a command can be tested without starting a process or creating a home directory. The design rationale lives in cli-for-ai-guide.

Declare a command and see its behavior

import { application, command, completed, output } from "cli-for-ai";
import { run } from "cli-for-ai/node";

const greet = command({
  summary: "Greet someone",
  input: {
    positionals: [{ name: "name", summary: "Name to greet", required: true }],
  },
  output: output({
    summary: "A greeting",
    fields: [{ path: "data", summary: "Greeting text" }],
    parse(value: unknown) {
      if (typeof value !== "string") throw new TypeError("Expected a greeting");
      return value;
    },
  }),
  examples: [{ summary: "Greet Ada", input: { name: "Ada" } }],
  run: ({ name }) => completed(`Hello, ${name}`),
  human: (greeting) => greeting,
});

const app = application({
  name: "hello",
  version: "1.0.0",
  summary: "A small greeting CLI",
  commands: { greet },
});

await run(app, { context: () => ({}) });

An ordinary call returns a JSON result:

{"status":"completed","data":"Hello, Ada"}

hello greet Ada --human prints Hello, Ada. Both forms execute the same handler. hello and hello --help show the same top-level help. hello greet reports the missing argument without running the handler.

The opening of the generated root help comes from the same declaration:

hello 1.0.0 — A small greeting CLI

Usage:
  hello <command> [options]

Commands:
  greet  Greet someone

Install

Use Node 24 or later:

npm install cli-for-ai

For TypeScript, install typescript and @types/node as development dependencies. Follow Build your first CLI to create and run cli.mts. Framework development and repository examples are covered in Development.

Documentation

| Task | Read | | --- | --- | | Arrange commands and their help | Commands | | Validate arguments, forward child arguments and select stdin | Inputs | | Report states, errors and human output | Results | | Stream JSONL or text to a pipe | Payloads | | Inject services, cancel and clean up | Execution | | Test handlers and real invocations | Testing | | Use neverthrow or Effect | Adapters | | Look up APIs and defaults | Reference |

See Implementation scope for supported behavior and limits. Local and network examples contain executable commands and tests. Development checks are in Testing.

License: MIT.