Documentation

Welcome to the official documentation for Klein — a professional terminal-hosted IDE (TIDE) designed to combine the power of modern editors with the speed of terminal-native tools.

Overview

Klein is a lightweight, terminal-based text editor built in Rust. It provides an IDE-like interface using ratatui for the user interface and portable-pty for terminal integration, giving developers a keyboard-centric coding environment directly in the command line.

Whether you're editing multiple files, browsing a project directory, or compiling code from the embedded shell, Klein brings essential workflow tools into one efficient console application.

Key Features

Klein doesn't compromise on functionality or looks. Here is what you get out of the box:

🗂️ Multi-Tab Editing

Seamlessly open and manage multiple files using intuitive tab navigation.

💻 Integrated Terminal

A fully-featured embedded terminal to execute scripts, manage Git, and run build commands.

🌳 File Explorer

Effortless project navigation with a collapsible, visual directory tree sidebar.

📝 Rich Text Editing

Syntax highlighting via syntect, advanced multiline selection, and clipboard integration.

Installation

Via mise (Recommended)

If you have mise installed, a single command downloads and activates the latest pre-built binary:

mise use -g github:Adarsh-codesOP/Klein
Tip

mise auto-detects your OS and architecture. Run mise install github:Adarsh-codesOP/Klein@latest to refresh to a newer release.

Automatic Setup Script

A pair of installer scripts configure your workspace, download the binary, and set your preferred shell.

Windows (PowerShell):
irm https://klein.adarshas.me/install.ps1 | iex
Linux / macOS / WSL (Bash):
curl -sSL https://klein.adarshas.me/install.sh | bash

Manual Build

Clone the repository and build from source using Cargo:

git clone https://github.com/adarsh-codesOP/Klein.git
cd Klein
cargo install --path .

CLI Usage

Klein supports standard command-line options for quick control:

# Show help information
klein --help

# Show version information
klein --version

# Start the editor in current directory
klein

Keybindings

Klein is designed to be fully navigable via keyboard, keeping your hands on the home row.

Navigation & Focus

Shortcut Action
Ctrl + / Switch focus (Sidebar, Editor, Terminal)
Ctrl + RFocus Explorer (Sidebar)
Ctrl + EFocus Editor
Ctrl + TFocus Terminal
Ctrl + BToggle Sidebar Visibility
Ctrl + `Toggle Terminal Visibility

Editor & Tabs

Shortcut Action
Ctrl + Shift + ZNext Tab
Ctrl + Shift + XClose Current Tab
Ctrl + SSave Current File
Ctrl + CCopy Selection
Ctrl + VPaste from Clipboard
Ctrl + QQuit Application
Tip

Press Ctrl + H inside Klein at any time to open the interactive help overlay.

Configuration

Make Klein truly yours. Core configurations, including default shell paths, UI colors, and text banners, can be modified in the source.

Navigate to src/config.rs to adjust the TIDE's environment:

// Example: Altering default focus colors in src/config.rs
pub mod colors {
    use ratatui::style::Color;
    pub const EXPLORER_FOCUS: Color = Color::Green;
    pub const EDITOR_FOCUS: Color = Color::Yellow;
    pub const TERMINAL_FOCUS: Color = Color::Cyan;
}
Recompilation Required

Any changes made to src/config.rs require a cargo run or cargo install to take effect.

Contributing

We welcome contributions of all shapes and sizes! Whether you are squashing a bug, adding a new feature, or simply fixing a typo, your help is greatly appreciated.

Please read our Contributing Guidelines to understand the workflow for submitting pull requests and reporting issues.