jarvish 1.1.2

Next Generation AI Integrated Shell inspired by J.A.R.V.I.S. on Marvel's Iron Man
jarvish-1.1.2 is not a library.
Visit the last successful build: jarvish-1.8.3

๐Ÿคต Jarvis Shell (jarvish)

status version

๐ŸŒ ๆ—ฅๆœฌ่ชž็‰ˆ README ใฏใ“ใกใ‚‰

๐Ÿ’ก 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.

jarvish

โœจ 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

cargo install jarvish

Build from Source

git clone https://github.com/tominaga-h/jarvis-shell.git
cd jarvis-shell
cargo install --path .

Setup

Set your OpenAI API key as an environment variable:

export OPENAI_API_KEY="sk-..."

Configuration

Jarvish uses a TOML configuration file located at ~/.config/jarvish/config.toml. A default config file is automatically generated on first launch.

[ai]
model = "gpt-4o" # AI model to use
max_rounds = 10 # Max agent loop rounds
markdown_rendering = true # Set to false to disable Markdown rendering
ai_pipe_max_chars = 50000 # Max characters for AI Pipe input
temperature = 0.5 # Response randomness (0.0 = deterministic, 2.0 = max random)

[alias]
g = "git" # Command aliases
ll = "ls -la"

[export]
PATH = "/usr/local/bin:$PATH" # Environment variables set on startup

[prompt]
nerd_font = 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 source builtin command:

source ~/.config/jarvish/config.toml

Run

jarvish

๐Ÿ—๏ธ 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

make install-hooks   # Install pre-push hook
make uninstall-hooks # Remove pre-push hook

Run Checks

make check  # Run format, clippy, check, and test

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