jarvish-1.1.2 is not a library.
Visit the last successful build:
jarvish-1.8.3
๐คต Jarvis Shell (jarvish)
๐ก 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 natively embeds AI intelligence into your everyday shell experience โ no more copy-pasting errors into a browser. Just ask Jarvis.
โจ Features
AI-Powered Assistance
- Talk to Jarvis in natural language โ right from your shell prompt
- When a command fails, Jarvis automatically investigates the error using stdout/stderr context
- Jarvis can read and write files, execute commands as an AI agent with tool-calling capabilities
- AI Pipe (
| ai "..."): Filter, transform, or extract data from command outputs using natural language (e.g.,cat access.log | ai "extract only 500 errors")
Fish-like UX
- Real-time syntax highlighting as you type
- Auto-completion for commands (PATH binaries, builtins) and file paths
- History-based suggestions powered by
reedline
The Black Box
- Every command execution is persisted โ command, timestamp, working directory, exit code
- stdout/stderr outputs are stored in a Git-like content-addressable blob storage (SHA-256 + zstd compression)
- Ask Jarvis about "last week's error" โ even after restarting the shell
Shell Fundamentals
- Pipelines (
cmd1 | cmd2 | cmd3) - Redirects (
>,>>,<) - Tilde & variable expansion (
~,$HOME,${VAR}) - Full PTY support for interactive programs (vim, top, etc.)
๐ฆ Install
Prerequisites
| Requirement | Details |
|---|---|
| Rust | Stable toolchain (Edition 2021) |
| OpenAI API Key | Required for AI features |
| OS | macOS / Linux |
| NerdFont | Recommended for prompt icons (can be disabled via config) |
Install via Cargo
Build from Source
Setup
Set your OpenAI API key as an environment variable:
Configuration
Jarvish uses a TOML configuration file located at ~/.config/jarvish/config.toml.
A default config file is automatically generated on first launch.
[]
= "gpt-4o" # AI model to use
= 10 # Max agent loop rounds
= true # Set to false to disable Markdown rendering
= 50000 # Max characters for AI Pipe input
= 0.5 # Response randomness (0.0 = deterministic, 2.0 = max random)
[]
= "git" # Command aliases
= "ls -la"
[]
= "/usr/local/bin:$PATH" # Environment variables set on startup
[]
= true # Set to false if NerdFont is not installed
| Section | Description |
|---|---|
[ai] |
AI model name, agent loop limit, Markdown rendering toggle, AI Pipe input limit, and temperature |
[alias] |
Command aliases (also manageable via alias / unalias builtins) |
[export] |
Environment variables applied on startup (supports $VAR expansion) |
[prompt] |
Prompt display settings (nerd_font = false disables NerdFont icons) |
Tip: You can reload the config at runtime with the
sourcebuiltin command:
Run
๐๏ธ Architecture
Jarvish is composed of four core components:
graph TB
User(["User"]) --> A["Line Editor (reedline)"]
A --> B["Execution Engine"]
B --> B1["Builtin Commands (cd, cwd, exit)"]
B --> B2["External Commands (PTY + I/O Capture)"]
B --> D["AI Brain (OpenAI API)"]
B2 --> C["Black Box"]
D --> C
C --> C1[("history.db (SQLite)")]
C --> C2[("blobs/ (SHA-256 + zstd)")]
| Component | Description |
|---|---|
| Line Editor | REPL interface powered by reedline with syntax highlighting, completion, and history |
| Execution Engine | Routes input to builtins or external commands; captures I/O via PTY teeing |
| Black Box | Persists all execution history and outputs (SQLite index + content-addressable blob store) |
| AI Brain | Classifies input as command vs. natural language; provides context-aware AI assistance via OpenAI |
๐ ๏ธ Tech Stack
| Category | Crate | Purpose |
|---|---|---|
| Line Editor | reedline |
Fish-like interactive line editing |
| Process | os_pipe, nix |
I/O capture, PTY management |
| Async | tokio |
Async runtime |
| Database | rusqlite |
SQLite for command history |
| Hashing | sha2 |
SHA-256 content hashing |
| Compression | zstd |
Blob compression |
| AI | async-openai |
OpenAI API client |
| Paths | directories |
XDG-compliant path resolution |
| Terminal | nu-ansi-term |
ANSI color styling |
| Logging | tracing |
Structured logging with daily rotation |
๐ฉโ๐ป Development
Git Hooks
Run Checks
CI Pipeline (GitHub Actions)
The CI runs on every push and PR to main:
| Job | Command |
|---|---|
| Check | cargo check --all-targets |
| Test | cargo test --all-targets |
| Format | cargo fmt --all -- --check |
| Clippy | cargo clippy --all-targets -- -D warnings |
