Skip to content

Latest commit

 

History

139 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

ARCC

ARCC (A Rust Copilot CLI) — Rust-based local-first AI Agent with CLI/TUI/Server modes, supports MCP & ACP protocols, connected to DeepSeek/Claude/OpenAI, built-in safety engine and SQLite persistence.

Rust DeepSeek MCP ACP CI CD

arcc tui demo


Features

  • 🤖 Dual-Model Scheduling — Complex tasks → DeepSeek-V4-Pro (reasoning); routine chat → DeepSeek-V4-Flash (speed). Auto-rotate when context exceeds 800k tokens.
  • 🔌 MCP & ACP Protocols — Native Model Context Protocol client for plugin tool registration. ACP (Agent Client Protocol v1) stdio server via arcc --acp — ACP-compatible GUIs like AionUI get streaming chat, tool execution, and per-command permission prompts out of the box.
  • 🛡️ Safety Engine — 3-layer defense: command allowlist → risk rating → TUI interactive confirm (y/a/n) for dangerous operations.
  • 💾 SQLite Persistence — Sessions, messages, token usage persisted locally via rusqlite (bundled, zero system deps).
  • 📋 Audit Logging — All command executions, MCP calls, and human approvals recorded to JSON Lines for traceability.
  • 🧠 Context Compression — Automatic summarization at token threshold (default ~800k), preserving decisions and pending items.
  • ⚡ 4 Running ModesTUI (ratatui, ~60fps, multi-turn), CLI (one-shot/pipe, portable-pty), Server (axum, Feishu SSE webhook), ACP (Agent Client Protocol stdio server for GUI agents).
  • 🔒 Local-First — All data stays on your machine. No cloud sync, no telemetry, no external dependencies beyond the model API.

Protocol Support

Protocol Support Purpose
MCP (Model Context Protocol) ✅ Client Register external tools as MCP plugins
ACP (Agent Client Protocol v1) ✅ Server arcc --acp stdio agent — streaming chat, tool calls & permission prompts in AionUI and other ACP clients
SSE (Server-Sent Events) IM bot push (Feishu webhook)

Running Modes

Mode Command Multi-Turn Memory Tool Call Session Persist Script/Pipe IM Bot
TUI arcc tui
CLI arcc cli "<prompt>"
Server arcc server --daemon
ACP arcc --acp

Quick Start

You need one DeepSeek API Key

# install
curl -fsSL https://raw.githubusercontent.com/niyongsheng/arcc/main/scripts/install.sh | bash

# API Key
echo '[model]
api_key = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' > ~/.arcc/config.toml

See config/config.toml for all available options.

Development

cargo build                    # Debug build
cargo run -- tui               # Start TUI interactive mode
cargo run -- cli "<prompt>"    # CLI mode (single-turn, pipe-friendly)
cargo run -- server --daemon   # Start server daemon

cargo build --release          # Release build

Architecture

flowchart TB
    Entry(["arcc"]) --> TUI["arcc tui<br/>ratatui + crossterm"]
    Entry --> CLI["arcc cli<br/>one-shot / pipe"]
    Entry --> Server["arcc server<br/>axum + Feishu SSE"]
    Entry --> ACP["arcc --acp<br/>ACP v1 stdio (AionUI)"]

    TUI --> Core["arcc-core"]
    CLI --> Core
    Server --> Core
    ACP --> Core

    subgraph Core["arcc-core"]
        Model["ModelProvider<br/>DeepSeek-V4 Pro / Flash"]
        Safety["Safety Engine<br/>Allowlist + Risk Rating"]
        Session["Session Manager<br/>Context Compression"]
        Tools["Tool Executor<br/>MCP / Skill"]
    end

    Model --> DeepSeekPro["DeepSeek-V4-Pro<br/>Complex Reasoning"]
    Model --> DeepSeekFlash["DeepSeek-V4-Flash<br/>High-Freq Dialogue"]

    Core --> Storage["arcc-storage"]
    
    subgraph Storage["arcc-storage"]
        SQLite["SQLite<br/>Sessions / Messages"]
        Config["TOML<br/>Configuration"]
        Audit["JSON Lines<br/>Audit Log"]
    end

    Tools --> MCP["MCP Plugins<br/>Model Context Protocol"]
Loading

License

MIT

About

Deepseek-v4 Rust Agent🤖(TUI / CLI / Server)

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages