🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@katasumi/tui

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@katasumi/tui

Terminal UI for Katasumi keyboard shortcut search

npmnpm
Version
0.0.7
Version published
Weekly downloads
5
-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

Katasumi (隅) - Your Corner Companion for Keyboard Shortcuts

Build Status Version License Downloads

Katasumi (カタスミ / 隅) - meaning "in the corner" - is an AI-powered keyboard shortcut discovery tool that stays quietly in the background, ready to help whenever you need it.

Like a helpful friend waiting in the corner of your workspace, Katasumi provides instant access to keyboard shortcuts across terminal and desktop applications, supporting you without getting in the way.

📑 Table of Contents

🎯 Philosophy

The name "katasumi" embodies our design philosophy:

  • Always There: Like something resting in the corner, always accessible but never intrusive
  • Background Support: Provides help exactly when you need it, then gets out of your way
  • Quiet Helper: Runs unobtrusively, blending into your workflow
  • Reliable Companion: Dependable support for your daily productivity

✨ Features

Terminal Interface (TUI)

  • 🚀 Lightning-fast fuzzy search for keyboard shortcuts
  • 📦 Works 100% offline with bundled shortcuts database
  • 🎨 Multiple search modes: App-First, Full-Phrase, and Detail View
  • 💾 Local caching of custom shortcuts
  • 🤖 AI-powered scraping for long-tail applications (optional)

Web Interface

  • 🌐 Accessible from any browser
  • 🔍 Shared database of curated shortcuts
  • 💎 Premium tier with managed API keys for AI searches
  • 📱 Responsive design for desktop and mobile

Premium vs Free Tier

Premium Features (require account + subscription):

  • 🔄 Multi-device sync for shortcuts and collections
  • 🤖 Built-in AI search (no API key needed)
  • ☁️ Cloud storage for user shortcuts
  • 🎯 Unlimited AI queries

Free Features (no account needed):

  • 🔍 Full keyword search functionality
  • 💻 Local-only TUI usage
  • 🤖 AI search with your own API key
  • 📝 Local shortcut creation and editing

🤖 AI Setup for Free Users

Free tier users can access AI-powered shortcut search by configuring their personal API key. Premium users enjoy built-in AI with no setup required.

💰 Cost Estimate: Typical usage costs $0.50-$2/month with a personal API key, depending on your search frequency.

Getting Your API Key

Choose one of these AI providers:

ProviderGet API KeyPricing
OpenAIplatform.openai.com/api-keysView Pricing
Anthropic (Claude)console.anthropic.com/settings/keysView Pricing
OpenRouteropenrouter.ai/keysView Pricing
OllamaRun locallyFree (runs on your machine)

Configuration Methods

  • Create the configuration directory:

    mkdir -p ~/.katasumi
    
  • Create ~/.katasumi/config.json:

    {
      "ai": {
        "provider": "openai",
        "apiKey": "sk-your-api-key-here",
        "model": "gpt-4"
      }
    }
    
  • Launch Katasumi and press F4 or 'a' to toggle AI search mode

Method 2: Environment Variables

Set environment variables before running Katasumi:

export KATASUMI_AI_PROVIDER=openai
export KATASUMI_AI_KEY=sk-your-api-key-here
export KATASUMI_AI_MODEL=gpt-4

# Optional: Custom API endpoint
export KATASUMI_AI_BASE_URL=https://api.openai.com/v1

Then launch Katasumi as usual:

katasumi

Method 3: TUI Command (Interactive)

Launch Katasumi and use the config command:

katasumi config set ai.provider openai
katasumi config set ai.apiKey sk-your-api-key-here
katasumi config set ai.model gpt-4

Configuration Examples

OpenAI (GPT-4)

{
  "ai": {
    "provider": "openai",
    "apiKey": "sk-...",
    "model": "gpt-4",
    "baseUrl": "https://api.openai.com/v1"
  }
}

Anthropic (Claude)

{
  "ai": {
    "provider": "anthropic",
    "apiKey": "sk-ant-...",
    "model": "claude-3-opus-20240229"
  }
}

OpenRouter (Multiple Models)

{
  "ai": {
    "provider": "openrouter",
    "apiKey": "sk-or-...",
    "model": "anthropic/claude-3-opus",
    "baseUrl": "https://openrouter.ai/api/v1"
  }
}

Ollama (Local)

{
  "ai": {
    "provider": "ollama",
    "model": "llama2",
    "baseUrl": "http://localhost:11434/v1"
  }
}

Note: Ollama runs locally and doesn't require an API key

Using AI in the TUI

  • Launch Katasumi: katasumi
  • Toggle AI Mode: Press F4 or 'a' key
  • Search with AI: Type natural language queries like:
    • "shortcuts for commenting code in vim"
    • "how to split window in tmux"
    • "vscode keyboard shortcuts for debugging"

Web Interface Usage

For API requests to /api/ai, include your API key:

fetch('/api/ai', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    query: "vim shortcuts for navigation",
    userApiKey: "sk-...",
    aiProvider: "openai"
  })
})

Troubleshooting

"Invalid API Key" Error

  • Check your API key is correct and active
  • Verify provider matches your API key type (OpenAI keys don't work with Anthropic, etc.)
  • Check account billing - ensure your provider account has billing enabled

"Rate Limit Exceeded" Error

  • Wait a few minutes and try again
  • Upgrade your API plan with your provider
  • Reduce query frequency or switch to a different provider

AI Toggle Not Working

  • Verify configuration exists at ~/.katasumi/config.json
  • Check permissions: chmod 600 ~/.katasumi/config.json
  • Validate JSON syntax using jq . ~/.katasumi/config.json

Ollama Connection Issues

  • Start Ollama: ollama serve
  • Pull a model: ollama pull llama2
  • Check baseUrl points to http://localhost:11434/v1

🔒 Security Best Practices

⚠️ Important Security Notes:

  • Never commit config.json to version control
  • Never share your API keys publicly or in screenshots
  • Use environment variables in CI/CD pipelines instead of config files
  • Rotate keys regularly if you suspect they've been exposed
  • Set spending limits in your AI provider account settings
  • Use read-only keys if your provider offers them

Premium vs Free AI Features

FeatureFree (Your API Key)Premium (Built-in)
AI Search✅ Yes✅ Yes
Configuration Required✅ Yes❌ No
API Key Management👤 You manage🏢 We manage
Cost💵 You pay provider💎 Included in subscription
Query LimitsProvider-dependent♾️ Unlimited
Setup Time~5 minutes⚡ Instant

🏗️ Architecture

Katasumi uses a monorepo structure with shared core logic:

katasumi/
├── packages/
│   ├── core/              # Shared search & scraping logic
│   ├── tui/               # Terminal interface
│   └── web/               # Web interface (React/Next.js)
├── pnpm-workspace.yaml
├── turbo.json
└── package.json

Tech Stack

Core (Shared)

  • TypeScript
  • Prisma ORM (SQLite + PostgreSQL schemas live in core)
  • Keyword search + Optional AI (OpenAI/Claude/Ollama)

TUI

  • SQLite for local storage
  • Zero-config setup
  • Fast local queries (<10ms)

Web

  • Next.js (React) + Vercel
  • PostgreSQL (Supabase/Vercel Postgres)
  • Tailwind CSS

🚀 Getting Started

Quick Install (TUI)

Install Katasumi globally for instant access from any terminal:

npm install -g katasumi

Then launch it with:

katasumi

Note: Global installation is not yet available as the package has not been published to npm. For development and contribution setup, see the Contributing section below.

Running Unobtrusively

Katasumi is designed to stay out of your way. Here are some tips for running it unobtrusively:

  • TUI Mode: Assign a global keyboard shortcut to launch Katasumi instantly
  • Background Process: Run the TUI in a tmux/screen session for instant access
  • Terminal Dropdown: Use with terminal drop-down tools (e.g., Guake, iTerm2 Hotkey Window)
  • Web Bookmarklet: Save the web version as a bookmarklet for quick browser access

📊 Database Strategy

Katasumi uses a hybrid approach:

  • Bundled Core DB: Ships with shortcuts for popular apps (vim, tmux, VSCode, etc.)
  • Local Cache: Stores your custom and scraped shortcuts
  • On-Demand Scraping: AI-powered scraping for long-tail applications
  • Community Contributions: Core database enhanced by community via GitHub

📚 Documentation

For detailed documentation, see:

🛠️ Development

This project is currently in early development. We use a monorepo structure with Turborepo for efficient builds and development.

Tech Stack

  • TypeScript - Type-safe code across all packages
  • Prisma - Database ORM with SQLite and PostgreSQL support
  • Ink - React for terminal UIs (TUI)
  • Next.js - React framework for web application
  • Turborepo - Monorepo build system

🤝 Contributing

We welcome contributions from developers of all skill levels! Whether you're fixing a bug, adding a feature, improving documentation, or suggesting ideas, your help is appreciated.

Quick Links:

Development Environment Setup

Prerequisites

  • Node.js 18+ and npm (or pnpm)
  • Docker and Docker Compose (recommended)
  • OR PostgreSQL 14+ (if not using Docker)

Quick Setup (Automated)

For the fastest setup, use our automated script:

git clone https://github.com/ClearsiteConsultants/katasumi.git
cd katasumi
./quick-setup.sh

This script will:

  • Start PostgreSQL via Docker (if available)
  • Copy environment configuration files
  • Install dependencies
  • Build and seed both SQLite (TUI) and PostgreSQL (Web) databases

Manual Setup

  • Clone and install:

    git clone https://github.com/ClearsiteConsultants/katasumi.git
    cd katasumi
    pnpm install
    
  • Start PostgreSQL:

    docker-compose up -d  # Using Docker
    # OR see DEVELOPMENT.md for manual PostgreSQL installation
    
  • Configure environment:

    cp packages/core/.env.example packages/core/.env
    cp packages/web/.env.example packages/web/.env.local
    
  • Build and seed databases:

    pnpm run setup:tui  # SQLite for TUI
    
    # PostgreSQL for Web
    cd packages/core
    DATABASE_URL="postgres://katasumi:dev_password@localhost:5432/katasumi_dev" DB_TYPE="postgres" pnpm run migrate
    DATABASE_URL="postgres://katasumi:dev_password@localhost:5432/katasumi_dev" pnpm run seed
    cd ../..
    
  • Start development:

    pnpm run dev  # Starts both TUI and Web
    

For detailed instructions and troubleshooting, see DEVELOPMENT.md.

Development Workflow

Working on different packages:

# Core package (shared logic)
pnpm run build --workspace=@katasumi/core

# TUI (terminal interface)
pnpm run dev --workspace=@katasumi/tui
pnpm run start:tui  # Test the TUI

# Web (Next.js app)
pnpm run dev --workspace=@katasumi/web
# Visit http://localhost:3000

Database operations:

pnpm run migrate:status      # Check migration status
pnpm run migrate:rollback    # Rollback last migration
pnpm run seed                # Re-seed database
pnpm run build-db            # Rebuild TUI database

PostgreSQL schema and migrations live in packages/core/prisma/schema.postgres.prisma and packages/core/migrations.

Testing & Running

Run tests:

pnpm test                              # All tests
pnpm test --workspace=@katasumi/core  # Specific package
pnpm test -- --watch                   # Watch mode

Type checking:

pnpm run typecheck                         # All packages
pnpm run typecheck --workspace=@katasumi/core  # Specific package

Test applications:

pnpm run start:tui   # Test TUI interactively
pnpm run start:web   # Start web app (http://localhost:3000)

How to Contribute

  • Fork the repository to your GitHub account
  • Clone your fork locally
  • Create a branch for your changes: git checkout -b feature/my-feature
  • Make your changes with clear, atomic commits
  • Test thoroughly - run pnpm test and pnpm run typecheck
  • Push to your fork: git push origin feature/my-feature
  • Open a Pull Request with a clear description

Before submitting:

  • ✅ All tests pass (pnpm test)
  • ✅ Code is properly typed (pnpm run typecheck)
  • ✅ Documentation is updated if needed
  • ✅ Commit messages follow Conventional Commits

For more details, see CONTRIBUTING.md.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2026 Josh Pitkin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Katasumi - Always there in your corner, ready to help. 隅

Keywords

shortcuts

FAQs

Package last updated on 09 Mar 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