AI-Native High-Performance Process Executor, Snapshot Engine, and Model Context Protocol (MCP) Server.
Designed specifically for AI coding agents (Claude Code, Antigravity, Devin, SWE-bench baselines) to outperform traditional POSIX Bash environments in benchmark tasks, token efficiency, and deadlock prevention.
- RTK (Rust Token Killer) Engine: Asynchronous output processing that strips ANSI escape sequences, collapses progress bars (
\r), and performs semantic truncation on long test/compiler outputs (pytest, cargo test, npm test), achieving a 75% to 92% reduction in token consumption. - Non-Interactive Guard & Anti-Deadlock Executor: Automatically injects non-interactive environment variables (
CI=1,PAGER=cat,GIT_PAGER=cat,DEBIAN_FRONTEND=noninteractive) and enforces asynchronous process timeouts to prevent hanging TUI applications (vim,less,[y/N]prompts). - Transactional Workspace Snapshots: Sub-100ms workspace checkpointing and single-command rollback using Copy-on-Write and Git plumbing (
git2-rs), enabling safe, reversible repair loops for AI agents. - Dual Interface: Functions both as a drop-in command-line proxy (
aishell exec) and as a native Model Context Protocol (MCP JSON-RPC 2.0 over Stdio) server for seamless LLM tool integration. - Cross-Platform & Multi-Architecture: Built in pure Rust. Runs natively on Windows, Linux, and macOS across x86_64 and ARM64 architectures.
aishell is organized into 5 core Rust modules:
aishell::rtk: Token killer engine for ANSI stripping, carriage return collapsing, and traceback extraction.aishell::exec: Asynchronous process manager with piped stdio isolation and timeout safety.aishell::snapshot: Fast transactional checkpointing and rollback engine.aishell::mcp: Native MCP JSON-RPC 2.0 stdio server implementation.aishell::cli: CLI argument parsing and subcommand dispatcher.
Build the optimized release binary using Rust:
cargo build --releaseThe compiled binary will be placed at target/release/aishell (or aishell.exe on Windows).
Run commands non-interactively with RTK output sanitization:
aishell exec -- "pytest"To run in raw mode without output transformation:
aishell exec --raw -- "npm test"Create a snapshot before applying code edits:
aishell checkpoint -m "Pre-repair snapshot"Revert all workspace changes to the checkpoint in under 100ms:
aishell rollbackCheck workspace status and active checkpoints:
aishell statusLaunch the stdio JSON-RPC 2.0 server for direct LLM agent integration:
aishell mcpExample JSON-RPC request over stdio:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "exec",
"arguments": {
"command": "cargo test",
"timeout_secs": 60
}
}
}| Metric | Traditional POSIX Bash | aishell | Impact |
|---|---|---|---|
| Tokens per Test Log | 15,000 – 50,000 tokens | 300 – 800 tokens | 75% to 92% Token Reduction |
| Interactive TUI Deadlocks | 15% – 25% failure rate | 0% (Non-Interactive Guard) | Zero prompt timeouts |
| Workspace Recovery Time | ~1,500ms (manual git reset/clean) | < 50ms (aishell rollback) | 30x faster state restoration |
| Interface Safety | String escaping syntax errors | Typed MCP JSON-RPC Payload | 100% schema validation |
aishell includes an extensive end-to-end (E2E) integration test suite covering 86 test cases across 4 tiers:
- Tier 1: Core Feature Verification (35 test cases)
- Tier 2: Boundary Cases, Timeouts, and Buffer Limits (33 test cases)
- Tier 3: Combined Lifecycle Workflows (12 test cases)
- Tier 4: Real-world SWE-bench Workloads & Repair Loops (6 test cases)
Run all tests:
cargo testMIT License. Free for commercial and open-source use.