Skip to main content

Overview

The jarvis-app crate is the main application orchestrator for Jarvis. It initializes the window, manages application state, handles events, and coordinates between all subsystems (renderer, tiling, AI, webview, etc.).

CLI Interface

Jarvis accepts command-line arguments for customization and debugging.

Command-Line Arguments

-e, --execute
string
Execute a command instead of the default shell.Example:
jarvis --execute "htop"
-d, --directory
string
Working directory to start in.Example:
jarvis --directory ~/projects/my-app
--config
string
Config file path override. By default, Jarvis loads from the OS config directory.Example:
jarvis --config ~/.jarvis-custom.toml
--log-level
string
Log level override. Valid values: debug, info, warn, error.Example:
jarvis --log-level debug

Usage

use jarvis_app::cli;

fn main() {
    let args = cli::parse();
    
    if let Some(cmd) = args.execute {
        println!("Executing: {}", cmd);
    }
    
    if let Some(dir) = args.directory {
        println!("Starting in: {}", dir);
    }
}

Architecture

The application uses a modular architecture:
  • App State: Central state machine tracking assistant mode, panels, menus
  • Event Handler: Processes window events, keyboard input, IPC messages
  • Dispatch: Routes commands to appropriate subsystems
  • Assistant Task: Manages AI conversation loop and tool execution