Moltbot Configuration Reference

This guide covers all configuration options for Moltbot, including config files, credentials, and environment variables.

Configuration Files

Main Config: ~/.clawdbot/moltbot.json

This is your primary configuration file. It uses JSON5 format (allows comments and trailing commas).

{ // Workspace for skills, prompts, memories "workspace": "~/clawd", // Default AI model "defaultModel": "claude-sonnet-4-20250514", // Gateway settings "gateway": { "port": 18789, "host": "127.0.0.1" }, // Channel configurations "channels": { "telegram": { "enabled": true, "tokenFile": "~/.clawdbot/credentials/telegram-token" }, "discord": { "enabled": true }, "whatsapp": { "enabled": true }, "slack": { "enabled": false } }, // Agent settings "agent": { "name": "Moltbot", "systemPrompt": "You are a helpful assistant." } }

Creating the Config

The config file is created automatically when you run:

moltbot setup

Or create it manually:

mkdir -p ~/.clawdbot cat > ~/.clawdbot/moltbot.json << 'EOF' { "workspace": "~/clawd", "defaultModel": "claude-sonnet-4-20250514" } EOF

Workspace: ~/clawd

Your workspace contains customizations that persist across updates:

~/clawd/ ├── skills/ # Custom skills │ └── my-skill.js ├── prompts/ # Custom prompts │ └── system.md ├── memories/ # Conversation memories │ └── <agentId>/ └── config/ # Additional config └── models.json
Recommendation: Make your workspace a private git repo for backup and versioning:
cd ~/clawd git init git remote add origin git@github.com:yourname/clawd-private.git

Credential Storage

Credential Locations

CredentialLocation
WhatsApp session~/.clawdbot/credentials/whatsapp/<accountId>/creds.json
Telegram bot token~/.clawdbot/credentials/telegram-token
Discord bot tokenConfig/env (DISCORD_BOT_TOKEN)
Slack tokensConfig/env (SLACK_BOT_TOKEN, SLACK_APP_TOKEN)
Channel allowlists~/.clawdbot/credentials/<channel>-allowFrom.json
Model auth profiles~/.clawdbot/agents/<agentId>/agent/auth-profiles.json

Auth Profiles

For AI model authentication, create ~/.clawdbot/agents/{agentId}/agent/auth-profiles.json:

{ "anthropic": { "apiKey": "sk-ant-..." }, "openai": { "apiKey": "sk-..." } }

Or use environment variables (preferred for security).

Environment Variables

Environment variables override config file settings.

Core Settings

VariableEnvironment variables override config file settings.Default
NODE_ENVEnvironment modedevelopment
LOG_LEVELLogging verbosityinfo
GATEWAY_PORTGateway WebSocket port18789
GATEWAY_HOSTGateway bind address127.0.0.1

AI Provider Keys

VariableEnvironment variables override config file settings.
ANTHROPIC_API_KEYAnthropic (Claude) API key
OPENAI_API_KEYOpenAI API key
GOOGLE_API_KEYGoogle AI API key

Channel Tokens

VariableEnvironment variables override config file settings.
TELEGRAM_BOT_TOKENTelegram bot token
DISCORD_BOT_TOKENDiscord bot token
DISCORD_APPLICATION_IDDiscord application ID
SLACK_BOT_TOKENSlack bot OAuth token
SLACK_APP_TOKENSlack app-level token

Example .env File

# Environment NODE_ENV=production LOG_LEVEL=info # Gateway GATEWAY_PORT=18789 # AI Providers ANTHROPIC_API_KEY=sk-ant-api03-... OPENAI_API_KEY=sk-... # Channels TELEGRAM_BOT_TOKEN=123456789:ABCdefGHI... DISCORD_BOT_TOKEN=MTIzNDU2Nzg5... DISCORD_APPLICATION_ID=123456789012345678
Security: Never commit .env files to version control. Add .env to your .gitignore.

Gateway Configuration

Port Settings

Default WebSocket: ws://127.0.0.1:18789

Change via config:

{ "gateway": { "port": 18790, "host": "0.0.0.0" } }

Or environment:

GATEWAY_PORT=18790 moltbot gateway
Important: Keep the macOS app, CLI, and Gateway all using the same port!

Gateway Flags

When running the Gateway directly:

# Specify port moltbot gateway --port 18790 # Specify config file moltbot gateway --config /path/to/config.json # Debug mode DEBUG=moltbot:* moltbot gateway

Channel Configuration

Telegram

{ "channels": { "telegram": { "enabled": true, "tokenFile": "~/.clawdbot/credentials/telegram-token", "replyToMode": "thread", "allowedChats": [123456789, -987654321] } } }

Discord

{ "channels": { "discord": { "enabled": true, "replyToMode": "thread", "allowedGuilds": ["123456789"], "allowedChannels": ["987654321"] } } }

WhatsApp

{ "channels": { "whatsapp": { "enabled": true, "allowFrom": "~/.clawdbot/credentials/whatsapp-allowFrom.json" } } }

Allowlist file format:

{ "numbers": ["+1234567890"], "groups": ["Family Group"] }

Slack

{ "channels": { "slack": { "enabled": true, "botToken": "xoxb-...", "appToken": "xapp-...", "allowedChannels": ["C123456"] } } }

Agent Configuration

{ "agent": { "name": "Moltbot", "systemPrompt": "You are a helpful AI assistant.", "defaultModel": "claude-sonnet-4-20250514", "maxTokens": 4096, "temperature": 0.7 } }
OptionDescriptionDefault
nameAgent display nameMoltbot
systemPromptBase system promptBuilt-in
defaultModelAI model to useclaude-sonnet-4-20250514
maxTokensMax response tokens4096
temperatureResponse randomness0.7

State and Logs

Session Storage

Active sessions are stored at:

~/.clawdbot/agents/<agentId>/sessions/

Log Files

Logs are written to:

/tmp/moltbot/ ├── gateway.log ├── error.log └── <channel>.log

Or view via journalctl (Linux):

journalctl --user -u moltbot -f

Configuration Precedence

Settings are loaded in this order (later overrides earlier):

  1. Built-in defaults
  2. ~/.clawdbot/moltbot.json
  3. Environment variables
  4. Command-line flags

Validating Configuration

Check your config for errors:

moltbot config validate

View effective config:

moltbot config show

Backup Recommendations

What to back up:

PathContainsPriority
~/.clawdbot/moltbot.jsonMain configHigh
~/.clawdbot/credentials/All credentialsHigh
~/clawd/WorkspaceHigh
~/.clawdbot/agents/Sessions, memoriesMedium

Simple backup script:

#!/bin/bash tar -czf moltbot-backup-$(date +%Y%m%d).tar.gz \ ~/.clawdbot \ ~/clawd

Next Steps

Configuration Reference | Moltbot Setup Guide