Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

112 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

i-code

i-code logo

Local AI Gateway & CLI Configuration Management Center

Release Tauri 2.x React 19 Rust 2021 pnpm 11 Script Templates Repository 中文 README

FeaturesScreenshotsTech StackGetting StartedDevelopmentArchitectureSecurity


User Guide中文 README

Features

  • AI Gateway Management: Centrally manage multiple LLM providers (OpenAI, Anthropic, Gemini, OpenRouter, etc.) with multi-protocol and authentication support.
  • Local API Gateway: Expose a unified local API at 127.0.0.1:54321, routing models via {provider_slug}/{model_id} format.
  • CLI Configuration Profiles: Maintain profiles for Claude Code, Codex, Gemini CLI, and more. Route them directly to vendors or through the local gateway.
  • Chat Interface: Built-in chat UI for sending messages, streaming responses, and viewing error bubbles with JSONL message storage.
  • Secret Encryption: API keys are encrypted via AES-GCM and never persisted in plain text. Config files only store $SECRET:{uuid}$ references.
  • Balance & Usage Monitoring: Track provider balances and model call records.
  • Backup & Restore: Local and WebDAV backup support with SQLite Online Backup API.
  • In-App Diagnostics: Dual logging system for development traces and operational event logs.
  • Script Templates & Marketplace: Create and manage Rhai balance-monitoring script templates with a draft/active/disabled lifecycle, a CodeMirror editor with built-in snippets and system-variable docs, sandboxed trial runs, and an in-app marketplace to browse the public template repository and apply templates with one click.
  • Cline Free Model Proxy: Built-in Cline Free provider preset with an automatic x-client-type: cline-cli header and default free models (GLM-5.2 / DeepSeek V4 Flash), proxied through the local gateway.

Screenshots

Dashboard

Dashboard screenshot placeholder

AI Gateway Providers

AI Gateway providers screenshot placeholder

CLI Profiles

CLI profiles screenshot placeholder

Chat Interface

Chat interface screenshot placeholder

Tech Stack

Layer Technology
Desktop Framework Tauri 2.x (Rust + WebView)
Frontend React 19 + TypeScript 5
Routing TanStack Router
UI shadcn/ui + Tailwind CSS + Font Awesome
State Zustand (frontend) + Tauri State (backend)
Forms react-hook-form + zod
i18n i18next (zh-CN / en)
Backend HTTP Gateway axum
Database SQLite (rusqlite + r2d2)
Encryption AES-GCM
Type Sync ts-rs (Rust → TypeScript)

Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/xucux/i-code.git
cd i-code

# Install dependencies
pnpm install

Run the App

# Desktop development mode (recommended)
pnpm tauri:dev

# Frontend only
pnpm dev

Development

Useful Commands

pnpm dev              # Frontend Vite dev server
pnpm tauri:dev        # Desktop development
pnpm tauri:build      # Build desktop release
pnpm type-check       # TypeScript check
pnpm lint             # ESLint
pnpm test             # Vitest
pnpm test:rust        # Rust unit tests
pnpm check            # TypeScript + Rust check
pnpm check:all        # Full check + lint + tests

Project Structure

i-code/
├── docs/                 # Design docs and proposals
├── scripts/              # Utility scripts
├── src/                  # Frontend React app
│   ├── components/       # UI components
│   ├── core/             # Types, errors, events, utils
│   ├── hooks/            # Shared hooks
│   ├── modules/          # Domain modules
│   └── routes/           # TanStack file routes
├── src-tauri/            # Rust backend
│   ├── data/             # Built-in provider/model JSON
│   ├── src/              # Rust source
│   └── tauri.conf.json
└── README.md

Architecture

CLI / External Clients
    ↓
Local Gateway (axum) @ 127.0.0.1:54321
    ↓
Parse model = {provider_slug}/{model_id}
    ↓
Virtual Provider fallback routing (if applicable)
    ↓
Resolve $SECRET:{uuid}$ references
    ↓
Forward to real upstream LLM vendor
    ↓
Interceptors log to logger + call-records

Security

  • API keys and tokens are never stored or logged in plain text.
  • Configuration files and the database only contain encrypted references: $SECRET:{uuid}$.
  • Secret encryption and decryption happen only in the Rust backend.
  • The frontend receives plaintext input once and does not cache secrets.
  • Internal CLI requests must include the inner-cli-api header; otherwise, a valid Authorization: Bearer {gateway_key} is required.

Roadmap

  • Provider / model CRUD and settings
  • Secret local encryption
  • Gateway runtime (health / models / chat / messages)
  • Virtual provider routing
  • Backup and restore
  • Complete CLI management workflow
  • In-app chat module
  • System keychain secret storage

Acknowledgments

License

MIT © i-code


Built with ❤️ using Tauri, React, and Rust.

About

Local AI Gateway and CLI Configuration Management Center

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages