Krit is a high-performance terminal emulator designed to bridge the gap between the shell and Large Language Models. Built for engineers who live in the CLI, Krit understands your environment, remembers your session context, and helps you execute complex commands safely—all within a unified, hardware-accelerated interface.
Krit maintains a background buffer of your terminal scrollback. The integrated AI understands your current directory, hardware specifications, and previous command outputs to provide highly relevant assistance.
Convert intent into action instantly. Prefix any query with - (e.g., - find all docker volumes over 1GB) to receive optimized shell commands tailored to your OS and environment.
Execute AI-generated commands with confidence. Krit features a real-time classification engine that detects destructive operations (like rm -rf, dd, or sensitive config edits) and requires explicit user confirmation before execution.
Inspired by high-performance CLI tools like fastfetch, Krit features a borderless, minimalist UI with a WebGL-powered rendering engine for zero-latency input and smooth text display.
Choose the brain that powers your terminal. Krit supports:
- Cloud: Groq (Llama 3), OpenAI (GPT-4o/o1)
- Local: Ollama (for 100% private, offline inference)
Krit is built on a split-process architecture designed for performance, security, and low-latency interaction.
graph TD
subgraph "Main Process (Node.js)"
IPC[IPC Main Handlers]
PM[PTY Manager] --> |node-pty| OS[(Native OS Shell)]
AC[AI Controller] --> |REST / Local| LLM(Groq / OpenAI / Ollama)
SL[Safety Engine] --> |Pattern Matching| Threat[Destructive Command Detector]
SC[Settings Logic] --> |node:fs| FS[(~/.krit/config.json)]
MD[Markdown Engine] --> |marked-terminal| ANSI[ANSI Formatter]
IPC <--> |Terminal I/O| PM
IPC <--> |AI Queries / Context| AC
IPC <--> |Intercepts Commands| SL
IPC <--> |Reads / Writes| SC
IPC <--> |Converts to ANSI| MD
end
subgraph "Renderer Process (Web UI)"
Bridge[contextBridge / Preload]
XT[Xterm.js Engine] --> |WebGL| Canvas[Terminal UI]
UIAI[UI & Chat Handlers]
State[State Manager]
UIAI <--> Bridge
State <--> Bridge
UIAI <--> XT
UIAI <--> State
end
Bridge <--> |Inter-Process Communication| IPC
- Terminal Engine: Powered by
xterm.jswith WebGL acceleration. It interfaces withnode-ptyin the main process to handle real-world terminal behaviors and signal passing. - AI Orchestrator: A modular controller that supports multiple LLM providers. It automatically injects terminal context (CWD, hardware info, scrollback history) into every request.
- Security Classification: A real-time engine that parses AI-generated commands. If a command matches destructive patterns (e.g.,
rm -rf,dd,mkfs), it is intercepted and requires explicit user consent before being piped to the shell. - Platform Bridge: Custom IPC implementation ensures that heavy AI processing or terminal I/O doesn't block the UI thread, maintaining a solid 60fps even during high output bursts.
src/
├── ai/ # AI Engine logic
│ ├── providers/ # Groq, OpenAI, Ollama adapters
│ ├── controller.js # Main AI orchestration logic
│ ├── safety.js # Command classification & security
│ └── context.js # Scrollback & session management
├── main/ # Electron Main Process
│ ├── index.js # App entry point & IPC handlers
│ ├── pty.js # Pseudo-terminal lifecycle management
│ └── wizard.js # First-run setup & configuration
├── renderer/ # Electron Renderer Process (Frontend)
│ ├── index.html # Main UI structure
│ ├── renderer.js # Entry point for the frontend
│ ├── ui.js # DOM manipulation & screen rendering
│ └── ai.js # Frontend AI interaction logic
└── config/ # System & user configuration
The recommended way to run Krit is via the standalone AppImage.
- Download
krit-latest.AppImagefrom the latest release. - Make it executable:
chmod +x krit-latest.AppImage
- Launch:
./krit-latest.AppImage
- Universal Directory Sync: Now features OSC 7 shell integration to reliably track your working directory across all platforms.
- Smart Session Recovery: If your shell crashes or terminates, Krit now offers an instant "Press Enter to Restart" recovery.
- Enhanced AI Input: Fully interactive AI prompt buffer with support for arrow keys, middle-of-line editing, and persistent font scaling.
- Privacy Hardening: Proactive environment scrubbing to ensure your API keys never leak into the shell's sub-processes.
- Shortcut Support: Use
Ctrl+Kto clear scrollback andCtrl +/-to scale the UI (saved across restarts).
To build Krit from source or contribute:
- Clone & Install:
git clone https://github.com/10KRITESH/krit.git cd krit npm install - Launch Developer Mode:
npm start
- Build Distribution Packages:
npm run dist
Krit is built with a security-first philosophy. Standard terminal input is processed locally and never leaves your machine. AI queries are only triggered by explicit user prefixes.
Built for the next generation of command-line power users.