⚡ Kapsel
Next-Generation Intelligent Terminal Capsule & Cross-Platform Ergonomic Shell Multiplexer
"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 Features • Quick Installation • Architecture • Plugin Ecosystem • Comparison • Cheatsheet
╭─ 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 -rfvsRemove-Item,catvstype,ls -lavsdir /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 underkpsandkapsel. - 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 thekpsnamespace—guaranteeing native shell commands (e.g. PowerShell'sGet-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 (
✔ 0or✘ 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
Option A: Universal Python Package (Global / Isolated)
# Recommended: Isolated installation via pipx
pipx install kapsel-cli
# Or standard pip installation
pip install --upgrade kapsel-cli
Option B: One-Liner Toolchain Installers
Automatically downloads, verifies, and installs all required binary tools (carapace, zoxide, mise, chsrc, aichat, pueue, chezmoi, pet, tealdeer, fzf) into user space:
| Platform | One-Line Installation Command |
|---|---|
| Windows (PowerShell) |
irm https://raw.githubusercontent.com/MrEiu/Kapsel/master/scripts/install_tools_windows.ps1 | iex
|
| macOS (Homebrew) |
curl -fsSL https://raw.githubusercontent.com/MrEiu/Kapsel/master/scripts/install_tools_macos.sh | bash
|
| Linux (All Distros) |
curl -fsSL https://raw.githubusercontent.com/MrEiu/Kapsel/master/scripts/install_tools_linux.sh | bash
|
| China Fast-Track (国内极速镜像) |
# Windows:
irm https://ghproxy.net/https://raw.githubusercontent.com/MrEiu/Kapsel/master/scripts/install_cn.ps1 | iex
# Linux / macOS:
curl -fsSL https://ghproxy.net/https://raw.githubusercontent.com/MrEiu/Kapsel/master/scripts/install_cn.sh | bash
|
🧩 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 |
aichat (Rust) |
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.
Release files for kapsel-cli 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kapsel_cli-0.1.3.tar.gz | 117.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kapsel_cli-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 254.5 kB
Release files / kapsel_cli-0.1.3.tar.gz
| Download URL | kapsel_cli-0.1.3.tar.gz |
|---|---|
| Size | 117.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4db6d0a584e2d22b35e2d9cda82dcd3b882f42b5165e9aa8c81bd81697909959
|
|
BLAKE2b-256 checksum How to use checksums |
2aab7a6acbcbdb1a3dfe828e36be14c688d2b23300e75a7da5bb6f7ad2fa0c1a
|
| 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.3-py3-none-any.whl
| Download URL | kapsel_cli-0.1.3-py3-none-any.whl |
|---|---|
| Size | 137.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
366bd23f83cfb035772376f04bc91dd18057e0751ba4eefbea9dfdadf559f6a4
|
|
BLAKE2b-256 checksum How to use checksums |
7c0079a8540afa07f5232701a29cc539b41a3ac27fd7fb6a151362508e5c56d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|