Local AI Gateway & CLI Configuration Management Center
Features • Screenshots • Tech Stack • Getting Started • Development • Architecture • Security
- 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-cliheader and default free models (GLM-5.2 / DeepSeek V4 Flash), proxied through the local gateway.
| 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) |
# Clone the repository
git clone https://github.com/xucux/i-code.git
cd i-code
# Install dependencies
pnpm install# Desktop development mode (recommended)
pnpm tauri:dev
# Frontend only
pnpm devpnpm 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 + testsi-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
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
- 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-apiheader; otherwise, a validAuthorization: Bearer {gateway_key}is required.
- 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
- i-code-script-templates — Public repository of reusable Rhai script templates for balance monitoring and more.
- Thanks to vscode-unify-chat-provider for providing valuable reference data and design inspiration for provider/model unification.
MIT © i-code



