MoonHub Documentation Index
This page is the entry point and reading guide for the repository documentation.
Recommended Reading Order (First Time)
Repository Root README — Feature overview, license, and recent changelog summary
CHANGELOG.md — Project updates and release notes
CLAUDE.md — Project architecture, build commands, and development guidelines for Claude Code
MoonHub-PWA README — companion app overview for pairing, chat, Space, and settings in the split-repo layout
Troubleshooting , Debug Guide — Runtime issues reference
Tools & Capabilities Configuration — Tool-side configuration (tools.* in config.json)
If you enable sub-agent delegation (delegation.enabled): pkg/delegation/docs/README.md → CONFIG.md → implementation status
If you enable device provisioning on the web launcher (MOONHUB_PROVISIONING_ENABLED=1): pkg/provisioning/docs/README.md → CONFIG.md → implementation status (detailed reference)
If you deploy cloud directory + relay (optional Phase 3 services): cloud/directory/docs/README.md → CONFIG.md → cloud/relay/docs/README.md → CONFIG.md → pkg/transport/docs/README.md → implementation status
If you integrate or debug the companion PWA (LAN discovery, pairing, channel settings, chat): web/backend/api/README.md (authoritative HTTP contract) → ../../MoonHub-PWA/docs/README.md → LAN discovery / LAN pairing on the device side
If you work on AI-generated dynamic UI (Space home tools, schema execution): pkg/dynamictools/docs/README.md → web/backend/api/README.md ( /api/dynamic-tools ) → implementation status → ../../MoonHub-PWA/docs/ARCHITECTURE.md / ../../MoonHub-PWA/docs/services.md
Documentation Flow by Subsystem
Plugin Architecture (Channel / Provider / Tool)
SHIELD Runtime Security (pkg/shield)
Delegation System (sub-agent orchestration)
Smart Router (4-Tier Model Routing)
Order
Document
Description
1
pkg/routing/docs/README.md
Overview, architecture, quick start, and 4-tier system
2
pkg/routing/docs/CONFIG.md
Configuration options, tier mapping, custom boundaries
3
pkg/routing/docs/FEATURES.md
Feature extraction, scoring weights, examples
4
pkg/routing/docs/METRICS.md
Metrics collection, decision recorder, HTTP endpoints
Status
docs/implementation/routing-status.md
Full implementation status, integration points, tests
Device Provisioning (WiFi / hotspot / recovery)
LAN Communication (Phase 1)
Cloud directory & relay (optional)
Order
Document
Description
1
cloud/directory/docs/README.md
HTTP API, PostgreSQL store, Redis online cache
2
cloud/directory/docs/CONFIG.md
directory-service flags, DB_*, REDIS_URL
3
cloud/relay/docs/README.md
WebSocket bridge, Bearer + challenge auth, CONNECT handshake
4
cloud/relay/docs/CONFIG.md
relay flags (-addr, -directory-url)
5
pkg/transport/docs/README.md
CloudClient, Resolver (LAN first, then cloud), Manager
Status
docs/implementation/cloud-directory-relay-status.md
Implementation status (Chinese)
Channel architecture, migration, and how to implement a channel: pkg/channels/README.md . Per-channel behavior also lives with each plugin under pkg/plugins/channels/ (see pkg/plugins/docs/PLUGIN_INDEX.md ).
Document
Description
web/README.md
Web interface development (React + Vite frontend, Go backend); includes device provisioning UI and API notes
web/backend/api/README.md
HTTP API reference for the Go backend: LAN discovery (/api/discover), paired devices (/api/devices), auth, channel CRUD, dynamic tools (/api/dynamic-tools), config, chat, gateway, etc. Companion app docs: ../../MoonHub-PWA/docs/README.md .
Dynamic tools (AI-generated UI)
docs/implementation/ Overview
File
Topic
plugin-status.md
Plugin architecture implementation status
learning-status.md
Self-improving system implementation status
compactor-status.md
Context compactor implementation status
shield-status.md
SHIELD runtime security implementation status
memory-status.md
Memory system implementation status
delegation-status.md
Sub-agent delegation orchestration implementation status
routing-status.md
Smart Router V2 (4-tier routing) implementation status
provisioning-status.md
Device provisioning (WiFi, hotspot, SSE, recovery, auth code, web UI) implementation status
lan-discovery-status.md
LAN mDNS discovery implementation status
lan-pairing-status.md
LAN device pairing implementation status
cloud-directory-relay-status.md
Cloud directory, WebSocket relay, and pkg/transport cloud path
dynamic-tools-status.md
Dynamic tools: schema engine, SQLite, LAN HTTP API, PWA renderer
Per-channel specific documentation:
Directory
Channel
telegram/
Telegram channel documentation
discord/
Discord channel documentation
slack/
Slack channel documentation
matrix/
Matrix channel documentation
qq/
QQ channel documentation
onebot/
OneBot channel documentation
dingtalk/
DingTalk channel documentation
feishu/
Feishu/Lark channel documentation
wecom/
WeCom (企业微信) channel documentation
line/
LINE channel documentation
maixcam/
MaixCam channel documentation
Package Structure Overview
Package
Description
agent/
Main agent loop, message handling, tool execution
channels/
Platform integrations (Telegram, Discord, Slack, Matrix, QQ, WeChat, etc.)
providers/
LLM provider integrations (OpenAI, Anthropic, Gemini, Zhipu, DeepSeek, etc.)
tools/
Available tools (web search, file operations, cron, shell, MCP, etc.)
skills/
Extensible skill system for adding capabilities
config/
Configuration management and loading
memory/
Long-term memory system (MEMORY.md)
session/
Session and conversation management
bus/
Internal event bus for channel communication
commands/
Slash command definitions and execution
routing/
Smart Router V2 (4-tier model routing)
mcp/
Model Context Protocol integration
auth/
OAuth authentication management
cron/
Scheduled task management
health/
Health check and metrics server
heartbeat/
Periodic task prompts
identity/
Unified user identity management
logger/
Structured logging
media/
Media file lifecycle management
migrate/
Configuration migration utilities
state/
Persistent state management
utils/
Shared utilities
voice/
Voice/audio processing
devices/
Hardware device interfaces (I2C, SPI)
provisioning/
Device WiFi provisioning, hotspot, recovery, auth code (opt-in via launcher env)
transport/
Agent-to-agent connections: Manager, Resolver (LAN vs cloud), CloudClient for directory HTTP; see pkg/transport/docs/README.md
dynamictools/
AI-generated dynamic tools: SQLite ToolManager, SchemaEngine, host HTTP fetch; LAN /api/dynamic-tools; see pkg/dynamictools/docs/README.md
fileutil/
File operation utilities
constants/
Shared constants
Optional cloud binaries (cmd/)
CLI Commands (cmd/moonhub/internal/)
Command
Description
agent/
Interactive chat mode (moonhub agent)
gateway/
Long-running bot server for multi-channel support (moonhub gateway)
onboard/
Initial setup wizard (moonhub onboard)
auth/
OAuth authentication management (moonhub auth)
cron/
Scheduled task management (moonhub cron)
skills/
Skills management commands
status/
System status display
version/
Version information
migrate/
Configuration migration
model/
Model management
Directory
Description
frontend/
React + Vite + TanStack Router dashboard
backend/
Go web server with embedded frontend
Supported LLM Providers (pkg/providers/)
MoonHub supports multiple LLM providers with a unified interface:
Provider
Package
Models
OpenAI
openai_compat/
GPT-4, GPT-4o, GPT-3.5-turbo
Anthropic
anthropic/
Claude Opus 4.5/4.6, Claude Sonnet 4.6, Claude Haiku 4.5
Zhipu (智谱)
anthropic/
GLM-4, GLM-4-Flash, GLM-4.7
DeepSeek
openai_compat/
DeepSeek Chat, DeepSeek Reasoner
Gemini
openai_compat/
Gemini Pro, Gemini Ultra
Groq
openai_compat/
Llama, Mixtral (fast inference)
Moonshot
openai_compat/
Moonshot-v1
Qwen (通义千问)
openai_compat/
Qwen-Turbo, Qwen-Plus, Qwen-Max
NVIDIA NIM
openai_compat/
NVIDIA hosted models
Ollama
openai_compat/
Local models via Ollama
OpenRouter
openai_compat/
Multi-provider gateway
vLLM
openai_compat/
High-performance inference
Cerebras
openai_compat/
Fast inference
Volcengine (火山引擎)
openai_compat/
Doubao models
Claude CLI
claude_cli_provider.go
Claude via CLI
Codex CLI
codex_cli_provider.go
Codex via CLI
GitHub Copilot
github_copilot_provider.go
GitHub Copilot integration
Model Format : provider/model (e.g., openai/gpt-4, anthropic/claude-opus-4-6, zhipu/glm-4.7)
Available Tools (pkg/tools/)
Tool
File
Description
Cron
cron.go
Scheduled task management
Edit
edit.go
File editing operations
Filesystem
filesystem.go
File read/write operations
I2C
i2c.go
I2C hardware interface (Linux)
MCP Tool
mcp_tool.go
Model Context Protocol integration
Memory
memory_tool.go
Long-term memory operations
Message
message.go
Message handling utilities
Search
search_tool.go
Web search capabilities
Send File
send_file.go
File sending via channels
Shell
shell.go
Shell command execution
Shield Adapter
shield_adapter.go
SHIELD security integration
Skills Install
skills_install.go
Skill installation
Skills Search
skills_search.go
Skill discovery
Spawn
spawn.go
Process spawning
SPI
spi.go
SPI hardware interface (Linux)
Subagent
subagent.go
Sub-agent delegation
Web
web.go
HTTP/web operations
Workspace Structure (~/.moonhub/workspace/)
workspace/
├── sessions/ # Conversation sessions
├── memory/ # Long-term memory (MEMORY.md)
├── state/ # Persistent state
├── cron/ # Scheduled tasks database
├── skills/ # Custom skills
├── AGENTS.md # Agent behavior instructions
├── HEARTBEAT.md # Periodic task prompts
├── IDENTITY.md # Agent identity settings
├── SOUL.md # Agent personality
├── USER.md # User preferences
└── SHIELD.md # Security policies (optional)