Skip to content

ismailperim/oncallmate

🚨 OnCallMate

Your AI on-call assistant for Docker operations

Open-source, self-hosted AI agent that helps you manage Docker infrastructure through natural language commands via Telegram.

Never miss an incident. Your on-call buddy is always watching. 🚨


πŸ”’ Security & Trust

Why trust an AI with your infrastructure?

OnCallMate is built security-first for on-premise deployment:

  • βœ… 100% Self-Hosted - Runs entirely in your network, no cloud dependency
  • βœ… Docker Socket Proxy - Never exposes /var/run/docker.sock directly (read-only by default)
  • βœ… Zero Telemetry - Your container data never leaves your infrastructure
  • βœ… Admin Allowlist - Telegram ID-based access control (no public access)
  • βœ… Full Audit Trail - Every AI decision logged to SQLite with timestamp/user/action
  • βœ… AI Provider Choice - You control what data is sent to which AI (OpenAI/Claude/local)
  • βœ… Open Source - MIT license, audit the code yourself

Default security posture:

  • Docker operations: Read-only (list, inspect, logs, stats)
  • Write operations: Disabled (require explicit opt-in)
  • Network: Isolated (containers on private bridge network)

✨ Features

  • 🐳 Docker Operations - List, inspect, logs, stats, system info
  • πŸ€– AI-Powered - Natural language understanding (Claude, GPT, Gemini)
  • πŸ’¬ Telegram Interface - Control from anywhere, anytime
  • πŸ”’ Security First - Docker socket proxy, audit logs, admin-only access
  • πŸ“Š Audit Trail - All operations logged to SQLite
  • πŸ”Œ Extensible - Plugin architecture for providers & channels
  • ⏱️ Proactive Scheduler - Periodic container checks + anomaly alerts
  • 🧠 Self-Learning Baseline - Learns normal running-container profile over time
  • 🧩 Configurable Prompts - Prompts are stored in prompts/*.md (not hard-coded)
  • πŸ†“ Free AI Options - Multiple AI providers including free tiers (OpenRouter!)

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Telegram Bot Token (create one)
  • AI Provider API Key (choose one):

Installation

  1. Clone the repo
git clone https://github.com/ismailperim/oncallmate.git
cd oncallmate
  1. Configure environment
cp .env.quickstart .env
nano .env

Fill in your credentials:

TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_ADMIN_IDS=123456789

# Use OpenRouter for FREE tier
AI_PROVIDER=openrouter
OPENROUTER_API_KEY=sk-or-your-key-here
OPENROUTER_MODEL=google/gemini-flash-1.5

# Proactive mode
MAIN_CONTACT_ID=123456789
LEARN_MODE_ENABLED=true
LEARN_INTERVAL_MINUTES=15

πŸ’‘ Tip: OpenRouter offers FREE models! See PROVIDERS.md for all options.

  1. Start the agent
docker-compose up -d
  1. Test it - Open Telegram and message your bot:
/start
/ps

πŸŽ‰ Done! You're now managing Docker via AI chat.


πŸ“– Usage

Commands

/start  - Welcome message
/help   - Show all commands
/ps     - List containers
/logs <container> - Show container logs
/stats <container> - Container statistics
/inspect <container> - Detailed container info
/images - List Docker images
/info   - Docker system info
/health - Agent health check

Natural Language

Just ask naturally:

  • "Show me running containers"
  • "What's using the most CPU?"
  • "Get the last 50 lines of logs from nginx"
  • "List all images"
  • "What's the system memory usage?"

πŸ—οΈ Architecture

OnCallMate
β”œβ”€β”€ Core
β”‚   β”œβ”€β”€ Agent Engine (AI intent parsing)
β”‚   β”œβ”€β”€ Database (audit + memory)
β”‚   └── Logger
β”œβ”€β”€ Providers (pluggable infrastructure adapters)
β”‚   β”œβ”€β”€ Docker βœ…
β”‚   β”œβ”€β”€ Docker Swarm 🚧
β”‚   β”œβ”€β”€ Kubernetes 🚧
β”‚   └── AWS ECS 🚧
β”œβ”€β”€ Channels (communication interfaces)
β”‚   β”œβ”€β”€ Telegram βœ…
β”‚   β”œβ”€β”€ Slack 🚧
β”‚   β”œβ”€β”€ Discord 🚧
β”‚   └── Webhooks 🚧
└── AI Providers (multiple backends)
    β”œβ”€β”€ OpenRouter βœ… (FREE!)
    β”œβ”€β”€ Anthropic Claude βœ…
    └── OpenAI GPT βœ…

See PROVIDERS.md for AI provider comparison.


πŸ”’ Security

Production Deployment

⚠️ Never expose /var/run/docker.sock directly in production!

OnCallMate includes docker-socket-proxy by default:

  • βœ… Read-only by default
  • βœ… Allowlist-based API filtering
  • βœ… Isolated network

To enable write operations (start/stop), edit docker-compose.yml:

socket-proxy:
  environment:
    - POST=1  # Enable container start/stop
    - DELETE=0  # Keep delete disabled

Admin Access

Only Telegram users in TELEGRAM_ADMIN_IDS can control the agent.

Audit Logs

All operations are logged to /data/oncallmate.db:

  • Who requested what
  • When and from where
  • Result and approval status

Query audit logs:

docker exec -it oncallmate sqlite3 /data/oncallmate.db \
  "SELECT * FROM audit_logs ORDER BY timestamp DESC LIMIT 10;"

🧩 Development

Local Development

npm install
npm run dev

Build for Production

npm run build
npm start

Adding a Provider

  1. Create src/providers/your-provider.ts
  2. Implement the Provider interface
  3. Register in src/index.ts

Example: Docker Provider

Adding a Channel

  1. Create src/channels/your-channel.ts
  2. Implement the Channel interface
  3. Register in src/index.ts

Example: Telegram Channel


πŸ—ΊοΈ Roadmap

  • v0.2 - Docker Swarm support + approval workflow
  • v0.3 - Proactive learning mode (anomaly detection, scheduled checks)
  • v0.4 - Kubernetes provider
  • v0.5 - Slack & Discord channels
  • v0.6 - RBAC + multi-host support
  • v1.0 - Production-ready release

Roadmap details are maintained internally during private incubation.


πŸ’° Pricing

OnCallMate is 100% free and open-source (MIT License).

AI Provider Costs (per 1000 queries):

Provider Model Cost Quality
OpenRouter gemini-flash-1.5 $0 (FREE/low-cost depending on route) ⭐⭐⭐
OpenAI gpt-4o-mini ~$0.20 ⭐⭐⭐⭐
Anthropic claude-sonnet-4 ~$4.50 ⭐⭐⭐⭐⭐

See PROVIDERS.md for detailed pricing.


πŸ“š Documentation


🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a PR.


πŸ“„ License

MIT License - see LICENSE


πŸ™ Credits

Built with:


Made with πŸ’™ by @ismailperim

OnCallMate - Your AI on-call assistant. Because incidents don't wait for business hours. 🚨

About

🚨 Autonomous AI SRE agent that investigates Docker incidents while you sleep. No more 3am log diving. Self-hosted, security-first, open source.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 

Contributors