Documentation Center
Complete documentation and tutorials to help you get started with WeClaw
Getting Started
Requirements
- Python 3.10 or higher
- At least 500MB of available disk space
- At least one LLM API Key (DeepSeek, OpenAI, etc.)
Install WeClaw
Install with a single pip command, no complex configuration needed:
pip install weclawpyFirst Run
After installation, choose your preferred way to start WeClaw:
# CLI 模式
python -m weclaw
# GUI 模式
weclaw-guiBasic Usage
Chat Features
WeClaw supports natural language conversations with multiple LLMs, featuring:
Streaming Output
Real-time AI response display without waiting for completion
Multi-turn Conversation
Automatic context maintenance for continuous follow-ups
Markdown Rendering
Supports code highlighting, tables, lists, and rich text
Image Understanding
Upload images for AI analysis and understanding
Tool Invocation
Describe your task in natural language, and WeClaw will automatically select and invoke the appropriate tools:
# 使用自然语言调用工具
> 帮我截取当前屏幕
> 搜索最近修改的文件
> 打开浏览器访问 github.comWorkflow Configuration
With the workflow feature, you can define multi-step automation tasks for AI to execute according to preset processes.
Advanced Configuration
Model Configuration
WeClaw supports configuring multiple LLM models simultaneously in config/models.toml:
# config/models.toml
[deepseek]
api_key = "sk-xxx"
model = "deepseek-chat"
[openai]
api_key = "sk-xxx"
model = "gpt-4o"
base_url = "https://api.openai.com/v1"
[claude]
api_key = "sk-ant-xxx"
model = "claude-3-5-sonnet-20241022"Tool Customization
You can enable or disable specific tools and configure their parameters:
# config/tools.json
{
"enabled_tools": ["shell", "file", "browser", "voice"],
"tool_settings": {
"browser": {
"headless": true,
"timeout": 30000
}
}
}System Prompt Customization
Customize AI behavior and personality through the system prompt settings to match your usage habits.
API Reference
Remote Service Overview
WeClaw remote service provides WebSocket and REST interfaces for remote desktop AI control from PWA mobile or other clients.
WebSocket Communication
WebSocket interface for real-time bidirectional communication, supporting streaming conversations and live status updates:
// WebSocket 连接
const ws = new WebSocket('ws://localhost:8765/ws');
ws.onopen = () => {
ws.send(JSON.stringify({
type: 'chat',
message: 'Hello, WeClaw!'
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Response:', data);
};REST Endpoints
REST API provides the following main endpoints:
/api/chatSend chat messages and receive AI responses
/api/toolsGet list of available tools
/api/tool/executeExecute specified tool and return results
Deployment Guide
Local Deployment
The simplest deployment method, suitable for personal use:
# 本地部署
pip install weclawpy
weclaw-guiRemote Service Deployment
If you need remote control from your phone, start the remote service:
# 启动远程服务
python -m weclaw.remote_server --host 0.0.0.0 --port 8765
# 配置防火墙(可选)
ufw allow 8765/tcpDocker Deployment
Use Docker to quickly deploy a complete WeClaw environment:
# docker-compose.yml
version: '3.8'
services:
weclaw:
image: weclaw/weclaw:latest
ports:
- "8765:8765"
volumes:
- ./config:/app/config
- ./data:/app/data
environment:
- DEEPSEEK_API_KEY=sk-xxxFrequently Asked Questions
What should I do if I encounter dependency conflicts during installation?
We recommend using a virtual environment to isolate dependencies. Run 'python -m venv venv' to create one, then activate it before installing. If issues persist, try 'pip install weclawpy --no-deps' and manually install missing dependencies.
Why is my API call failing?
First, check if the API Key is correctly configured in config/models.toml. Then verify your network connection - some models (like DeepSeek) may require a VPN. Finally, check logs/winclaw.log for detailed error messages.
How do I switch between different AI models?
You can select the current model in the settings interface. You can also use the /model command during conversation for quick switching. Supported models include DeepSeek, OpenAI, Claude, Gemini, and 10+ others.
PWA mobile cannot connect to remote service?
Ensure the remote service is running and the port is open. Check firewall settings to allow external access on port 8765. If using a public IP, configure port forwarding on your router.
What if tool invocation has no response?
Some tools (like browser automation) need to download Playwright browser on first use - please be patient. Check config/tools.json to confirm the tool is enabled. Some system operations may require administrator privileges.