Skip to main content

⚡ Kapsel

Next-Generation Intelligent Terminal Capsule & Cross-Platform Ergonomic Shell Multiplexer

Python Version Platform Support License

"Wrap complexity, expose simplicity."
A zero-pollution, context-aware command abstraction layer and high-performance interactive capsule environment.
Empowering consistent developer workflows across Windows PowerShell, macOS Zsh, and Linux Bash.


Key FeaturesQuick InstallationArchitecturePlugin EcosystemComparisonCheatsheet🇨🇳 简体中文


╭─ kapsel [pwsh] ~/Projects/Kapsel 14:32:05
╰─ ❯ git checkout -b feature/dynamic-specs
✔ 0  git checkout -b feature/dynamic-specs  ⏱ 24ms

🌟 Overview

Developers daily oscillate between disparate operating systems, suffering from fragmented terminal ergonomics:

  • Muscle memory collisions (rm -rf vs Remove-Item, cat vs type, ls -la vs dir /a);
  • Fragile global dotfiles polluting .bashrc, config.fish, or $PROFILE;
  • Inconsistent autocompletion engines across shells.

Kapsel solves this by introducing a non-invasive, sandboxed terminal capsule. It operates as an ergonomic execution layer that intercepts and enhances command-line interactions with zero global system pollution—delivering sub-millisecond asynchronous autocompletion, Linux-first universal mapping, and automated environment isolation.


🚀 Key Features

1. Dual-State Execution Multiplexer

  • Native Execution Layer (Default Mode): Direct, zero-overhead passthrough for all system executables (git, docker, npm, cargo, python, vim). Retains full TTY interaction, real-time signal handling, and standard stream piping.
  • Unified Capsule Pipeline (kps <cmd> / kapsel <cmd>): A single entry point for universal commands, plugin utilities, and system configurations. Strips execution prefixes and translates cross-platform commands into host-optimized primitives on the fly.
  • Asynchronous Deep Autosuggestions: Muted inline history prediction powered by a persistent, isolated SQLite statistical store (~/.kapsel/history.db). Accept suggestions instantaneously with (Right Arrow).

2. Multi-Shell Dynamic Autocompletion (Carapace Powered)

  • 1,000+ Command Coverage: Direct integration with Carapace enables multi-shell, multi-level argument and context completion (git branches/tags, docker containers/images, kubectl pods, npm scripts).
  • Zero-Setup Bootstrapping: On first launch, Kapsel silently bootstraps the official platform binary into ~/.kapsel/bin/ with zero administrative/root permissions.

3. Dual Root Specification & Collision Sentinel

  • Namespaced Root Trees (kps.yaml & kapsel.yaml): Dynamically compiles core built-ins and plugin specifications into isolated root trees under kps and kapsel.
  • Host Namespace Collision Sentinel: Strictly guards host shell built-ins (alias, help, install, history, profile, ps, kill, dir). Commands with potential host collisions are sealed within the kps namespace—guaranteeing native shell commands (e.g. PowerShell's Get-Alias) remain 100% unhijacked.
  • Deep Parameter Completions: Typing kps alias add <Tab> delivers rich multi-level flag completion (--from, --to, --shell, --global) in any terminal.

4. Modular, Crash-Proof Plugin Subsystem

  • Decoupled Architecture: Plugins operate in isolated memory boundaries. A malfunctioning plugin can never crash Kapsel Core.
  • Declarative Spec Standard: Every plugin defines independent declarative YAML specifications adhering to Carapace specifications.

5. Minimalist Boxed Terminal Aesthetics

  • Card Framing: Clear visual demarcation of command inputs and outputs using modern boxed framing (╭─ ❯ and ╰─).
  • Telemetry Feedback: Instantaneous display of execution exit codes (✔ 0 or ✘ exit 1) and precise wall-clock elapsed time (⏱ 38ms).
  • Native Multilingual Engine (i18n): Full localization across 7 languages (en, zh_CN, ja, es, fr, de, ru).

⚡ Quick Installation

Choose the installation method that best fits your environment:

🇨🇳 China Mainland Users: If you are located in China and require high-speed mirror acceleration (ghproxy, Tsinghua PyPI mirror, domestic download scripts), please refer to README_zh.md or docs/INSTALLATION.md.


1. 📦 Package Managers

PyPI (Python 3.9+)

# Recommended: Isolated environment via pipx (prevents global Python pollution)
pipx install kapsel-cli

# Or standard pip installation
pip install --upgrade kapsel-cli

Windows: Scoop

# Add Kapsel official bucket and install
scoop bucket add kapsel https://github.com/MrEiu/scoop-bucket
scoop install kapsel

macOS & Linux: Homebrew

# Add Kapsel official tap and install
brew tap MrEiu/tap
brew install kapsel

Debian & Ubuntu: APT & DPKG (.deb)

curl -LO https://github.com/MrEiu/Kapsel/releases/latest/download/kapsel_amd64.deb
sudo dpkg -i kapsel_amd64.deb || sudo apt-get install -f -y

2. 💾 Precompiled Standalone Binaries (Zero Dependencies)

No Python runtime or external package managers required. Simply extract and run:

Platform / Architecture Release Artifact Official GitHub Download
Windows x86_64 kapsel-windows-x86_64.zip Download
Linux x86_64 kapsel-linux-x86_64.tar.gz Download
macOS (Universal) kapsel-macos-universal.tar.gz Download
Debian / Ubuntu kapsel_amd64.deb Download

💡 Usage Tip: Extract the archive and place kapsel (or kapsel.exe) and kps (or kps.exe) into any directory in your system PATH (such as ~/.kapsel/bin or /usr/local/bin).


3. 🌐 Automated Toolchain Installers

A unified single-command installer that automatically detects your OS platform, runs intelligent environment preflight inspections, and configures Kapsel with your preferred edition:

# macOS & Linux (Bash / Zsh):
curl -fsSL https://raw.githubusercontent.com/MrEiu/Kapsel/master/scripts/install.sh | bash

# Windows (PowerShell):
irm https://raw.githubusercontent.com/MrEiu/Kapsel/master/scripts/install.ps1 | iex

Intelligent Fast-Path & Preflight: The installer first inspects your existing Python runtime, Kapsel version, Carapace engine, PATH configurations, and installed plugins. Anything already up to date is skipped automatically (finishing in < 1 second).

📦 Available Editions:

  • Lightweight Edition (--lite / -Lite): Core Kapsel CLI + Carapace completion engine (~20MB, ultra fast bootstrap).
  • Full Edition (--full / -Full, default): Core + system package manager (Scoop / Homebrew / apt) + all 11 official plugins.

4. 🛠️ Build from Source

Ideal for developers wishing to contribute to Kapsel core or develop custom plugins:

git clone https://github.com/MrEiu/Kapsel.git
cd Kapsel
pip install -e .
kps completion sync

🧩 Official Plugin Ecosystem

Kapsel maintains a modular, decoupled plugin suite designed to satisfy modern engineering workflows:

Plugin Command Core Technology Description
init kps init mise (Rust) Project toolchains & polyglot runtime manager (replaces nvm, pyenv, rbenv).
portal kps portal / z zoxide (Rust) Frecency-weighted directory teleportation with fuzzy navigation.
shore kps shore chsrc (C) Automated ultra-fast mirror switcher (PyPI, Rust, Node, Go, OS mirrors).
install kps install mpm (Python) Unified CLI package manager aggregating 20+ package managers.
alias kps alias Native Engine Universal command alias translation and multi-terminal cross-mapping.
ai kps ai Native (OpenAI SDK) Terminal AI copilot supporting OpenAI, Claude, Gemini, DeepSeek, and Ollama.
autopilot kps autopilot pueue (Rust) Autonomous background task queue and long-running daemon execution manager.
fuck kps fuck thefuck (Python) Intelligent terminal input error correction and automated syntax fixing.
help kps help <cmd> tealdeer (Rust) Instantaneous practical command cheat sheets and quick lookup (tldr).
profile kps profile chezmoi (Go) Cross-platform dotfiles, shell profiles, and secret-encrypted environment manager.
rec kps rec pet (Go) Interactive CLI snippet recorder, argument parameterizer, and runner.

📊 Feature Matrix & Comparison

Feature Capability Kapsel Standard Shells (Bash/Zsh/Pwsh) Starship Oh-My-Zsh
Non-invasive Runtime (Zero Profile Mutation) Yes No No No
1,000+ Command Context Completion (Carapace) Yes Manual plugins No (Prompt only) Partial (Slow)
Cross-Platform Linux-First Mapping (kps) Yes No No No
Dual Root Spec Architecture (Anti-Collision) Yes No No No
Boxed Terminal Execution Framing Yes No Prompt only No
Isolated Sandbox State (~/.kapsel/) Yes Fragmented No Fragmented
Sub-Millisecond Async UI Response Yes Depends Yes Often Slow

📖 Commands Reference

Interactive Shell Mode (kapsel / kps)

Launch Kapsel as an interactive shell session:

kapsel

Within the capsule session, the following unified commands are available:

help                   Display Kapsel manual, interaction mechanisms, and command cheat sheet
status                 Inspect OS environment, active host shell, Git branch, and sandbox status
upgrade [plugin]       Two-stage upgrade check for Kapsel Core and official plugins with changelogs
search [-a]            Search and discover official plugins with versions and install states
enable <plugin>        Activate and enable an installed plugin, syncing autocompletions
disable <plugin>       Disable an active plugin without deleting local files
config                 Inspect or edit core configuration (~/.kapsel/config.yaml)
  config path          Print physical configuration file path
  config edit          Open configuration in default external editor
  config get <key>     Retrieve value for a configuration key
  config set <k> <v>   Update configuration value from terminal
  config reload        Hot-reload configuration from disk without session restart
completion             Manage, inspect, and synchronize declarative Carapace specifications
  completion ls        List active completion specifications, scopes, and mount states
  completion sync      Force compile and synchronize dual root specs (kps.yaml and kapsel.yaml)
  completion new <cmd> Scaffold a new declarative specification template
  completion path      Display active spec directories
datadir                Inspect or safely relocate data storage sandbox directory
language <lang>        Switch active UI language (en, zh_CN, ja, es, fr, de, ru)
toggle                 Toggle Kapsel default terminal mode (open on first call, close on second)
clear                  Clear terminal screen and re-render header banner
exit                   Cleanly exit Kapsel and return to native host shell

One-Shot External Execution

Execute any capsule or plugin command directly from your standard shell:

# Management & Diagnostics
kps status
kps completion ls
kps config edit

# Plugin commands
kps portal ls
kps shore get
kps init use node@22

# Cross-platform mapped commands
kps rm -rf dist/
kps ls -la

🔒 Directory Sandboxing & State Model

Kapsel adheres strictly to the Zero-Pollution Guarantee. All data, binaries, caches, and logs reside exclusively within the user sandbox directory:

~/.kapsel/
├── config.yaml          # System-wide UI configuration (colors, card borders, language)
├── history.db           # Persistent SQLite database storing command history and stats
├── bin/                 # User-space standalone binary tools (carapace, zoxide, mise, chsrc...)
├── specs/               # User custom declarative autocompletion specifications
├── plugins/             # Installed official and community plugin packages
└── logs/                # Session logs and crash diagnostics

🧪 Testing & Quality Assurance

The Kapsel codebase enforces thorough test coverage with strict type checks and isolated fixtures:

# Clone the repository
git clone https://github.com/MrEiu/Kapsel.git
cd Kapsel

# Install test dependencies
pip install -e ".[test]"

# Run full test suite
pytest tests/ -v

All 79 automated unit tests validate spec manager discovery, collision sentinel blocking, carapace integration, plugin lifecycles, and i18n resolution.


🤝 Contributing & Community

Contributions are welcome!

  • Check out issues to find tasks or report bugs.
  • For developing or submitting plugins, refer to the Plugins Guide.

📄 License

Kapsel is open-source software licensed under the MIT License.

Built with modern terminal ergonomics by MrEiu and the Kapsel Open-Source Team.

Release files for kapsel-cli 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kapsel-cli 0.1.9
File Size Uploaded
kapsel_cli-0.1.9.tar.gz 154.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kapsel-cli 0.1.9
File Interpreter ABI Platform
kapsel_cli-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 323.4 kB

Release files / kapsel_cli-0.1.9.tar.gz

Download URL kapsel_cli-0.1.9.tar.gz
Size 154.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1459cb6d231af0a954a1f20781dd32d4ffe029e6ab899d500364f5ecffd2081d
BLAKE2b-256 checksum
How to use checksums
08c27a9f9dd6b94924400c4c1b47aaa81fe4706962aea3372a741dd79c360ff3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / kapsel_cli-0.1.9-py3-none-any.whl

Download URL kapsel_cli-0.1.9-py3-none-any.whl
Size 169.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f24a2d2ffc043422ca2b39fc7255eb67d0c7fdc134ee00493df2685444918f5d
BLAKE2b-256 checksum
How to use checksums
c5a380dd7dd185387e6cfe410388caa8f0e8e054b65a2666b7b5f7f85de9c103
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

0.7.6

2 release files

0.7.5

2 release files

0.7.2

2 release files

0.6.8

2 release files

0.6.3

2 release files

0.5.7

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.3.8

2 release files

0.3.6

2 release files

0.2.1

2 release files

This release

0.1.9 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page