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.