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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@chenpu17/forge-cli

v0.1.0

Published

AI Coding Agent TUI built with Ink (React)

Readme

Forge TUI

A beautiful terminal UI for the Forge AI Coding Agent, built with Ink (React for CLI).

Features

  • 🎨 Beautiful UI - Modern terminal interface with themes
  • 💬 Streaming Output - Real-time response streaming
  • 🔨 Tool Visualization - See tool calls with parameters and results
  • 📋 Task List - Track progress with todo list
  • 🎯 Command Palette - Quick access to all commands (Ctrl+P)
  • 📚 Session Management - Browse, switch, and delete sessions
  • Confirmation Dialogs - Safe execution of dangerous operations

Requirements

  • Node.js >= 18
  • Forge SDK (built from ../forge/crates/forge-napi)

Installation

# Install dependencies
npm install

# Build the NAPI SDK first (if not already built)
cd ../forge/crates/forge-napi
npm install
npm run build
cd -

# Run in development mode
npm run dev

Configuration

Create a .env file or set environment variables:

# Required: API Key
FORGE_LLM_API_KEY=your-api-key

# Optional: Model configuration
FORGE_LLM_MODEL=claude-sonnet-4-5-20250929
FORGE_LLM_MODE=anthropic.messages  # or openai.chat
FORGE_LLM_BASE_URL=  # Custom endpoint (optional)

Usage

# Run with environment variables
FORGE_LLM_API_KEY=your-key npx tsx src/index.tsx

# Or with OpenAI-compatible endpoint
FORGE_LLM_MODE=openai.chat \
FORGE_LLM_API_KEY=your-key \
FORGE_LLM_BASE_URL=https://api.openai.com/v1 \
FORGE_LLM_MODEL=gpt-4 \
npx tsx src/index.tsx

Keyboard Shortcuts

| Shortcut | Action | |----------|--------| | Enter | Submit input | | Ctrl+P | Open command palette | | Ctrl+O | Open session browser | | Ctrl+L | Clear messages | | Ctrl+S | Save session | | Ctrl+C | Cancel operation / Exit | | Ctrl+D | Exit | | Alt+↑/↓ | Browse input history | | Esc | Close dialogs |

Architecture

forge-tui/
├── src/
│   ├── index.tsx           # Entry point
│   ├── app.tsx             # Main app component
│   ├── components/         # UI components
│   │   ├── Header.tsx      # Status bar
│   │   ├── Footer.tsx      # Shortcuts bar
│   │   ├── InputBox.tsx    # Text input
│   │   ├── MessageList.tsx # Message container
│   │   ├── Message.tsx     # Single message
│   │   ├── CommandPalette.tsx
│   │   ├── SessionBrowser.tsx
│   │   ├── ConfirmDialog.tsx
│   │   └── TodoList.tsx
│   ├── hooks/              # React hooks
│   │   ├── useSDK.ts       # SDK wrapper
│   │   └── useTheme.ts     # Theme access
│   ├── state/              # TEA state management
│   │   ├── reducer.ts      # State transitions
│   │   └── context.ts      # React context
│   ├── themes/             # Color themes
│   │   ├── dark.ts
│   │   └── light.ts
│   ├── utils/              # Utilities
│   │   └── markdown.ts     # Markdown rendering
│   └── types/              # TypeScript types
│       ├── sdk.ts          # SDK type re-exports
│       └── app.ts          # App state types

State Management

Uses TEA (The Elm Architecture) pattern:

  • Model: AppState in types/app.ts
  • Update: reducer in state/reducer.ts
  • View: React components

SDK Integration

The TUI communicates with the Forge Rust SDK through NAPI bindings:

import { ForgeConfig, ForgeSdk } from '@anthropic/forge-sdk';

const config = ForgeConfig.fromEnv();
const sdk = new ForgeSdk(config);
await sdk.init();

// Process messages with streaming
await sdk.process("Hello!", (err, event) => {
  console.log(event.eventType, event);
});

Development

# Type check
npm run typecheck

# Run in watch mode
npm run dev

# Build for production
npm run build

License

MIT