Complete guide to configuring nano-claw for your needs.
The configuration file is located at ~/.nano-claw/config.json. It uses JSON format with the following main sections:
- providers: LLM API provider settings
- agents: Agent behavior and model settings
- tools: Tool execution settings
- channels: Chat channel integrations
nano-claw supports 11 LLM providers:
- OpenRouter (Recommended - Gateway to all models)
- Anthropic (Claude)
- OpenAI (GPT)
- DeepSeek
- Groq
- Gemini (Google)
- MiniMax
- Dashscope (Qwen/Alibaba)
- Moonshot (Kimi)
- Zhipu (GLM)
- vLLM (Local models)
Each provider can be configured with:
{
"providers": {
"provider_name": {
"apiKey": "your-api-key", // API key for authentication
"apiBase": "https://...", // Optional: Custom API base URL
"enabled": true // Optional: Enable/disable provider
}
}
}OpenRouter (Recommended):
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-YOUR_KEY_HERE"
}
}
}Get your key: https://openrouter.ai/keys
Anthropic (Claude):
{
"providers": {
"anthropic": {
"apiKey": "sk-ant-YOUR_KEY_HERE"
}
}
}Get your key: https://console.anthropic.com
OpenAI (GPT):
{
"providers": {
"openai": {
"apiKey": "sk-YOUR_KEY_HERE"
}
}
}Get your key: https://platform.openai.com
DeepSeek:
{
"providers": {
"deepseek": {
"apiKey": "YOUR_KEY_HERE"
}
}
}Get your key: https://platform.deepseek.com
Groq:
{
"providers": {
"groq": {
"apiKey": "YOUR_KEY_HERE"
}
}
}Get your key: https://console.groq.com
Gemini (Google):
{
"providers": {
"gemini": {
"apiKey": "YOUR_KEY_HERE"
}
}
}Get your key: https://makersuite.google.com/app/apikey
vLLM (Local Models):
{
"providers": {
"vllm": {
"apiBase": "http://localhost:8000/v1"
}
}
}You can configure multiple providers. The agent will automatically select the appropriate provider based on the model name:
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-..."
},
"anthropic": {
"apiKey": "sk-ant-..."
},
"openai": {
"apiKey": "sk-..."
}
}
}Configure agent behavior and defaults:
{
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5", // Model to use
"temperature": 0.7, // Creativity (0.0-2.0)
"maxTokens": 4096, // Max response length
"systemPrompt": "You are a helpful assistant..." // Optional custom prompt
}
}
}- model: Model identifier (e.g.,
anthropic/claude-opus-4-5,gpt-4-turbo) - temperature: Controls randomness (0.0 = deterministic, 2.0 = very creative)
- maxTokens: Maximum tokens in response (default: 4096)
- systemPrompt: Custom system prompt to guide agent behavior
Via OpenRouter:
anthropic/claude-opus-4-5- Most capableanthropic/claude-sonnet-4-5- Balancedopenai/gpt-4-turbo- GPT-4 Turbogoogle/gemini-pro-1.5- Gemini Prometa-llama/llama-3.1-405b- Llama 3.1
Direct Access:
claude-opus-4-5- Anthropic directgpt-4-turbo- OpenAI directdeepseek-chat- DeepSeekgemma2-9b-it- Groq
Configure tool execution behavior:
{
"tools": {
"restrictToWorkspace": false, // Restrict file operations to current directory
"allowedCommands": ["git", "npm"], // Whitelist specific commands
"deniedCommands": ["rm -rf", "sudo"] // Blacklist dangerous commands
}
}- restrictToWorkspace: When
true, file operations are restricted to the current working directory - allowedCommands: List of allowed shell commands (when set, only these commands can run)
- deniedCommands: List of forbidden shell commands (these commands will be blocked)
For production use:
{
"tools": {
"restrictToWorkspace": true,
"deniedCommands": [
"rm -rf",
"sudo",
"chmod",
"chown",
"mkfs",
"dd",
":(){ :|:& };:"
]
}
}For development with specific tools:
{
"tools": {
"allowedCommands": [
"git",
"npm",
"node",
"tsc",
"eslint",
"prettier"
]
}
}Configure chat platform integrations. Most channels are deferred in the current MVP version, but the configuration structure is prepared for future implementation.
{
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"allowFrom": ["username1", "username2"] // Optional: Whitelist users
}
}
}{
"channels": {
"discord": {
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"allowFrom": ["user_id1", "user_id2"] // Optional: Whitelist users
}
}
}{
"channels": {
"slack": {
"enabled": true,
"botToken": "xoxb-...",
"appToken": "xapp-...",
"groupPolicy": "mention" // "mention", "open", or "allowlist"
}
}
}{
"channels": {
"email": {
"enabled": true,
"consentGranted": true,
"imapHost": "imap.gmail.com",
"imapPort": 993,
"imapUsername": "your-email@gmail.com",
"imapPassword": "your-app-password",
"smtpHost": "smtp.gmail.com",
"smtpPort": 587,
"smtpUsername": "your-email@gmail.com",
"smtpPassword": "your-app-password",
"fromAddress": "your-email@gmail.com",
"allowFrom": ["trusted@example.com"]
}
}
}{
"channels": {
"feishu": {
"enabled": true,
"appId": "YOUR_APP_ID",
"appSecret": "YOUR_APP_SECRET",
"encryptKey": "YOUR_ENCRYPT_KEY",
"verificationToken": "YOUR_TOKEN",
"allowFrom": ["user_id1", "user_id2"]
}
}
}Similar configuration patterns exist for:
- DingTalk (閽夐拤)
- Mochat
See src/config/schema.ts for complete schema definitions.
You can override configuration using environment variables:
# Provider API Keys
export OPENROUTER_API_KEY="sk-or-v1-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
export DEEPSEEK_API_KEY="..."
export GROQ_API_KEY="..."
export GEMINI_API_KEY="..."
# Logging
export LOG_LEVEL="debug" # debug, info, warn, error
export NODE_ENV="production" # production, developmentEnvironment variables take precedence over config file settings.
Here's a complete configuration example:
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-YOUR_KEY_HERE"
},
"anthropic": {
"apiKey": "sk-ant-YOUR_KEY_HERE"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5",
"temperature": 0.7,
"maxTokens": 4096,
"systemPrompt": "You are a helpful AI assistant specialized in software development."
}
},
"tools": {
"restrictToWorkspace": false,
"deniedCommands": [
"rm -rf /",
"sudo",
"mkfs"
]
},
"channels": {
"telegram": {
"enabled": false
},
"discord": {
"enabled": false
}
}
}The configuration is validated using Zod schemas. Invalid configurations will produce clear error messages:
nano-claw status
# Error: Invalid configuration: temperature must be between 0 and 2- Config:
~/.nano-claw/config.json - Memory:
~/.nano-claw/memory/ - Skills:
~/.nano-claw/skills/ - Cron Jobs:
~/.nano-claw/cron.json - Logs:
~/.nano-claw/logs/
- Start Simple: Begin with just one provider (OpenRouter recommended)
- Test Configuration: Run
nano-claw statusto verify your setup - Use Environment Variables: For sensitive data in shared environments
- Backup Config: Keep a backup of your working configuration
- Check Logs: Logs are stored in
~/.nano-claw/logs/for troubleshooting
Run nano-claw onboard to initialize the configuration.
Check that your API key is correct and has proper permissions.
Verify the model name is correct for your provider. Use nano-claw status to see available models.
Check file permissions on ~/.nano-claw/ directory:
chmod 700 ~/.nano-claw
chmod 600 ~/.nano-claw/config.json- Read QUICKSTART.md for getting started
- See ARCHITECTURE.md for system design
- Check CONTRIBUTING.md for development guide