·Y Build Team
OpenClaw Config Edit:完整设置与配置指南 (2026)
掌握 WhatsApp、Discord、Telegram、Ollama 等的 openclaw config edit 命令。逐步指南配置频道、模型、提供商并修复常见 OpenClaw 配置错误。
OpenClawConfigurationTutorialWhatsAppDiscordTelegramOllamaAI Assistant
Y
OC摘要
最常用 OpenClaw 配置命令快速参考:
bash
openclaw config edit
openclaw config set channels.whatsapp.enabled true
openclaw config set model.provider openai
openclaw config set model.name gpt-4o
openclaw config show
openclaw doctor
openclaw doctor --fix
openclaw config reset
什么是 OpenClaw?
OpenClaw 是一个开源 AI 助手框架,将大型语言模型连接到 WhatsApp、Discord、Telegram 和 Slack 等消息频道。支持多个模型提供商 — OpenAI、Anthropic、Ollama(本地模型)、Google 等 — 并可通过自定义技能和插件进行扩展。
Early Access
Be first to build with AI
Y Build is the AI-era operating system for startups. Join the waitlist and get early access.
设置频道
bash
openclaw config set channels.whatsapp.enabled true
openclaw config set channels.whatsapp.phone_number_id "YOUR_PHONE_NUMBER_ID"
openclaw config set channels.whatsapp.access_token "YOUR_ACCESS_TOKEN"
openclaw config set channels.whatsapp.webhook_url "https://your-domain.com/webhook/whatsapp"
Discord
bash
openclaw config set channels.discord.enabled true
openclaw config set channels.discord.bot_token "YOUR_DISCORD_BOT_TOKEN"
Telegram
bash
openclaw config set channels.telegram.enabled true
openclaw config set channels.telegram.bot_token "YOUR_TELEGRAM_BOT_TOKEN"
openclaw config set channels.telegram.mode polling
Slack
bash
openclaw config set channels.slack.enabled true
openclaw config set channels.slack.bot_token "xoxb-YOUR-BOT-TOKEN"
openclaw config set channels.slack.app_token "xapp-YOUR-APP-TOKEN"
配置模型提供商
OpenAI
bash
openclaw config set model.provider openai
openclaw config set model.name gpt-4o
export OPENAI_API_KEY="sk-..."
Anthropic (Claude)
bash
openclaw config set model.provider anthropic
openclaw config set model.name claude-sonnet-4-6
export ANTHROPIC_API_KEY="sk-ant-..."
Ollama(本地模型)
这是 OpenClaw 对注重隐私的用户最闪亮的地方。Ollama 让您在本地运行模型,无需 API 密钥,数据不会离开您的机器。
bash
ollama pull llama3.3
openclaw config set model.provider ollama
openclaw config set model.name llama3.3
openclaw config set model.base_url "http://localhost:11434"
xAI (Grok)
bash
openclaw config set model.provider openai
openclaw config set model.name grok-4.1
openclaw config set model.base_url "https://api.x.ai/v1"
export OPENAI_API_KEY="xai-..."
常见配置错误及修复
bash
openclaw doctor
openclaw doctor --fix
高级配置
多模型配置
yaml
models:
default:
provider: openai
name: gpt-4o
fast:
provider: ollama
name: llama3.3
reasoning:
provider: anthropic
name: claude-opus-4-6
想要更简单的?
Y Build 处理完整技术栈 — 部署、产品视频、AI SEO 和分析。无配置文件。无终端。只需构建和发布。 免费开始 →来源:
Early Access
Be first to build with AI
Y Build is the AI-era operating system for startups. Join the waitlist and get early access.