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

klaatai

v0.1.4

Published

KlaatAI — AI coding assistant CLI with smart model routing

Readme

Klaat Code

AI coding assistant CLI with smart model routing — built for developers who live in the terminal.

npm install -g klaatai
klaatai

What is Klaat Code?

Klaat Code is a terminal-native AI coding assistant — similar to Claude Code or OpenCode — but with smart model routing that automatically picks the right AI model for each request, saving cost without sacrificing quality.

It runs entirely in your terminal with a full TUI (no Electron, no browser required), supports MCP servers, vim keybindings, skills, hooks, and everything else you'd expect from a professional AI coding tool.


Install

npm (requires Node ≥ 18 or Bun ≥ 1)

npm install -g klaatai

macOS permission error? If you see EACCES: permission denied, either prefix with sudo:

sudo npm install -g klaatai

Or fix npm's global prefix once so you never need sudo again:

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
npm install -g klaatai

macOS (Apple Silicon) — standalone binary, no runtime needed

curl -fsSL https://github.com/klaatai/klaatai-cli/releases/latest/download/klaatai-macos-arm64 \
  -o /usr/local/bin/klaatai && chmod +x /usr/local/bin/klaatai

macOS (Intel)

curl -fsSL https://github.com/klaatai/klaatai-cli/releases/latest/download/klaatai-macos-x64 \
  -o /usr/local/bin/klaatai && chmod +x /usr/local/bin/klaatai

Linux (x64)

curl -fsSL https://github.com/klaatai/klaatai-cli/releases/latest/download/klaatai-linux-x64 \
  -o /usr/local/bin/klaatai && chmod +x /usr/local/bin/klaatai

Quick Start

# Open current directory
klaatai

# Open a specific project
klaatai ~/projects/my-app
klaatai /path/to/project

# Headless / CI mode
klaatai run "Fix all TypeScript errors"
klaatai run "Write tests for auth.ts" < auth.ts

# Authenticate
klaatai login
klaatai whoami

Features

Smart Model Routing

Klaat Code automatically routes each request to the most cost-effective model that can handle it. You get heavy model quality at nano model prices for simple tasks. The sidebar shows real-time tier distribution and estimated savings.

/model heavy    # force a specific tier
/model          # restore smart routing
/why            # explain the last routing decision

Full TUI — No Browser Required

  • Streaming responses with live token display
  • Collapsible tool output (click to expand)
  • Mouse support — click, scroll, drag to select + auto-copy
  • Vim keybindings (/vimmode on)
  • 7 themes: dark, light, dracula, nord, ayu, catppuccin, gruvbox
  • Split sidebar: usage, context window, MCP servers, routing analytics

Built-in Tools

| Tool | Description | |---|---| | read_file | Read files with line numbers, offset/limit | | write_file | Write files, creates parent dirs automatically | | edit_file | Surgical string replacement | | glob | File pattern matching | | grep | Regex search across files | | run_command | Execute shell commands | | web_fetch | Fetch and read web pages | | web_search | Search the web | | todo_write/read | Persistent task management | | delegate_task | Sub-agent delegation for complex tasks |

MCP (Model Context Protocol)

Full stdio MCP client — connect any MCP server in seconds.

# Configure in .klaatai/mcp.json
/mcp          # manage servers in TUI

7 built-in presets: filesystem, GitHub, Postgres, Puppeteer, Brave Search, Fetch, and more.

Git Integration

/diff           # show git diff
/review         # AI code review of current changes
/commit         # AI-generated commit message + confirm
/undo           # undo last AI file changes
/checkpoint     # snapshot project state
/rollback       # restore a checkpoint

Skills — Reusable Prompt Templates

Save prompts as .md files and invoke them by name.

/skill list              # list all skills
/skill fix-types         # invoke a skill
/skill new fix-types     # create a new skill in $EDITOR

Skills live in .klaatai/skills/ (project) or ~/.klaatai/skills/ (global).

Hooks — Lifecycle Automation

Run shell commands before/after tool calls and messages.

// .klaatai/hooks.json
{
  "after_message":  ["afplay /System/Library/Sounds/Glass.aiff"],
  "before_tool":    ["echo \"$KLAATAI_TOOL_NAME\" >> ~/.klaatai/tool.log"],
  "after_tool":     ["notify-send \"$KLAATAI_TOOL_NAME done\""]
}

Available events: before_message · after_message · before_tool · after_tool


Slash Commands

| Command | Description | |---|---| | /help | Show all commands | | /model <tier> | Force routing tier: nano / fast / code / reason / heavy | | /why | Explain last routing decision | | /diff [file] | Show git diff | | /review [ref] | AI code review | | /commit | AI-generated git commit message | | /test [args] | Run test suite (auto-detects Bun/Vitest/Jest/pytest/Go/Cargo) | | /skill <name> | Invoke a saved prompt skill | | /hooks | List configured lifecycle hooks | | /init | Detect tech stack and generate project rules | | /compact | Summarise context to free up the context window | | /checkpoint [label] | Snapshot project state | | /rollback [id] | Restore a checkpoint | | /undo | Revert last AI file changes | | /share | Export session to markdown | | /theme <name> | Switch theme | | /vimmode on\|off | Toggle vim keybindings | | /mcp | Manage MCP servers | | /sessions | List saved sessions | | /resume <id> | Resume a previous session | | /doctor | Diagnose auth, API, MCP, and project health | | /clear | Clear chat | | /cost | Show session cost |


Keyboard Shortcuts

| Shortcut | Action | |---|---| | ctrl+p | Command palette | | ctrl+y | Copy last AI response to clipboard | | ctrl+d | Quit | | ctrl+c | Cancel streaming / quit | | ctrl+x ctrl+e | Open $EDITOR to compose message | | esc | Cancel streaming | | @ | Insert file reference (fuzzy picker) | | !cmd | Run shell command and inject output | | Mouse drag | Select and auto-copy to clipboard |

Vim Mode (/vimmode on)

| Key | Action | |---|---| | esc | NORMAL mode | | i / a / A / I | INSERT mode | | h / l | Move cursor | | j / k | Scroll chat | | w / b / e | Word motion | | 0 / $ | Line start / end | | dd | Clear input | | D | Kill to end of line | | gg / G | Scroll to top / bottom | | ctrl+u / ctrl+d | Half-page scroll |


Configuration

Config is stored in ~/.klaatai/config.json.

{
  "baseUrl": "https://api.klaatai.com",
  "routingDisplay": "minimal",
  "theme": "dark",
  "vimMode": false
}

| Key | Values | Description | |---|---|---| | routingDisplay | off / minimal / full | Chat header detail level | | theme | dark / light / dracula / nord / ayu / catppuccin / gruvbox | UI theme | | vimMode | true / false | Vim keybindings |

Project Rules

Create .klaatai/rules.md in your project root — it's injected as a system message every session. Use /init to auto-generate one based on your tech stack.

Permissions

Fine-grained tool permissions in ~/.klaatai/permissions.json:

{
  "allow": ["read_file:*", "glob:*"],
  "deny":  ["run_command:rm -rf*"],
  "trusted_tools": ["read_file", "glob", "grep"]
}

Headless / CI Mode

# Single prompt, streams to stdout
klaatai run "Summarise CHANGELOG.md"

# Pipe input
echo "Explain this function" | klaatai run -

# With options
klaatai run "Fix type errors" --model fast --system "You are a TypeScript expert"

# In CI — no TUI, just output
klaatai run "Check for security issues in auth.ts" < auth.ts

API Server Mode

klaatai serve --port 8080

Exposes a REST API at http://localhost:8080 for IDE extensions and integrations:

  • GET /v1/health — health check
  • GET /v1/info — session info
  • POST /v1/chat — chat with SSE streaming

Directory Structure

~/.klaatai/
  credentials.json    # API key + auth
  config.json         # user preferences
  permissions.json    # tool permission rules
  mcp.json            # global MCP servers
  hooks.json          # global lifecycle hooks
  sessions/           # saved session transcripts
  skills/             # global prompt skills (.md files)
  plugins/            # custom tool plugins (.js files)
  todos.json          # persistent todo list

.klaatai/             # project-level (in your repo)
  rules.md            # project rules (injected as system message)
  mcp.json            # project MCP servers
  hooks.json          # project lifecycle hooks
  skills/             # project prompt skills

License

MIT © KlaatAI