Content
# HyperChat
> 🌟 **Local AI Agent Platform** - Pioneering the concept of AI as Code, giving each project its own dedicated AI brain
HyperChat is a revolutionary **local AI Agent platform** that allows AI capabilities to be fully localized, transferable, and version-controlled through **configuration file-driven** approach. Say goodbye to cloud dependencies and have your own project-level AI expert.
### 🎯 Key Features
- 🏠 **Fully Localized**: Data stays local, privacy and security are under control
- 🧠 **Agent Memory**: AI Agents understand and remember your project context
- 📁 **Configuration as Code**: All AI capabilities are configured through files, supporting Git management
- 🔧 **Deep Tool Integration**: MCP protocol support, can directly operate the local file system
- 📦 **One-Click Migration**: Complete `.hyperchat/` configuration directory, migrate with the project
- 📂 **Multiple @File Paths**: Intelligently identify multiple file references, supporting complex file operations ✨**New Feature**
- 🎯 **Agent Custom Commands**: Markdown template-driven shortcut command system ✨**New Feature**
[](https://github.com/BigSweetPotatoStudio/HyperChat/actions/workflows/build.yml)
[](https://www.npmjs.com/package/@dadigua/hyperchat)
[](https://npm-stat.com/charts.html?package=@dadigua/hyperchat)
## 🎯 Project Vision
**[HyperChat 1.0](./archive/README.1.md)** is a fully hand-written project and is being migrated to 2.0.
**HyperChat 2.0** Let's **Vibe Coding** together, welcome to use Claude Code and GitHub Copilot and other AI tools to develop together.
## 🎯 Two-Tier Architecture Design
> **Innovative Dual-Mode Architecture** - Optimizing the user experience based on different usage scenarios
### 🌐 Web Frontend: Multi-Workspace Collaboration Center
**Design Concept**: Project-level collaboration, unified resource management
- **🗂️ Multi-Workspace Tab Management**: Open multiple project workspaces at the same time, switch with one click
- **👥 Team Collaboration Optimization**: Workspace-level Agent collection, MCP service pool
- **📊 Visual Management Interface**: Graphical configuration, real-time monitoring, data statistics
- **💼 Applicable Scenarios**: Project development, team collaboration, workspace management, visual operation
### 💻 CLI Frontend: Agent-First Rapid Interaction
**Design Concept**: Agent-centric, quickly launch a single intelligent agent
- **⚡ Quick Start**: Directly select an Agent, load MCP tools from the workspace as needed
- **🎯 Focus on Dialogue**: Agent-exclusive memory, context, chat history
- **🔧 Flexible Toolchain**: Agent built-in MCP tools, fall back to workspace shared resources
- **🚀 Applicable Scenarios**: Quick dialogue, automated scripts, command-line workflows, CI/CD integration
### 📋 Architecture Comparison
| Feature | 🌐 Web Multi-Workspace Mode | 💻 CLI Agent-First Mode |
|---------|---------------------|----------------------|
| **Core Concept** |
| Design Center | 🗂️ Workspace Collaboration Center | 🤖 Agent Direct Interaction |
| Resource Management | Workspace Unified MCP Pool | Agent On-Demand MCP Startup |
| Usage | Multi-Tab Concurrent Management | Single Agent Quick Start |
| **Interface Experience** |
| Interface Style | 🖥️ Modern Web Interface | 📟 Command Line + 🎨 TUI |
| Interaction Mode | Mouse Click + Form Operation | Keyboard Input + Command Parameters |
| Real-Time Update | ✅ SSE Streaming Push | ✅ Terminal Streaming Output |
| **Applicable Scenarios** |
| Main Use | Project Development, Team Collaboration | Quick Dialogue, Script Integration |
| Usage Environment | Desktop Browser, Development IDE | Terminal, Server, CI/CD |
| Workflow | Long-Term Project Management | Temporary Dialogue Processing |
## 🚀 Quick Experience
### ⌨️ Command Line Quick Start
```bash
# Global installation
npm install -g @dadigua/hyperchat
# Or run directly
npx -y @dadigua/hyperchat
```
**Quickly configure environment variables**:
```bash
# Basic configuration - Set the default AI model
export HyperChat_API_KEY=your-api-key # API key
export HyperChat_API_URL=your-api-url # API endpoint URL
export HyperChat_AI_Provider=openai # AI provider (openai/claude/gemini/kimi/qwen, etc.)
export HyperChat_AI_Model=gpt-4o # Default model name
# Then use directly
hyperchat "Hello, world!" # Use the configured default model
```
### 🌐 Web Multi-Workspace Mode Usage Example
```bash
# Start the multi-workspace Web interface
hyperchat serve # Access: http://localhost:16100
# Web interface features:
# ✅ Multi-workspace tab management
# ✅ Each tab has an independent Agent collection, MCP service, chat history
# ✅ Visual configuration and real-time monitoring
# ✅ Team collaboration and project management
```
### 💻 CLI Agent-First Mode Usage Example
```bash
# 🚀 Agent-first quick start - Core features
hyperchat agent list # Discover available Agents (global + workspace)
hyperchat agent mybot "Hello" # 🎯 Directly start the Agent, load MCP on demand
hyperchat agent mybot chat # 🎯 Agent exclusive dialogue session
# Quick AI chat (using the default Agent)
hyperchat "Hello, how are you today?" # Chat directly with the default model
hyperchat chat "Write a Python script" # Chat command
hyperchat chat # Interactive chat mode
# 📁 Intelligent file processing - Multiple @ symbol support ✨New Feature
hyperchat "Analyze the code quality of @./src/index.ts"
hyperchat "Compare @./package.json and @./yarn.lock"
hyperchat "Please compare the structure of @./src/components/ and @./docs/"
# 🎯 Agent custom commands - Quickly enter professional prompts ✨New Feature
hyperchat agent coder "/bug-fix @./src/login.ts Login function is abnormal"
hyperchat agent coder "/review @./src/api/user.js"
hyperchat agent coder "/optimize This code has poor performance"
# Agent Management (in the current workspace or globally)
hyperchat agent create mybot # Create a new Agent
hyperchat agent delete mybot # Delete Agent
# Workspace Management
hyperchat workspace create # Create a workspace in the current directory
# Global options and workspace specification
hyperchat chat --workspace /path/to/project # Use a specific workspace
hyperchat --verbose chat "Hello" # Detailed log
hyperchat --help # Show help
# CLI mode advantages:
# ⚡ Agent starts directly, no need to switch interfaces
# 🔧 Load MCP tools from the workspace on demand
# 💾 Agent exclusive memory and chat history
# 🚀 Suitable for script integration and automation
```
### 🔄 Dual-Mode Collaborative Work
```bash
# Scenario 1: Web during development
hyperchat serve # Start the Web interface to manage the project
# Scenario 2: CI/CD automation uses CLI
hyperchat agent test-runner "Run all tests and generate a report"
# Scenario 3: Team collaboration uses Web
# Manage multiple project workspaces in the Web interface, configure shared Agents and MCP services
```
### 🔧 Environment Variable Configuration
HyperChat 2.0 implements a powerful **5-layer priority environment variable system** to make configuration management more flexible:
**Priority Order** (from low to high):
1. **Default Value** - Built-in default configuration in the code
2. **process.env** - System environment variables
3. **Global .env** - `~/Documents/HyperChat/.env`
4. **Workspace .env** - `.env` file in the project directory
5. **CLI Parameters** - Parameters passed in from the command line (highest priority)
**Supported Core Environment Variables**:
```bash
# Quick configuration - Default AI model
HyperChat_API_KEY=your-api-key # Default API key
HyperChat_API_URL=your-api-url # Default API endpoint
HyperChat_AI_Provider=openai # Default AI provider
HyperChat_AI_Model=gpt-4o # Default model name
# Service configuration
HYPERCHAT_WEB_PASSWORD=your-web-password # Web interface access password
HYPERCHAT_PORT=16100 # Web service port
HYPERCHAT_HOST=localhost # Service binding address
# Interface configuration
HYPERCHAT_LANGUAGE=zh # Interface language (zh/en)
HYPERCHAT_LOG_LEVEL=info # Log level
# Custom API endpoint
HYPERCHAT_OPENAI_BASE_URL=https://api.openai.com/v1
HYPERCHAT_CLAUDE_BASE_URL=https://api.anthropic.com
```
**Usage Example**:
```bash
# Method 1: Quickly configure the default model
export HyperChat_API_KEY=sk-1234567890
export HyperChat_AI_Provider=openai
export HyperChat_AI_Model=gpt-4o
hyperchat "Hello" # Use the default configuration directly
# Method 2: Web service configuration
export HYPERCHAT_WEB_PASSWORD=mypassword
hyperchat serve
# Method 3: Project .env file
echo "HyperChat_API_KEY=your-key" > .env
echo "HyperChat_AI_Provider=claude" >> .env
hyperchat chat
# Method 4: CLI parameters (highest priority)
hyperchat serve --password=clipass
# Method 5: Global configuration file
echo "HyperChat_API_KEY=global-key" > ~/Documents/HyperChat/.env
echo "HyperChat_AI_Provider=gemini" >> ~/Documents/HyperChat/.env
```
## 🛠️ Technical Architecture
### 🎯 Two-Tier Architecture Technical Implementation
HyperChat 2.0 adopts a **two-tier architecture design** to provide the most optimized experience based on different usage scenarios:
#### 🌐 Web Layer: Workspace-Centric Architecture
```typescript
// Web Frontend: Workspace Unified MCP Management
const workspace = workspaceManager.get(workspacePath);
const mcpManager = workspace.getMcpManager();
const client = mcpManager.getClient(clientName);
```
**Technical Features**:
- 🗂️ **Multi-Workspace Concurrent Management**: `WorkspaceManager-enhanced` supports multiple workspace instance caching
- 🔌 **Workspace-Level MCP Service Pool**: Unified MCP client management
- 📊 **Real-Time Data Synchronization**: SSE streaming push, multi-tab independent state management
- 🔄 **Configuration Merging Mechanism**: Intelligent merging of global configuration + workspace configuration
#### 💻 CLI Layer: Agent-First Architecture
```typescript
// CLI Frontend: Agent Exclusive MCP Access
const agentInstance = workspace.getAgentInstance(agentName);
const client = agentInstance.getMCPClient(clientName);
// Fall back to workspace shared MCP (if needed)
```
**Technical Features**:
- ⚡ **Agent Direct Startup**: Omit workspace initialization, directly access Agent instance
- 🔧 **Toolchain On-Demand Loading**: Progressive loading from Agent built-in tools to workspace shared resources
- 💾 **Exclusive Context**: Agent independent memory, chat history, configuration management
- 🚀 **Ultra-Fast Response**: No UI rendering overhead, suitable for scripts and automation
```
HyperChat Dual-Layer Architecture/
├── packages/
│ ├── shared/ # Shared code and type definitions
│ ├── core/ # Node.js core service + CLI Agent-first layer
│ │ ├── src/cli/ # 💻 CLI Agent direct interaction layer
│ │ ├── src/workspace/ # Dual-layer workspace management system
│ │ │ ├── workspaceManager-enhanced.mts # 🌐 Multi-workspace concurrent management
│ │ ├── src/mcp/ # MCP protocol implementation
│ │ └── src/commands/ # Web API command system
│ ├── web/ # 🌐 React Web multi-workspace layer
│ │ ├── src/pages/workspace/ # Multi-workspace management components
│ │ │ ├── WorkspaceManage.tsx # Multi-tab manager
│ │ │ └── workspace.tsx # Single workspace instance component
│ │ └── src/hooks/useChatStream.ts # workspacePath parameterization
│ └── electron/ # Electron application packaging
└── docs/ # Dual-layer architecture documentation
```
### 💼 Dual-Layer Architecture Configuration Management
```
🌐 Web Multi-Workspace Mode Configuration:
Project Directory/
├── .hyperchat/ # Workspace unified configuration directory
│ ├── mcp.json # 🔌 Workspace-level MCP service pool
│ ├── ai_models.json # 🤖 Workspace AI model configuration
│ ├── .env # Workspace environment variables
│ └── agents/ # 🗂️ Workspace Agent collection
│ ├── project-assistant/ # Project-specific Agent
│ │ ├── agent.yaml # Agent configuration
│ │ ├── memory.md # Project context memory
│ │ └── chatlogs/ # Team dialogue history
│ └── code-reviewer/ # Code review Agent
├── .git/ # Version control
└── package.json # Project configuration
💻 CLI Agent-First Mode Access:
Global Configuration/
~/Documents/HyperChat/
.hyperchat/
├── mcp.json # 🌍 Global MCP service pool
├── .env # Global environment variables
└── agents/ # 🚀 Global Agent library
├── personal-assistant/ # Personal assistant Agent
│ ├── agent.yaml # Agent configuration
│ ├── memory.md # Personal context memory
│ └── chatlogs/ # Personal dialogue history
└── code-expert/ # Professional code Agent
```
**Core Advantages of Dual-Layer Configuration**:
- 🌐 **Web Mode**: Workspace-centric, suitable for project-level management and team collaboration
- 💻 **CLI Mode**: Agent-centric, supports the use of personal tools across projects
- 🔄 **Intelligent Merging**: 5-layer priority management of global configuration + workspace configuration
- 💾 **Data Isolation**: Project-level and personal-level data are completely separated and do not interfere with each other
```
## 🌟 Revolutionary Advantages of AI as Code
### 🔄 Intelligent Management Under Dual-Layer Architecture
#### 🌐 Web Mode: Team Collaboration Version Control
```bash
# 📁 Project-level AI configuration version management
git add .hyperchat/agents/project-assistant/
git commit -m "Add project-specific AI assistant"
git push origin feature/project-ai
# 👥 Team AI best practice sharing
git clone https://github.com/team/ai-workspace-templates.git
cp -r ai-workspace-templates/react-fullstack/.hyperchat ./
# 🔄 Project AI configuration rollback
git checkout HEAD~1 -- .hyperchat/
```
#### 💻 CLI Mode: Personal Tool Management
```bash
# 🚀 Quickly deploy personal Agent
hyperchat agent create personal-coder --template ~/ai-templates/
```
# 🌍 Use Personal Agent Across Projects
cd /project-a && hyperchat agent personal-coder "分析这个项目"
cd /project-b && hyperchat agent personal-coder "分析这个项目"
# 💾 Agent Memory and Context Auto-Switching
# personal-coder will remember the characteristics and context of different projects
```
### Agent Configuration and Custom Commands ✨**New Feature**
#### Agent Basic Configuration
```yaml
# .hyperchat/agents/project-assistant/agent.yaml
name: "项目助手"
description: "Specifically designed for this project React + Node.js full-stack assistant"
modelKey: "claude-3-5-sonnet"
isConfirmCallTool: false
# 🔌 Use workspace-level MCP service pool
allowMCPs: ["filesystem", "git", "npm", "database"]
prompt: |
You are the exclusive AI assistant for this project, familiar with:
- Project architecture: React + TypeScript + Node.js
- Business domain: E-commerce platform development
- Team specifications: ESLint + Prettier + Jest
Please provide professional advice based on the project context.
tags: ["project", "fullstack", "ecommerce"]
```
#### Agent Custom Command Directory Structure ✨**New Feature**
```
.hyperchat/agents/project-assistant/
├── agent.yaml # Agent Configuration
├── memory.md # Agent Memory
├── commands/ # 🎯 Custom Command Directory
│ ├── bug-fix.md # Bug Fix Command
│ ├── review.md # Code Review Command
│ ├── explain.md # Code Explanation Command
│ ├── test.md # Test Case Command
│ ├── optimize.md # Code Optimization Command
│ └── document.md # Documentation Generation Command
└── chatlogs/ # Chat Logs
```
#### Command Template Example (Pure Markdown)
```markdown
# commands/bug-fix.md
Please help me fix the bug in the following code:
$ARG
Requirements:
1. Carefully analyze the root cause of the problem
2. Provide a detailed repair plan
3. Give the complete code after the fix
4. Explain the principle and best practices of the fix
5. Provide suggestions for preventing similar problems
```
```markdown
# commands/review.md
Please conduct a comprehensive code review of the following code:
$ARG
Review points:
1. **Code Quality**: Readability, maintainability, naming conventions
2. **Performance Issues**: Algorithm efficiency, memory usage, potential bottlenecks
3. **Security Risks**: Input validation, permission control, data leakage risks
4. **Best Practices**: Design patterns, architectural principles, team specifications
5. **Improvement Suggestions**: Specific optimization plans and alternative implementations
Please provide specific modification suggestions and code examples.
```
#### Usage Example
```bash
# Use a custom command to fix a bug
hyperchat agent project-assistant "/bug-fix @./src/login.ts 用户登录后跳转异常"
# Actual content sent to AI:
# Please help me fix the bug in the following code:
# @./src/login.ts 用户登录后跳转异常
# Requirements:
# 1. Carefully analyze the root cause of the problem
# 2. Provide a detailed repair plan
# 3. Give the complete code after the fix
# 4. Explain the principle and best practices of the fix
# 5. Provide suggestions for preventing similar problems
# Use the code review command
hyperchat agent project-assistant "/review @./src/components/UserProfile.tsx"
# Use in interactive chat
hyperchat agent project-assistant chat
> /bug-fix This function has a memory leak problem
> /optimize @./src/utils/dataProcessor.js
```
```yaml
# ~/Documents/HyperChat/.hyperchat/agents/personal-coder/agent.yaml
name: "个人编程助手"
description: "Cross-project general programming assistant, supports multiple technology stacks"
modelKey: "gpt-4o"
isConfirmCallTool: true
# ⚡ Agent Exclusive MCP Tools + Fallback to Workspace
allowMCPs: ["terminal", "browser", "calculator"]
prompt: |
You are my personal programming assistant, good at:
- Multi-language development: Python, JavaScript, Go, Rust
- Architecture design and code review
- Rapid prototype development and problem solving
Adjust the answering style according to the context of different projects.
tags: ["personal", "general", "cross-project"]
```
### 🤖 AI Model Recommendation
| Model Provider | Recommendation Level | Features |
|------------|----------|----------|
| Claude | ⭐⭐⭐⭐⭐⭐ | 最强 |
| Kimi k2 | ⭐⭐⭐⭐⭐ | 很不错 |
## 🔧 Development Guide
### 💻 Local Development
```bash
# Clone the project
git clone https://github.com/BigSweetPotatoStudio/HyperChat.git
cd HyperChat
# Install dependencies
npm install
cd packages/electron && npm install
cd packages/web && npm install
cd ../..
# Start the development server
npm run dev
## 🤝 Community Communication
- [Telegram](https://t.me/dadigua001)
- [QQ 群](https://qm.qq.com/cgi-bin/qm/qr?k=KrNWdu5sp7H3ves3ZPSd7ppKjQiPrAvZ&jump_from=webapi&authKey=xnW+Lcgk5KLh5NPh3lU0ddz9CFDbXgvjEy35wsYipUrCsqXFcqlvM5Yorh6jkGim)
## 📄 Disclaimer
This project is for learning and communication purposes only. The project developers are not responsible for any operations (such as web crawling) performed using this project.
## 📜 License
This project uses an open-source license. See the [LICENSE](LICENSE) file for details.
Connection Info
You Might Also Like
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.