Skip to main content

Overview

Jarvis is a hybrid project with Rust (jarvis-rs) and Python (AI integration) components. Building from source gives you access to the latest features and allows customization.
Building from source requires macOS 13+. Windows and Linux support is experimental.

Prerequisites

System Requirements

# Check versions
sw_vers -productVersion  # macOS 13.0+
xcodebuild -version      # Xcode 14.0+
rustc --version          # 1.75.0+
python3 --version        # Python 3.10+
swift --version          # Swift 5.9+
1

Install Xcode Command Line Tools

xcode-select --install
2

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
3

Install Python 3.10+

brew install python@3.10

Automated Build

Quick Start

The setup.sh script handles the complete build process:
1

Clone the repository

git clone https://github.com/dyoburon/jarvis.git
cd jarvis
2

Run the setup script

./setup.sh
This will:
  • Create a Python virtual environment
  • Install Python dependencies
  • Build the Rust workspace
  • Build the Swift Metal app (macOS only)
  • Create default config directory
3

Configure environment

Copy .env.example to .env and add your API keys:
cp .env.example .env
nano .env  # or your preferred editor
.env
CLAUDE_CODE_OAUTH_TOKEN=your-oauth-token
GOOGLE_API_KEY=your-gemini-api-key
4

Run Jarvis

./start.sh

Setup Script Deep Dive

The setup.sh script performs these steps:
#!/bin/bash
set -e  # Exit on error

# 1. Create Python virtual environment
if [ ! -d ".venv" ]; then
    echo "Creating virtual environment..."
    python3 -m venv .venv
fi

# 2. Activate venv and install dependencies
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

# 3. Build Rust workspace (jarvis-rs)
echo "Building Rust workspace..."
cd jarvis-rs
cargo build --release
cd ..

# 4. Build Swift Metal app (macOS only)
if [ "$(uname)" == "Darwin" ]; then
    echo "Building Metal app..."
    cd metal-app
    swift build -c release
    cd ..
fi

# 5. Create config directory with defaults
mkdir -p ~/.config/jarvis
if [ ! -f ~/.config/jarvis/config.toml ]; then
    cp docs/examples/config.toml ~/.config/jarvis/config.toml
fi

echo "Setup complete! Run './start.sh' to launch Jarvis."

Manual Build

Build Rust Components

1

Navigate to Rust workspace

cd jarvis-rs
2

Build all crates

cargo build --release
This compiles all 10 workspace crates:
  • jarvis-app (main binary)
  • jarvis-tiling
  • jarvis-renderer
  • jarvis-ai
  • jarvis-social
  • jarvis-config
  • jarvis-webview
  • jarvis-common
  • jarvis-platform
  • jarvis-relay
3

Run the binary

./target/release/jarvis
CLI options:
jarvis --help
jarvis -e "echo hello"        # Execute command
jarvis -d ~/code               # Start in directory
jarvis --config custom.toml    # Use custom config
jarvis --log-level debug       # Set log level

Build Python Components

1

Create virtual environment

python3 -m venv .venv
source .venv/bin/activate
2

Install dependencies

pip install -r requirements.txt
Key dependencies:
  • anthropic - Claude API client
  • google-generativeai - Gemini API client
  • whisper - Speech-to-text
  • aiohttp - Async HTTP
  • python-dotenv - Environment variables
  • rich - Terminal formatting
3

Run main.py (optional)

The Python stack is optional for Rust-only builds:
python main.py

Build Swift Metal App (macOS)

1

Navigate to Metal app

cd metal-app
2

Build with Swift

swift build -c release
Output: .build/release/JarvisBootup
3

Run standalone

.build/release/JarvisBootup

Development Build

For faster iteration during development:
# Debug build (faster compile, slower runtime)
cd jarvis-rs
cargo build

# Run with debug symbols and logging
cargo run -- --log-level debug

# Watch for changes and rebuild
cargo install cargo-watch
cargo watch -x run
Debug builds include symbols for debugging but are 5-10x slower than release builds.

Cargo Workspace Structure

The jarvis-rs/Cargo.toml defines a workspace with shared dependencies:
[workspace]
resolver = "2"
members = [
    "crates/jarvis-app",
    "crates/jarvis-common",
    "crates/jarvis-config",
    "crates/jarvis-platform",
    "crates/jarvis-tiling",
    "crates/jarvis-renderer",
    "crates/jarvis-ai",
    "crates/jarvis-social",
    "crates/jarvis-webview",
    "crates/jarvis-relay",
]

[workspace.dependencies]
serde = { version = "1", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
wry = "0.47"
# ...50+ more dependencies

[profile.release]
lto = "thin"
codegen-units = 1
strip = "symbols"
panic = "abort"

Optimized Release Build

For maximum performance:
cd jarvis-rs

# Build with full optimizations
RUSTFLAGS="-C target-cpu=native" cargo build --release

# Build with Link-Time Optimization (slower build, faster binary)
cargo build --release --config profile.release.lto=true
target-cpu=native enables CPU-specific optimizations but reduces portability.

Troubleshooting

Rust Compilation Errors

macOS: Install Xcode Command Line Tools:
xcode-select --install
Linux: Install build tools:
sudo apt install build-essential  # Debian/Ubuntu
sudo pacman -S base-devel         # Arch
Install OpenSSL development headers:macOS:
brew install openssl
export OPENSSL_DIR=$(brew --prefix openssl)
Linux:
sudo apt install libssl-dev pkg-config
Install WebView dependencies:Linux:
sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev

Python Build Issues

Ensure you’re in the virtual environment:
source .venv/bin/activate
pip install -r requirements.txt
Update SSL certificates:macOS:
/Applications/Python\ 3.10/Install\ Certificates.command

Swift Build Errors (macOS)

Install Xcode:
xcode-select --install
sudo xcode-select --switch /Applications/Xcode.app
Update Xcode to 14.0+ (requires macOS 12.5+):
softwareupdate --list
softwareupdate --install "Xcode-14.3"

Cross-Compilation

Build for Multiple Targets

# Install target toolchains
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin

# Build for Intel Macs
cargo build --release --target x86_64-apple-darwin

# Build for Apple Silicon
cargo build --release --target aarch64-apple-darwin

# Create universal binary (macOS)
lipo -create \
  target/x86_64-apple-darwin/release/jarvis \
  target/aarch64-apple-darwin/release/jarvis \
  -output jarvis-universal

Packaging

Create a distributable package:
# Run the package script
./package.sh

# Creates:
# jarvis-macos-aarch64.tar.gz (Apple Silicon)
# jarvis-macos-x86_64.tar.gz (Intel)
The package includes:
  • Compiled binary (jarvis)
  • Default config (config.toml)
  • Python dependencies (frozen)
  • HTML/JS/CSS assets
  • README and LICENSE

Source References

  • setup.sh - Automated setup script
  • start.sh - Launch script with venv activation
  • package.sh - Distribution packaging
  • jarvis-rs/Cargo.toml - Workspace configuration
  • requirements.txt - Python dependencies
  • metal-app/Package.swift - Swift package manifest
  • README.md - Project overview