资源告急?用nanobot替代openclaw:一个仅需4000行代码的轻量级AI助手部署实践
什么是nanobot?
git clone https://github.com/HKUDS/nanobot.gitcd nanobotpip install -e .
[root@3up7Z nanobot]# nanobot onboard✓ Created config at /root/.nanobot/config.jsonConfig template now uses `maxTokens` + `contextWindowTokens`; `memoryWindow` is no longer a runtime setting.Created SOUL.mdCreated USER.mdCreated HEARTBEAT.mdCreated TOOLS.mdCreated AGENTS.mdCreated memory/MEMORY.mdCreated memory/HISTORY.md🐈 nanobot is ready!Next steps:1. Add your API key to ~/.nanobot/config.jsonGet one at: https://openrouter.ai/keys2. Chat: nanobot agent -m "Hello!"Want Telegram/WhatsApp? See: https://github.com/HKUDS/nanobot#-chat-apps[root@3up7Z nanobot]#
{"agents": {"defaults": {"workspace": "~/.nanobot/workspace","model": "anthropic/claude-opus-4-5","provider": "auto","maxTokens": 8192,"contextWindowTokens": 65536,"temperature": 0.1,"maxToolIterations": 40,"reasoningEffort": null}},"channels": {"sendProgress": true,"sendToolHints": false,"whatsapp": {"enabled": false,"bridgeUrl": "ws://localhost:3001","bridgeToken": "","allowFrom": []},"telegram": {"enabled": false,"token": "","allowFrom": [],"proxy": null,"replyToMessage": false,"groupPolicy": "mention"},"discord": {"enabled": false,"token": "","allowFrom": [],"gatewayUrl": "wss://gateway.discord.gg/?v=10&encoding=json","intents": 37377,"groupPolicy": "mention"},"feishu": {"enabled": false,"appId": "","appSecret": "","encryptKey": "","verificationToken": "","allowFrom": [],"reactEmoji": "THUMBSUP","groupPolicy": "mention"},"mochat": {"enabled": false,"baseUrl": "https://mochat.io","socketUrl": "","socketPath": "/socket.io","socketDisableMsgpack": false,"socketReconnectDelayMs": 1000,"socketMaxReconnectDelayMs": 10000,"socketConnectTimeoutMs": 10000,"refreshIntervalMs": 30000,"watchTimeoutMs": 25000,"watchLimit": 100,"retryDelayMs": 500,"maxRetryAttempts": 0,"clawToken": "","agentUserId": "","sessions": [],"panels": [],"allowFrom": [],"mention": {"requireInGroups": false},"groups": {},"replyDelayMode": "non-mention","replyDelayMs": 120000},"dingtalk": {"enabled": false,"clientId": "","clientSecret": "","allowFrom": []},"email": {"enabled": false,"consentGranted": false,"imapHost": "","imapPort": 993,"imapUsername": "","imapPassword": "","imapMailbox": "INBOX","imapUseSsl": true,"smtpHost": "","smtpPort": 587,"smtpUsername": "","smtpPassword": "","smtpUseTls": true,"smtpUseSsl": false,"fromAddress": "","autoReplyEnabled": true,"pollIntervalSeconds": 30,"markSeen": true,"maxBodyChars": 12000,"subjectPrefix": "Re: ","allowFrom": []},"slack": {"enabled": false,"mode": "socket","webhookPath": "/slack/events","botToken": "","appToken": "","userTokenReadOnly": true,"replyInThread": true,"reactEmoji": "eyes","allowFrom": [],"groupPolicy": "mention","groupAllowFrom": [],"dm": {"enabled": true,"policy": "open","allowFrom": []}},"qq": {"enabled": false,"appId": "","secret": "","allowFrom": []},"matrix": {"enabled": false,"homeserver": "https://matrix.org","accessToken": "","userId": "","deviceId": "","e2EeEnabled": true,"syncStopGraceSeconds": 2,"maxMediaBytes": 20971520,"allowFrom": [],"groupPolicy": "open","groupAllowFrom": [],"allowRoomMentions": false},"wecom": {"enabled": false,"botId": "","secret": "","allowFrom": [],"welcomeMessage": ""}},"providers": {"custom": {"apiKey": "","apiBase": null,"extraHeaders": null},"azureOpenai": {"apiKey": "","apiBase": null,"extraHeaders": null},"anthropic": {"apiKey": "","apiBase": null,"extraHeaders": null},"openai": {"apiKey": "","apiBase": null,"extraHeaders": null},"openrouter": {"apiKey": "","apiBase": null,"extraHeaders": null},"deepseek": {"apiKey": "","apiBase": null,"extraHeaders": null},"groq": {"apiKey": "","apiBase": null,"extraHeaders": null},"zhipu": {"apiKey": "","apiBase": null,"extraHeaders": null},"dashscope": {"apiKey": "","apiBase": null,"extraHeaders": null},"vllm": {"apiKey": "","apiBase": null,"extraHeaders": null},"ollama": {"apiKey": "","apiBase": null,"extraHeaders": null},"gemini": {"apiKey": "","apiBase": null,"extraHeaders": null},"moonshot": {"apiKey": "","apiBase": null,"extraHeaders": null},"minimax": {"apiKey": "","apiBase": null,"extraHeaders": null},"aihubmix": {"apiKey": "","apiBase": null,"extraHeaders": null},"siliconflow": {"apiKey": "","apiBase": null,"extraHeaders": null},"volcengine": {"apiKey": "","apiBase": null,"extraHeaders": null},"volcengineCodingPlan": {"apiKey": "","apiBase": null,"extraHeaders": null},"byteplus": {"apiKey": "","apiBase": null,"extraHeaders": null},"byteplusCodingPlan": {"apiKey": "","apiBase": null,"extraHeaders": null},"openaiCodex": {"apiKey": "","apiBase": null,"extraHeaders": null},"githubCopilot": {"apiKey": "","apiBase": null,"extraHeaders": null}},"gateway": {"host": "0.0.0.0","port": 18790,"heartbeat": {"enabled": true,"intervalS": 1800}},"tools": {"web": {"proxy": null,"search": {"provider": "brave","apiKey": "","baseUrl": "","maxResults": 5}},"exec": {"timeout": 60,"pathAppend": ""},"restrictToWorkspace": false,"mcpServers": {}}}
"agents": {"defaults": {"workspace": "~/.nanobot/workspace","model": "qwen3.5-flash","provider": "custom",...},...},"providers": {"custom": {"apiKey": "sk-****7539a1","apiBase": "https://dashscope.aliyuncs.com/compatible-mode/v1","extraHeaders": null},...}
[root@3up7Z nanobot]# nanobot agent🐈 Interactive mode (type exit or Ctrl+C to quit)You: 北京是那个国家的首都🐈 nanobot北京是中国的首都。You:Goodbye!
"channels": {..."feishu": {"enabled": true,"appId": "cli_***ced","appSecret": "qoKo****cH7","encryptKey": "","verificationToken": "","allowFrom": ["*"],// or "ou_YOUR_OPEN_ID""reactEmoji": "THUMBSUP","groupPolicy": "mention"},...}

夜雨聆风