Devin AI — Telegram Bot is a self-hosted TypeScript integration that brings Devin AI into Telegram. Start a session from chat commands, continue the conversation in the same chat, and keep active session state persisted in PostgreSQL for restart recovery.
Deploy your own copy and support the project. 💖
- Telegram Commands —
/devin,/reply,/stop,/sessions,/template - In-Chat Continuation — Non-command text in a chat with an active session is forwarded to Devin
- Adaptive Polling — Fast updates during early activity, then slower polling
- Template Prompts — Built-in templates for common tasks
- PR Notifications — Shares pull request URLs from Devin sessions
- Restart Recovery — Active session state survives restarts via PostgreSQL
- Customizable Bot Name — Set
BOT_NAMEto customize user-facing bot text - Self-Hosted — Full control of runtime and deployment
| Layer | Technology |
|---|---|
| Language | TypeScript 5.8+ |
| Runtime | Node.js 22+ |
| Framework | Telegraf v4 |
| Toolchain | Bun |
| Linter | Biome |
| Testing | Bun Test |
| Storage | PostgreSQL (pg) |
- Node.js 22+
- Bun 1.0+
- A Telegram bot token from @BotFather
- A Devin API key (starts with
apk_orcog_) - PostgreSQL 14+ (for session persistence and restart recovery)
git clone https://github.com/wgtechlabs/devin-telegram-bot.git
cd devin-telegram-bot
bun installcp .env.example .envEdit .env with your credentials:
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
DATABASE_URL=postgres://postgres:postgres@localhost:5432/devin_telegram_bot
DEVIN_API_KEY=apk_your_devin_api_key_here
# Required when DEVIN_API_KEY starts with cog_
# DEVIN_ORG_ID=org_your_org_id_here
# Optional
# BOT_NAME=Devin
LOG_LEVEL=info# Development (watch mode)
bun run dev
# Production
bun run build
bun run start| Command | Description |
|---|---|
/devin <task> |
Start a new Devin session |
/reply <message> |
Send a follow-up message to the active session |
/stop |
Terminate the active session in the chat |
/sessions |
List all active tracked sessions |
/template <id> <details> |
Start a session from a pre-built template |
| Template ID | Description |
|---|---|
open-pr |
Write code and open a pull request |
code-review |
Review an existing pull request |
write-tests |
Add test coverage |
fix-bug |
Investigate and fix a bug |
src/
├── index.ts
├── config.ts
├── commands/
│ ├── index.ts
│ ├── devin.ts
│ ├── devin-reply.ts
│ ├── devin-stop.ts
│ ├── devin-sessions.ts
│ └── devin-template.ts
├── handlers/
│ └── message.ts
├── services/
│ ├── devin-api.ts
│ ├── logger.ts
│ ├── session-manager.ts
│ └── state-store.ts
├── templates/
│ └── index.ts
└── types/
└── index.ts
bun run lint
bun run typecheck
bun test
bun run buildThis project follows Clean Flow, Clean Commit, and Clean Labels conventions.
- Branches:
main(stable) +dev(integration) + feature branches - Branch Naming: Use
feature/*,fix/*,docs/*,chore/*,test/*,refactor/* - Merge Strategy:
feature/*,fix/*,docs/*,chore/*,test/*,refactor/*squash-merge intodev,devmerges intomain - Commit Format:
<emoji> <type>: <description>(see Clean Commit) - Labels: 21 standardized labels across 5 categories (see Clean Labels)
Join our community discussions to get help, share ideas, and connect with other users:
- 📣 Announcements: Official updates from the maintainer
- 📸 Showcase: Show and tell your implementation
- 💖 Wall of Love: Share your experience with the bot
- 🛟 Help & Support: Get assistance from the community
- 🧠 Ideas: Suggest new features and improvements
Need help? Check our Help & Support discussions or create a new issue.
Important: Submit pull requests to the dev branch following the repository workflow.
Contributions are welcome! Your code must pass bun run typecheck before merging.
Like this project? Leave a star! ⭐⭐⭐⭐⭐
There are several ways you can support this project:
- Become a sponsor and get some perks! 💖
- Buy us a coffee if you love what we do! ☕
Found this project helpful? Consider nominating me (@warengonzaga) for the GitHub Star program! This recognition supports ongoing development of this project and my other open-source projects. GitHub Stars are recognized for their significant contributions to the developer community — your nomination makes a difference and encourages continued innovation!
This project is licensed under GPL-3.0-or-later.
This project is created by Waren Gonzaga under WG Technology Labs, with the help of awesome contributors.
💻💖☕ by Waren Gonzaga | YHWH 🙏 - Without Him, none of this exists, even me.