Skip to main content

⚡ Kapsel

A cross-platform terminal environment that wraps your shell with unified commands, context-aware autocompletion, and zero global pollution.

PyPI Version Python Version Platform Support License

Why Kapsel?FeaturesQuick StartBuilt-in PluginsInstallationArchitecture简体中文 日本語 Русский Polski Español Français


📺 Interactive Capsule in Action

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

Wrap complexity, expose simplicity. Run your native shell executables as usual, while enjoying automatic command translation, inline suggestions, rich completion specs, and a modular toolchain—all sandboxed within ~/.kapsel/.


💡 Why Kapsel?

Switching between operating systems often leads to broken muscle memory, cluttered dotfiles, and fractured autocompletion setups. Kapsel bridges this gap with a non-invasive capsule layer:

Challenge Traditional Shell Setup With Kapsel
Cross-Platform Friction Fractured commands across OS (dir vs ls, rmdir vs rm -rf) Unified Linux-first command layer across Windows, macOS, and Linux
Shell Profile Pollution Bloated .bashrc or $PROFILE with fragile global scripts 100% self-contained sandbox in ~/.kapsel/ (zero global mutation)
Autocompletion Setup Manual setup per shell, often incomplete or slow Instant context-aware completions for 1,000+ CLI tools via Carapace
Toolchain & Sync Sprawl Disjointed tools requiring repetitive manual installation Integrated kps plugins for runtimes, mirrors, directory jumping, and sync

✨ Features

  • 🌐 Cross-Platform Command Consistency: Type standard commands (ls -la, cat, rm -rf, grep) naturally in any terminal, automatically translated to host-native primitives without hijacking host built-ins.
  • ⚡ Context-Aware Autocompletion: Integrated with Carapace to deliver multi-level argument and context completions (Git branches, Docker images, npm scripts) across PowerShell, Bash, and Zsh.
  • 🛡️ Zero-Pollution Sandboxing: Everything (binaries, SQLite history, declarative specs, plugins, and logs) resides inside ~/.kapsel/. Your host shell configuration files remain completely untouched.
  • 🧩 Curated Plugin Ecosystem: Access powerful developer utilities (zoxide, mise, chsrc, pueue, AI assistants) directly through the unified kps command.
  • 🎨 Modern Card-Framed Aesthetics: Clean visual command card framing with exit code badges (✔ 0 / ✘ 1), execution stopwatch timing, and native i18n support across 7 languages.

🚀 Quick Start

Launch the interactive capsule shell:

kapsel

Inside Kapsel, commands run natively with enhanced feedback:

# 1. Native pass-through with timing & exit code card
git status
docker ps

# 2. Universal command translation on any OS
rm -rf ./temp_dir
cat package.json

# 3. Use built-in plugins anytime
kps portal work        # Jump to directory (zoxide)
kps ai "explain git rebase"  # Ask terminal AI assistant
kps shore get          # Auto-select fastest package mirrors

# 4. Inspect capsule state
kps status

One-Shot Execution: You can also invoke Kapsel tools directly from your regular shell using kps <command> (e.g. kps portal, kps status, kps ai).


🧩 Built-in Plugins

Kapsel comes pre-configured with 11 decoupled, official plugins under the kps namespace:

Plugin Command What It Does Powered by
portal kps portal / z Fast directory jumping with frecency weighting zoxide
ai kps ai Terminal AI copilot for generating and explaining commands OpenAI / Claude / Ollama
init kps init Multi-language toolchain runtime manager (Node, Python, Go, Rust) mise
shore kps shore Benchmark and switch fastest package & OS download mirrors chsrc
install kps install Universal software installer aggregating 20+ package managers mpm
alias kps alias Cross-platform alias translation with zero namespace collision Native Engine
autopilot kps autopilot Background queue & autonomous daemon task runner pueue
help kps help <cmd> Instant, community-driven practical command cheat sheets tealdeer
fuck kps fuck Intelligent autocorrect and syntax fix for mistyped commands thefuck
profile kps profile Cross-platform dotfile and workstation configuration sync chezmoi
rec kps rec Interactive CLI command snippet bookmarking & runner pet

📦 Installation

Recommended (pipx / pip)

# Isolated installation via pipx (recommended)
pipx install kapsel-cli

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

One-Line Automated Installers

Quick bootstrap scripts that auto-detect your OS and configure completions:

# macOS & Linux:
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

Other Installation Options

  • Standalone Precompiled Binaries: Download ready-to-run releases from GitHub Releases.
  • Package Managers: Available on Scoop (scoop install kapsel), Homebrew, and Debian/Ubuntu .deb.
  • Build from Source: git clone https://github.com/MrEiu/Kapsel.git && cd Kapsel && pip install -e .

👉 For China mirror acceleration and full platform package manager details, see docs/INSTALLATION.md.


⚙️ Configuration

Kapsel stores its configuration in ~/.kapsel/config.yaml. Manage settings directly from your terminal:

# View configuration dashboard
kps config

# Open configuration file in external editor
kps config edit

# Adjust settings on the fly
kps config set ui.enable_banner false
kps config set interaction.autosuggest_sensitivity 0.2

🏛️ Architecture & Sandboxing

Kapsel follows a Zero-Pollution Principle. All runtime state is strictly contained:

~/.kapsel/
├── config.yaml          # System-wide UI configuration, themes, and interaction settings
├── history.db           # Persistent SQLite database storing command history and stats
├── bin/                 # User-space standalone binary tools (carapace, zoxide, mise...)
├── specs/               # Declarative autocompletion YAML specifications
├── plugins/             # Installed official and community plugin extensions
└── logs/                # Diagnostic logs and session metrics
  • Dual-State Engine: Native executables run directly via host subshell passthrough; capsule utilities run via the unified kps registry.
  • Collision Sentinel: Ensures native shell built-ins (e.g. PowerShell's Get-Alias, Get-Help) are never intercepted or hijacked.
  • Isolated Plugins: Plugins run independently, ensuring third-party extensions cannot crash the core shell.

🧪 Development & Testing

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

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

# Run unit test suite
pytest tests/ -v

📄 License

Distributed under the MIT License. Built by MrEiu and open-source contributors.

Release files for kapsel-cli 0.2.1

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.2.1
File Size Uploaded
kapsel_cli-0.2.1.tar.gz 149.7 kB Details

Built distribution (wheel)

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

Total release size: 316.9 kB

Release files / kapsel_cli-0.2.1.tar.gz

Download URL kapsel_cli-0.2.1.tar.gz
Size 149.7 kB
Tags Source
SHA-256 checksum
How to use checksums
479cf79e8b5baf6d214933e74dffede6efe35dbc2391a2f7d09571e24b85242f
BLAKE2b-256 checksum
How to use checksums
ecb78baa64dcef8d79eb51a462f0ae1e67d909af58929fff9eae9290c8fc62ec
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.2.1-py3-none-any.whl

Download URL kapsel_cli-0.2.1-py3-none-any.whl
Size 167.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24bc75af01cdde2250b3f03fd4db28a9eadfef5b7e89016c739bee2bb2ff58ef
BLAKE2b-256 checksum
How to use checksums
a171c19e911cbdcfb5d193c6ac3a9d0622a0276b9c1798c4eef56d9cfe304108
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

This release

0.2.1 This release

2 release files

0.1.9

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