src/process/resources/skills/openclaw-setup/references/configuration.md
~/.openclaw/openclaw.json~/.openclaw/workspace(默认)~/.openclaw/credentials/~/.openclaw/agents/<agentId>/sessions/~/.openclaw/(整个目录)OPENCLAW_CONFIG_PATH - 配置文件路径OPENCLAW_STATE_DIR - 状态目录路径OPENCLAW_PROFILE - 配置 profile 名称ANTHROPIC_API_KEY - Anthropic API 密钥OPENAI_API_KEY - OpenAI API 密钥openclaw config get <key>
例如:
openclaw config get gateway.mode
openclaw config get agents.defaults.model
openclaw config set <key> <value>
例如:
openclaw config set gateway.mode local
openclaw config set gateway.port 18789
openclaw configure
或配置特定部分:
openclaw configure --section models
openclaw configure --section gateway
openclaw configure --section channels
{
gateway: {
mode: 'local', // 或 "remote"
port: 18789,
bind: '127.0.0.1', // 或 "0.0.0.0"
auth: {
token: 'your-token-here',
},
},
}
{
agents: {
defaults: {
workspace: '~/.openclaw/workspace',
model: 'anthropic/claude-opus-4-5',
// 其他默认设置
},
list: [
{
id: 'main',
identity: {
name: 'OpenClaw',
emoji: '🦞',
avatar: 'avatars/openclaw.png',
},
},
],
},
}
{
channels: {
telegram: {
botToken: 'your-token',
allowFrom: ['+1234567890'],
dm: {
policy: 'pairing', // 或 "open"
},
},
whatsapp: {
allowFrom: ['+1234567890'],
},
},
}
使用不同的配置文件和状态目录运行多个实例:
OPENCLAW_CONFIG_PATH=~/.openclaw/a.json \
OPENCLAW_STATE_DIR=~/.openclaw-a \
openclaw gateway --port 19001
配置文件应该设置为仅所有者可读写:
chmod 600 ~/.openclaw/openclaw.json
openclaw doctor 会自动检查并修复权限问题。