Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 1.45 KB

File metadata and controls

63 lines (49 loc) · 1.45 KB

Arc CLI Architecture

Overview

Arc CLI is built with a modular architecture for maintainability and extensibility.

Directory Structure

arc-cli/
├── src/
│   ├── main.rs          # Entry point
│   ├── config.rs        # Configuration management
│   ├── commands.rs      # Slash command handling
│   ├── agent/
│   │   └── mod.rs       # Main agent loop
│   ├── llm/
│   │   ├── mod.rs       # LLM trait definition
│   │   └── groq.rs      # Groq API client
│   └── ui/
│       └── mod.rs       # Terminal UI
├── Cargo.toml
├── README.md
└── LICENSE

Core Components

Config (config.rs)

  • Loads/saves configuration from ~/.arc/config.toml
  • Defines available models list

LLM Client (llm/)

  • Trait-based design for multiple providers
  • Streaming response support
  • SSE parsing for real-time output

Agent Loop (agent/mod.rs)

  • Main REPL loop
  • Slash command integration
  • Message history management

UI (ui/mod.rs)

  • Terminal styling and formatting
  • Progress spinners
  • Input/output handling

Adding New Models

Edit AVAILABLE_MODELS in src/config.rs:

pub const AVAILABLE_MODELS: &[(&str, &str)] = &[
    ("model-id", "Display Name"),
    // Add more here
];

Adding New Providers

  1. Create src/llm/provider_name.rs
  2. Implement the LLMClient trait
  3. Add provider selection logic in agent/mod.rs