git clone https://github.com/musenming/comobot.git
cd comobot
python3.11 -m venv .venv
# or: python3.12 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install -e ".[dev]"
# (Optional) Install Matrix channel support
pip install -e ".[matrix]"
comobot --help
comobot --version
pytest tests/ -v 两行代码,唤醒你的专属智能体。
pip install comobot uv tool install comobot # Docker Compose (recommended)
docker compose run --rm comobot-cli onboard # First-time setup
vim ~/.comobot/config.json # Add API keys
docker compose up -d comobot-gateway # Start gateway
# Docker (manual)
docker build -t comobot .
docker run -v ~/.comobot:/root/.comobot --rm comobot onboard
vim ~/.comobot/config.json
docker run -v ~/.comobot:/root/.comobot -p 18790:18790 comobot gateway 前置依赖
Python(>= 3.11)、pip(>= 22.0)、Node.js(>= 18)、Git。
安装后初始化配置
comobot onboard 编辑 ~/.comobot/config.json 添加模型提供商:
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-xxx"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5",
"provider": "openrouter"
}
}
} 启动对话:
comobot agent # Interactive mode
comobot agent -m "Hello!" # Single message
comobot gateway # Start gateway (API + channels + web UI) Web 前端配置
生产模式:
cd web
npm install
npm run build
cd ..
comobot gateway 开发模式:
# Terminal 1: Start the backend gateway (API port 18790)
comobot gateway
# Terminal 2: Start Vite dev server (Frontend port 5173, auto-proxies API)
cd web
npm install
npm run dev 环境变量与 WhatsApp 桥接
cd bridge
npm install
npm run build
comobot channels login 常见问题与开发者指令
ModuleNotFoundError: nh3:运行 pip install -e ".[matrix]"。
ruff check . # Lint
ruff check . --fix # Auto-fix lint issues
ruff format . # Format
pytest tests/ -v # Run tests