JSPM

alvin-bot

4.4.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2193
  • Score
    100M100P100Q121069F
  • License MIT

Alvin Bot β€” Your personal AI agent on Telegram, WhatsApp, Discord, Signal, and Web.

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 start

That'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 | bash

Downloads, 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 -d

Note: 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 mode
Production (PM2)
npm install -g pm2
pm2 start ecosystem.config.cjs
pm2 save && pm2 startup

Troubleshooting

alvin-bot doctor        # Check configuration & validate connections

If 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)

  1. Someone writes in a whitelisted group
  2. You get a Telegram notification with the message preview + βœ… Approve / ❌ Deny buttons
  3. Approve β†’ bot processes and responds in WhatsApp. Deny β†’ silently dropped.
  4. Fallback channels if Telegram is unavailable: WhatsApp self-chat β†’ Discord β†’ Signal
  5. 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 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.example update with ANTHROPIC_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 .dmg build via electron-builder (arm64)
    • Windows .exe (NSIS) via electron-builder
    • Linux .AppImage + .deb via 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_USERS can 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