jarvish 1.0.1

Next Generation AI Integrated Shell inspired by J.A.R.V.I.S. on Marvel's Iron Man
jarvish-1.0.1 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

๐ŸŸ 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

[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 and agent loop limit
[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