🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

klaatai

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

klaatai

KlaatAI — AI coding assistant CLI with smart model routing

latest
Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
29
222.22%
Maintainers
1
Weekly downloads
 
Created
Source

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

ToolDescription
read_fileRead files with line numbers, offset/limit
write_fileWrite files, creates parent dirs automatically
edit_fileSurgical string replacement
globFile pattern matching
grepRegex search across files
run_commandExecute shell commands
web_fetchFetch and read web pages
web_searchSearch the web
todo_write/readPersistent task management
delegate_taskSub-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

CommandDescription
/helpShow all commands
/model <tier>Force routing tier: nano / fast / code / reason / heavy
/whyExplain last routing decision
/diff [file]Show git diff
/review [ref]AI code review
/commitAI-generated git commit message
/test [args]Run test suite (auto-detects Bun/Vitest/Jest/pytest/Go/Cargo)
/skill <name>Invoke a saved prompt skill
/hooksList configured lifecycle hooks
/initDetect tech stack and generate project rules
/compactSummarise context to free up the context window
/checkpoint [label]Snapshot project state
/rollback [id]Restore a checkpoint
/undoRevert last AI file changes
/shareExport session to markdown
/theme <name>Switch theme
/vimmode on|offToggle vim keybindings
/mcpManage MCP servers
/sessionsList saved sessions
/resume <id>Resume a previous session
/doctorDiagnose auth, API, MCP, and project health
/clearClear chat
/costShow session cost

Keyboard Shortcuts

ShortcutAction
ctrl+pCommand palette
ctrl+yCopy last AI response to clipboard
ctrl+dQuit
ctrl+cCancel streaming / quit
ctrl+x ctrl+eOpen $EDITOR to compose message
escCancel streaming
@Insert file reference (fuzzy picker)
!cmdRun shell command and inject output
Mouse dragSelect and auto-copy to clipboard

Vim Mode (/vimmode on)

KeyAction
escNORMAL mode
i / a / A / IINSERT mode
h / lMove cursor
j / kScroll chat
w / b / eWord motion
0 / $Line start / end
ddClear input
DKill to end of line
gg / GScroll to top / bottom
ctrl+u / ctrl+dHalf-page scroll

Configuration

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

{
  "baseUrl": "https://api.klaatai.com",
  "routingDisplay": "minimal",
  "theme": "dark",
  "vimMode": false
}
KeyValuesDescription
routingDisplayoff / minimal / fullChat header detail level
themedark / light / dracula / nord / ayu / catppuccin / gruvboxUI theme
vimModetrue / falseVim 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

Keywords

ai

FAQs

Package last updated on 17 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts