๐คต Jarvish โ The AI-Native Shell
๐ก About
"I want J.A.R.V.I.S. as my companion โ but inside my terminal."
Jarvish is a Next Generation AI Integrated Shell written in Rust, inspired by J.A.R.V.I.S. from Marvel's Iron Man.
It is not just a wrapper around existing shells (Bash, Zsh) or an external tool. Jarvish deeply integrates AI into your terminal workflow itself, delivering an unprecedented experience where you can seamlessly switch between regular commands and natural language as naturally as breathing.
The days of copy-pasting errors into a browser to ask AI are over. Just ask Jarvish.
๐ Table of Contents
โจ Core Experience
1. Your Personal Assistant, Living in the Terminal
- Natural Language Execution: Just type "show me the list of active ports" at the prompt, and Jarvish translates it into the optimal command and executes it.
- Smart Error Handling: When a command fails, Jarvish reads the
stdout/stderrcontext and automatically analyzes the cause and suggests solutions. - Autonomous Agent: More than just a chatbot โ Jarvish can read/write files and re-execute commands on its own (Tool Calls).
2. AI Pipe & AI Redirect (The Ultimate Text Processor)
No more struggling to remember complex awk, sed, or jq syntax.
- AI Pipe (
| ai "..."): Filter and transform command output directly using natural language.| | - AI Redirect (
> ai "..."): Send command output to Jarvish's context for interactive analysis.
3. "The Black Box" (Total Recall Storage)
Jarvish remembers everything that happens in your terminal.
- Git-like History Storage: Every command, timestamp, directory, exit code, and full
stdout/stderroutput is persisted in a content-addressable blob storage (SHA-256 + zstd compression). - Time-Traveling Context: Even after restarting the shell, you can ask Jarvish "what caused that error yesterday?"
- Security: Sensitive information such as API keys or tokens (e.g., those in
.bashrc) is automatically masked before being saved.
4. Uncompromising "Blazing Fast" Shell UX
Despite deep AI integration, Jarvish leverages Rust's strengths to deliver outstanding performance as an infrastructure tool.
- Async Background Prompt: Git status scanning runs in a separate thread (using the Stale-While-Revalidate pattern), achieving zero UI jitter regardless of repository size.
- Fish-like Autocomplete: Real-time syntax highlighting with powerful auto-completion for PATH binaries and file paths.
- Full PTY Support: Interactive programs like
vimandtopwork natively. - Starship Integration: Native support for Starship prompt โ use your existing Starship configuration as-is.
๐ Install
Prerequisites
- OpenAI API Key
- NerdFont (recommended for prompt icons)
Install via Homebrew (macOS)
Install via Cargo
Build from Source
โ๏ธ Setup and Configuration
Set your OpenAI API key as an environment variable:
You can also configure this in the
[export]section of~/.config/jarvish/config.tomlfor automatic setup.
Configuration File (config.toml)
A default config file is automatically generated at ~/.config/jarvish/config.toml on first launch.
[]
= "gpt-4o" # AI model to use
= 10 # Max agent loop rounds
= true # Render AI responses as Markdown
= 50000 # Max characters for AI Pipe input (fail-fast on overflow)
= 50000 # Max characters for AI Redirect input (fail-fast on overflow)
= 0.5 # Response randomness
= ["git log", "git diff"] # Skip auto-investigation for these commands
[]
= "git" # Command aliases (also manageable via builtins)
= "eza --icons -la"
[]
= "/usr/local/bin:$PATH" # Environment variables expanded on startup
# โ ๏ธ Caution: Setting SHELL = "/usr/local/bin/jarvish" causes external tools
# (Cursor, VS Code, etc.) to use jarvish as their subshell, which may trigger
# mass AI auto-investigations on tool hook failures.
# Keep SHELL set to bash/zsh if you only use jarvish as an interactive shell.
[]
= true # Set to false if NerdFont is not installed
= false # Set to true to use Starship prompt (requires: starship command + ~/.config/starship.toml)
[]
= ["checkout", "switch", "merge", "rebase", "branch", "diff", "log", "cherry-pick", "reset", "push", "fetch"]
Tip: After changing settings, you can apply them without restarting using the
sourcecommand:
Starship Prompt Integration
Jarvish natively supports Starship as an alternative prompt. When enabled, Jarvish calls starship prompt directly โ no init scripts needed.
Prerequisites:
- The
starshipcommand is installed and available in your PATH - A Starship config file exists at
~/.config/starship.toml(or the path specified by theSTARSHIP_CONFIGenvironment variable)
Setup:
# ~/.config/jarvish/config.toml
[]
= true
Jarvish passes --status, --cmd-duration, and --terminal-width to starship prompt, so modules like character, cmd_duration, and status work as expected.
If starship = true is set but the prerequisites are not met, Jarvish falls back to the built-in prompt with a warning.
๐๏ธ Architecture
Jarvish is composed of four highly modular core components:
graph TB
User(["User"]) --> A["Line Editor (reedline)"]
A --> B["Execution Engine"]
B --> B1["Builtin Commands (cd, exit, alias...)"]
B --> B2["External Commands (PTY + I/O Capture)"]
B --> D["AI Brain (OpenAI API / Tools)"]
B2 --> C["Black Box"]
D --> C
C --> C1[("history.db (SQLite)")]
C --> C2[("blobs/ (SHA-256 + zstd)")]
| Component | Description |
|---|---|
| Line Editor | reedline-based REPL with async Git prompt, syntax highlighting, and history suggestions. |
| Execution Engine | Parses and dispatches commands with reliable I/O capture via PTY sessions. |
| Black Box | Storage engine for all terminal memory. Hybrid architecture of SQLite and compressed blob storage. |
| AI Brain | Classifies intent (natural language vs. command) and drives a context-aware autonomous agent loop. |
๐ฉโ๐ป Development
Git Hooks
For safe development, we provide pre-push hooks.
Code Verification (Local CI)
CI Pipeline (GitHub Actions)
The following CI runs on every push and PR to main:
cargo check --all-targetscargo test --all-targetscargo fmt --all -- --checkcargo clippy --all-targets -- -D warnings
