nano-claw is a TypeScript + Node.js implementation of nanobot, an ultra-lightweight personal AI assistant inspired by OpenClaw.
- πͺΆ Ultra-Lightweight: Just ~4,500 lines of core TypeScript code
- π¬ Research-Ready: Clean, readable code that's easy to understand and extend
- β‘οΈ Lightning Fast: Minimal footprint for faster startup and lower resource usage
- π Easy-to-Use: Simple configuration and intuitive CLI
nano-claw/
βββ src/
β βββ agent/ # π§ Core agent logic
β β βββ loop.ts # Agent loop (LLM β tool execution)
β β βββ context.ts # Prompt builder
β β βββ memory.ts # Persistent memory
β β βββ skills.ts # Skills loader
β β βββ subagent.ts # Background task execution
β β βββ tools/ # Built-in tools
β βββ skills/ # π― Bundled skills (github, weather, etc.)
β βββ channels/ # π± Chat channel integrations
β βββ bus/ # π Message routing
β βββ cron/ # β° Scheduled tasks
β βββ heartbeat/ # π Proactive wake-up
β βββ providers/ # π€ LLM providers (OpenRouter, etc.)
β βββ session/ # π¬ Session management
β βββ config/ # βοΈ Configuration
β βββ cli/ # π₯οΈ Command-line interface
βββ package.json
- Agent Loop: LLM and tool execution loop
- Context Builder: Construct prompt context
- Memory: Persistent conversation memory
- Skills Loader: Dynamic skill loading from Markdown files
- Subagent: Background task management
- Tools: Built-in tools (shell, file operations, etc.)
Support for multiple LLM providers:
- OpenRouter (recommended, access to all models)
- Anthropic (Claude)
- OpenAI (GPT)
- DeepSeek
- Groq
- Gemini
- MiniMax
- AiHubMix (API gateway, all models) β¨ NEW
- Dashscope (Qwen)
- Moonshot (Kimi)
- Zhipu (GLM)
- vLLM (local models)
Support for multiple chat platforms:
- Telegram β Implemented
- Discord β Implemented
- DingTalk / ιι β Implemented
- WhatsApp (config ready)
- Feishu / ι£δΉ¦ (config ready)
- Slack (config ready)
- Email (config ready)
- QQ (config ready)
- Mochat (config ready)
Note: Telegram, Discord, and DingTalk channel adapters are fully implemented. Additional channel adapters can be added by extending the
BaseChannelclass.
- Gateway Server: Central hub for channel management β¨ NEW
- Message Bus: Event-driven message routing β¨ NEW
- Cron Tasks: Schedule tasks with cron expressions
- Heartbeat: Proactive wake-up mechanism β¨ NEW
- Session Management: Multi-user, multi-channel session support β¨ ENHANCED
- Subagent Tasks: Background task execution β¨ NEW
- Configuration: JSON configuration files with Zod validation
npm install -g nano-claw
pnpm install -g nano-claw
yarn global add nano-claw1. Initialize
nano-claw onboard2. Configure (~/.nano-claw/config.json)
For OpenRouter (recommended):
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-xxx"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5"
}
}
}3. Chat
nano-claw agent -m "What is 2+2?"nano-claw onboard- Initialize configurationnano-claw agent -m "..."- Chat with agent (single message)nano-claw agent- Interactive modenano-claw gateway- Start gateway server for channels β¨ NEWnano-claw status- Show system statusnano-claw channels login- Login to channels (e.g., WhatsApp)nano-claw cron add/list/remove- Manage scheduled tasks
# Watch mode (auto-rebuild on changes)
npm run dev
# Lint code
npm run lint
# Format code
npm run format
# Run tests
npm run testComprehensive examples to help you get started and master nano-claw:
- Examples Directory - Complete guide to all examples
- Basic Usage - Getting started for beginners
- Integration Examples - Telegram, Discord, local models
- Advanced Features - Custom skills, cron, subagents
- Use Case Scenarios - Real-world examples
- Code Recipes - Configuration patterns and troubleshooting
Configuration file location: ~/.nano-claw/config.json
See CONFIGURATION.md for detailed configuration options including:
- All 11 LLM providers setup
- Agent behavior customization
- Tool execution security
- Chat channel integrations
- Environment variables
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details