Package Exports
- alvin-bot
- alvin-bot/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (alvin-bot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π€ Alvin Bot β Autonomous AI Agent
Your personal AI assistant β on Telegram, WhatsApp, Discord, Signal, Terminal, and Web.
Alvin Bot is an open-source, self-hosted AI agent that lives where you chat. Built on a multi-model engine with full system access, memory, plugins, and a rich web dashboard. Not just a chatbot β an autonomous agent that remembers, acts, and learns.
πΈ Preview
π¬ Chat (Dark Mode)![]() |
π Dashboard![]() |
π€ AI Models & Providers![]() |
π Personality Editor![]() |
π¬ Telegram![]() |
π± Messaging Platforms![]() |
π§ Custom Tools![]() |
π©Ί Health & Maintenance![]() |
πΌοΈ More Screenshots (click to expand)
| Feature | Screenshot |
|---|---|
| Login | ![]() |
| Chat (Light) | ![]() |
| Memory Manager | ![]() |
| Active Sessions | ![]() |
| File Browser | ![]() |
| Scheduled Jobs | ![]() |
| Plugins & MCP | ![]() |
| WhatsApp Groups | ![]() |
| WA Group Details | ![]() |
| User Management | ![]() |
| Web Terminal | ![]() |
| Settings & Env | ![]() |
| Telegram Commands | ![]() |
| macOS Installer | ![]() |
β¨ Features
π§ Intelligence
- Multi-Model Engine β Claude (Agent SDK with full tool use), OpenAI, Groq, NVIDIA NIM, Google Gemini, OpenRouter, or any OpenAI-compatible API
- Automatic Fallback β If one provider fails, seamlessly tries the next
- Heartbeat Monitor β Pings providers every 5 minutes, auto-failover after 2 failures, auto-recovery
- User-Configurable Fallback Order β Rearrange provider priority via Telegram (
/fallback), Web UI, or API - Adjustable Thinking β From quick answers (
/effort low) to deep analysis (/effort max) - Persistent Memory β Remembers across sessions via vector-indexed knowledge base
- Smart Tool Discovery β Scans your system at startup, knows exactly what CLI tools, plugins, and APIs are available
- Skill System β 6 built-in SKILL.md files (code, data analysis, email, docs, research, sysadmin) auto-activate based on message context
- Self-Awareness β Knows it IS the AI model β won't call external APIs for tasks it can do itself
- Automatic Language Detection β Detects user language (EN/DE) and adapts; learns preference over time
π¬ Multi-Platform
- Telegram β Full-featured with streaming, inline keyboards, voice, photos, documents
- WhatsApp β Via WhatsApp Web: self-chat as AI notepad, group whitelist with per-contact access control, full media support (photos, docs, audio, video)
- WhatsApp Group Approval β Owner gets approval requests via Telegram (or WhatsApp DM fallback) before the bot responds to group messages. Silent β group members see nothing.
- Discord β Server bot with mention/reply detection, slash commands
- Signal β Via signal-cli REST API with voice transcription
- Terminal β Rich TUI with ANSI colors and streaming (
alvin-bot tui) - Web UI β Full dashboard with chat, settings, file manager, terminal
π§ Capabilities
- 52+ Built-in Tools β Shell, files, email, screenshots, PDF, media, git, system control
- Plugin System β 6 built-in plugins (weather, finance, notes, calendar, email, smarthome)
- MCP Client β Connect any Model Context Protocol server
- Cron Jobs β Scheduled tasks with AI-driven creation ("check my email every morning")
- Voice β Speech-to-text (Groq Whisper) + text-to-speech (Edge TTS)
- Vision β Photo analysis, document scanning, screenshot understanding
- Image Generation β Via Google Gemini / DALLΒ·E (with API key)
- Web Browsing β Fetch and summarize web pages
π₯οΈ Web Dashboard
- Live Chat β WebSocket streaming, same experience as Telegram
- Model Switcher β Change AI models on the fly
- Platform Setup β Configure all messengers and providers via UI, WhatsApp group management inline
- File Manager β Browse, edit, create files in the working directory
- Memory Editor β View and edit the agent's knowledge base
- Session Browser β Inspect conversation history
- Terminal β Run commands directly from the browser
- Maintenance β Health checks, backups, bot controls
π Quick Start
npm install -g alvin-bot
alvin-bot setup
alvin-bot startThat's it. The setup wizard validates everything:
- β Tests your AI provider key
- β Verifies your Telegram bot token
- β Confirms the setup works before you start
Requires: Node.js 18+ (nodejs.org) Β· Telegram bot token (@BotFather) Β· Your Telegram user ID (@userinfobot)
Free AI providers available β no credit card needed.
AI Providers
| Provider | Cost | Best for |
|---|---|---|
| Groq | Free | Getting started fast |
| Google Gemini | Free | Image understanding, embeddings |
| NVIDIA NIM | Free | Tool use, 150+ models |
| OpenAI | Paid | GPT-4o quality |
| OpenRouter | Paid | 100+ models marketplace |
| Claude SDK | Paid* | Full agent with tool use |
*Claude SDK requires a Claude Max subscription ($20/mo) or Anthropic API access. The setup wizard checks this automatically.
Alternative Installation
One-line install script (Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/alvbln/Alvin-Bot/main/install.sh | bashDownloads, builds, and runs the setup wizard automatically.
Desktop App (macOS)
| Platform | Download | Architecture |
|---|---|---|
| macOS | DMG | Apple Silicon (M1+) |
| Windows | Coming soon | x64 |
| Linux | Coming soon | x64 |
The desktop app auto-starts the bot and provides a system tray icon with quick controls.
Docker
git clone https://github.com/alvbln/Alvin-Bot.git
cd Alvin-Bot
cp .env.example .env # Edit with your tokens
docker compose up -dNote: Claude SDK is not compatible with Docker (requires interactive CLI login).
From Source (contributors)
git clone https://github.com/alvbln/Alvin-Bot.git
cd Alvin-Bot
npm install
npm run build
node bin/cli.js setup # Interactive wizard
npm run dev # Start in dev modeProduction (PM2)
npm install -g pm2
pm2 start ecosystem.config.cjs
pm2 save && pm2 startupTroubleshooting
alvin-bot doctor # Check configuration & validate connectionsIf your AI provider isn't working, run doctor β it tests the actual API connection and shows exactly what's wrong.
π Commands
| Command | Description |
|---|---|
/help |
Show all commands |
/start |
Session status overview |
/new |
Fresh conversation (reset context) |
/model |
Switch AI model (inline keyboard) |
/effort <low|medium|high|max> |
Set thinking depth |
/voice |
Toggle voice replies |
/imagine <prompt> |
Generate images |
/web <query> |
Search the web |
/remind <time> <text> |
Set reminders (e.g., /remind 30m Call mom) |
/cron |
Manage scheduled tasks |
/recall <query> |
Search memory |
/remember <text> |
Save to memory |
/export |
Export conversation |
/dir <path> |
Change working directory |
/status |
Current session & cost info |
/setup |
Configure API keys & platforms |
/system <prompt> |
Set custom system prompt |
/fallback |
View & reorder provider fallback chain |
/skills |
List available skills & their triggers |
/lang <de|en|auto> |
Set or auto-detect response language |
/cancel |
Abort running request |
/reload |
Hot-reload personality (SOUL.md) |
ποΈ Architecture
ββββββββββββββββ
β Web UI β (Dashboard, Chat, Settings)
ββββββββ¬ββββββββ
β HTTP/WS
ββββββββββββ ββββββββββββ β ββββββββββββ ββββββββββββ
β Telegram β β WhatsApp β β β Discord β β Signal β
ββββββ¬ββββββ ββββββ¬ββββββ β ββββββ¬ββββββ ββββββ¬ββββββ
β β β β β
βββββββββββββββ΄ββββββββ΄βββββββ΄βββββββββββββββ
β
ββββββββ΄ββββββββ
β Engine β (Query routing, fallback)
ββββββββ¬ββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
β β β
ββββββββ΄βββββββ βββββββ΄βββββββ ββββββββ΄βββββββ
β Claude SDK β β OpenAI β β Custom β
β (full agent)β β Compatible β β Models β
βββββββββββββββ ββββββββββββββ βββββββββββββββProvider Types
| Provider | Tool Use | Streaming | Vision | Auth |
|---|---|---|---|---|
| Claude SDK | β Full (native Bash, Read, Write, Web) | β | β | Claude CLI (OAuth) |
| OpenAI, Groq, Gemini | β Full (Shell, Files, Python, Web) | β | Varies | API Key |
| NVIDIA NIM | β Full (Shell, Files, Python, Web) | β | Varies | API Key (free) |
| OpenRouter | β Full (Shell, Files, Python, Web) | β | β | API Key |
| Other OpenAI-compatible | β‘ Auto-detect | β | Varies | API Key |
Universal Tool Use: Alvin Bot gives full agent capabilities to any provider that supports function calling β not just Claude. Shell commands, file operations, Python execution, web search, and more work across all major providers. If a provider doesn't support tool calls, Alvin Bot automatically falls back to text-only chat mode.
Project Structure
alvin-bot/
βββ src/
β βββ index.ts # Entry point
β βββ engine.ts # Multi-model query engine
β βββ config.ts # Configuration
β βββ handlers/ # Message & command handlers
β βββ middleware/ # Auth & access control
β βββ platforms/ # Telegram, WhatsApp, Discord, Signal adapters
β βββ providers/ # AI provider implementations
β βββ services/ # Memory, voice, cron, plugins, tool discovery
β βββ tui/ # Terminal UI
β βββ web/ # Web server, APIs, setup wizard
βββ web/public/ # Web UI (HTML/CSS/JS, zero build step)
βββ plugins/ # Plugin directory (6 built-in)
βββ docs/
β βββ custom-models.json # Custom model configurations
βββ TOOLS.md # Custom tool definitions (Markdown)
βββ SOUL.md # Agent personality
βββ bin/cli.js # CLI entry point
βββ ecosystem.config.cjs # PM2 configurationβοΈ Configuration
Environment Variables
# Required
BOT_TOKEN=<Telegram Bot Token>
ALLOWED_USERS=<comma-separated Telegram user IDs>
# AI Providers (at least one needed)
# Claude SDK uses CLI auth β no key needed
GROQ_API_KEY=<key> # Groq (voice + fast models)
NVIDIA_API_KEY=<key> # NVIDIA NIM models
GOOGLE_API_KEY=<key> # Gemini + image generation
OPENAI_API_KEY=<key> # OpenAI models
OPENROUTER_API_KEY=<key> # OpenRouter (100+ models)
# Provider Selection
PRIMARY_PROVIDER=claude-sdk # Primary AI provider
FALLBACK_PROVIDERS=nvidia-kimi-k2.5,nvidia-llama-3.3-70b
# Optional Platforms
WHATSAPP_ENABLED=true # Enable WhatsApp (needs Chrome)
DISCORD_TOKEN=<token> # Enable Discord
SIGNAL_API_URL=<url> # Signal REST API URL
SIGNAL_NUMBER=<number> # Signal phone number
# Optional
WORKING_DIR=~ # Default working directory
MAX_BUDGET_USD=5.0 # Cost limit per session
WEB_PORT=3100 # Web UI port
WEB_PASSWORD=<password> # Web UI auth (optional)
CHROME_PATH=/path/to/chrome # Custom Chrome path (for WhatsApp)Custom Models
Add any OpenAI-compatible model via docs/custom-models.json:
[
{
"key": "my-local-llama",
"name": "Local Llama 3",
"model": "llama-3",
"baseUrl": "http://localhost:11434/v1",
"apiKeyEnv": "OLLAMA_API_KEY",
"supportsVision": false,
"supportsStreaming": true
}
]Personality
Edit SOUL.md to customize the bot's personality. Changes apply on /reload or bot restart.
WhatsApp Setup
WhatsApp uses whatsapp-web.js β the bot runs as your own WhatsApp account (not a separate business account). Chrome/Chromium is required.
1. Enable WhatsApp
Set WHATSAPP_ENABLED=true in .env (or toggle via Web UI β Platforms β WhatsApp). Restart the bot.
2. Scan QR Code
On first start, a QR code appears in the terminal (and in the Web UI). Scan it with WhatsApp on your phone (Settings β Linked Devices β Link a Device). The session persists across restarts.
3. Chat Modes
| Mode | Env Variable | Description |
|---|---|---|
| Self-Chat | (always on) | Send yourself messages β bot responds. Your AI notepad. |
| Groups | WHATSAPP_ALLOW_GROUPS=true |
Bot responds in whitelisted groups. |
| DMs | WHATSAPP_ALLOW_DMS=true |
Bot responds to private messages from others. |
| Self-Chat Only | WHATSAPP_SELF_CHAT_ONLY=true |
Disables groups and DMs β only self-chat works. |
All toggles are also available in the Web UI (Platforms β WhatsApp). Changes apply instantly β no restart needed.
4. Group Whitelist
Groups must be explicitly enabled. In the Web UI β Platforms β WhatsApp β Group Management:
- Enable a group to let the bot listen
- Allowed Contacts β Select who can trigger the bot (empty = everyone)
- @ Mention Required β Bot only responds when mentioned (voice/media bypass this)
- Process Media β Allow photos, documents, audio, video
- Approval Required β Owner must approve each message via Telegram before the bot responds. Group members see nothing β completely transparent.
Note: Your own messages in groups are never processed (you ARE the bot on WhatsApp). The bot only responds to other participants. In self-chat, your messages are always processed normally.
5. Approval Flow (when enabled per group)
- Someone writes in a whitelisted group
- You get a Telegram notification with the message preview + β Approve / β Deny buttons
- Approve β bot processes and responds in WhatsApp. Deny β silently dropped.
- Fallback channels if Telegram is unavailable: WhatsApp self-chat β Discord β Signal
- Unapproved messages expire after 30 minutes.
π Plugins
Built-in plugins in plugins/:
| Plugin | Description |
|---|---|
| weather | Current weather & forecasts |
| finance | Stock prices & crypto |
| notes | Personal note-taking |
| calendar | Calendar integration |
| Email management | |
| smarthome | Smart home control |
Plugins are auto-loaded at startup. Create your own by adding a directory with an index.js exporting a PluginDefinition.
π― Skills
Built-in skills in skills/:
| Skill | Triggers | Description |
|---|---|---|
| code-project | code, build, implement, debug, refactor | Software development workflows, architecture patterns |
| data-analysis | analyze, chart, csv, excel, statistics | Data processing, visualization, statistical analysis |
| document-creation | document, report, letter, pdf, write | Professional document creation and formatting |
| email-summary | email, inbox, unread, newsletter | Email triage, summarization, priority sorting |
| system-admin | server, deploy, docker, nginx, ssl | DevOps, deployment, system administration |
| web-research | research, compare, find, review | Deep web research with source verification |
Skills activate automatically when your message matches their trigger keywords. The skill's SKILL.md content is injected into the system prompt, giving the agent specialized expertise for that task.
π οΈ CLI
alvin-bot setup # Interactive setup wizard
alvin-bot tui # Terminal chat UI β¨
alvin-bot chat # Alias for tui
alvin-bot doctor # Health check
alvin-bot update # Pull latest & rebuild
alvin-bot start # Start the bot
alvin-bot version # Show versionπΊοΈ Roadmap
- Phase 1 β Multi-Model Engine (provider abstraction, fallback chains)
- Phase 2 β Memory System (vector search, user profiles, smart context)
- Phase 3 β Rich Interactions (video messages, browser automation, email)
- Phase 4 β Plugins & Tools (plugin ecosystem, MCP client, custom tools)
- Phase 5 β CLI Installer (setup wizard, Docker, health check)
- Phase 6 β Web Dashboard (chat, settings, file manager, terminal)
- Phase 7 β Multi-Platform (Telegram, Discord, WhatsApp, Signal adapters)
- Phase 8 β Universal Tool Use (NEW) β All providers get agent powers:
- β Shell execution, file read/write/edit, directory listing
- β Python execution (Excel, PDF, charts, data processing)
- β Web fetch & search
- β Auto-detect function calling support per provider
- β Graceful fallback to text-only for providers without tool support
- Phase 9 β Skill System + Self-Awareness + Language Adaptation:
- β SKILL.md files for specialized domain knowledge (email, data analysis, code, docs, research, sysadmin)
- β Auto-matching: skill triggers activate contextual expertise on demand
- β Self-Awareness Core: agent knows it IS the AI (no external LLM calls for text tasks)
- β Automatic language detection and adaptation (EN default, learns user preference)
- β Human-readable cron schedules + visual schedule builder in WebUI
- β Platform Manager refactor: all adapters via unified registration system
- β Cron notifications for all platforms (Telegram, WhatsApp, Discord, Signal)
- β PM2 auto-refresh on Maintenance page
- β WhatsApp group whitelist with per-contact access control
- β Owner approval gate (Telegram β WhatsApp DM β Discord β Signal fallback)
- β Full media processing: photos, documents, audio/voice, video across all platforms
- β File Browser: create, edit, delete files with safety guards
- β Git history sanitized (personal data removed via git-filter-repo)
- Phase 10 β Anthropic API Provider + WebUI Provider Management
- Anthropic API key test case in WebUI (validation endpoint)
- "Add Provider" flow in WebUI β add new providers post-setup without editing
.env - Claude SDK guided setup from WebUI (install check, login status, step-by-step)
-
.env.exampleupdate withANTHROPIC_API_KEY
- Phase 11 β WebUI Professional Redesign
- Replace emoji icons with Lucide SVG icons (60+ icons, sidebar, pages, buttons)
- i18n framework (
i18n.js) β bilingual DE/EN with browser-locale detection (~400 keys) - Language toggle in sidebar footer (DE | EN)
- Typography upgrade (Inter webfont via Google Fonts)
- Gradient accents + subtle glassmorphism on cards
- Smooth page transitions (fade animation on page switch)
- Skeleton loading states + status pulse animations
- Command Palette (Cmd+K / Ctrl+K) with fuzzy search
- Phase 12 β Native Installers (Non-Techie Friendly)
- Electron wrapper (embedded Node.js + WebUI + tray icon)
- macOS
.dmgbuild via electron-builder (arm64) - Windows
.exe(NSIS) via electron-builder - Linux
.AppImage+.debvia electron-builder - Auto-update mechanism (electron-updater)
- GUI Setup Wizard (provider selection, Telegram token, first-run experience)
- Homebrew formula (
brew install alvin-bot) - Scoop manifest for Windows
- One-line install script
- Docker Compose polish (production-ready
docker-compose.yml)
- Phase 13 β npm publish (security audit)
π Security
- User whitelist β Only
ALLOWED_USERScan interact with the bot - WhatsApp group approval β Per-group participant whitelist + owner approval gate via Telegram (with WhatsApp DM / Discord / Signal fallback). Group members never see the approval process.
- Self-hosted β Your data stays on your machine
- No telemetry β Zero tracking, zero analytics, zero phone-home
- Web UI auth β Optional password protection for the dashboard
- Owner protection β Owner account cannot be deleted via UI
π License
MIT β See LICENSE.
π€ Contributing
Issues and PRs welcome! Please read the existing code style before contributing.
git clone https://github.com/alvbln/Alvin-Bot.git
cd alvin-bot
npm install
npm run dev # Development with hot reload




















