Skip to content

A Telegram bot that enables you to interact with Kilo CLI directly from Telegram. Send coding tasks, manage workspaces, and use Kilo's AI capabilities through a familiar chat interface.

License

Notifications You must be signed in to change notification settings

rosettascript/telegram-bot-using-kilo-cli-free

Repository files navigation

Rosetta - Telegram → Kilo Bridge

A Telegram bot (@rosetta_telebot) that allows you to interact with Kilo CLI directly from Telegram.

Bot Info

  • Name: Rosetta
  • Username: @rosetta_telebot
  • Purpose: Bridge between Telegram and Kilo CLI for coding assistance

Features

  • Text Messages: Send coding tasks to Kilo and get responses
  • Session Management: Conversations are persisted per chat
  • Workspace Control: Set custom workspace directories
  • Commands: /start, /help, /reset, /workspace, /status, /continue
  • Long Response Handling: Automatically splits messages exceeding Telegram's limit
  • Markdown Support: Code blocks are properly formatted

Commands

Command Description
/start Initialize the bot
/help Show help message
/reset Clear session and start fresh
/workspace [path] Set workspace directory (leave empty to see current)
/status Show current session info
/continue Continue with previous session

Setup

1. Install Dependencies

npm install

2. Configure Environment

Copy .env.example to .env and add your Telegram bot token:

cp .env.example .env

Edit .env:

TELEGRAM_BOT_TOKEN=your_bot_token_here
KILO_DEFAULT_WORKSPACE=/path/to/your/projects

3. Build

npm run build

4. Run

npm start

Or for development with hot reload:

npm run dev

Configuration

Variable Description Default
TELEGRAM_BOT_TOKEN Telegram bot token Required
KILO_DEFAULT_WORKSPACE Default workspace directory Current directory
KILO_AUTO_APPROVE Auto-approve Kilo permissions true
KILO_TIMEOUT Timeout for Kilo commands (seconds) 120
BOT_ALLOW_USERS Comma-separated list of allowed user IDs All users
BOT_ALLOW_CHATS Comma-separated list of allowed chat IDs All chats
LOG_LEVEL Logging level (debug, info, warn, error) info

Project Structure

telegram-kilo-bridge/
├── src/
│   ├── config/                 # Configuration directory
│   ├── kilo/                   # Kilo integration directory
│   ├── telegram/               # Telegram directory
│   ├── types/                  # TypeScript types
│   ├── utils/                  # Utility functions
│   ├── index.ts                # Entry point
│   ├── inline-test.ts          # Inline tests
│   └── simplified.ts           # Simplified implementation
├── tests/
│   └── unit.test.ts
├── package.json
├── tsconfig.json
├── jest.config.js
└── TELEGRAM_KILO_BRIDGE_PLAN.md

Development

# Install dependencies
npm install

# Run in development mode (with hot reload)
npm run dev

# Build for production
npm run build

# Run tests
npm test

# Run production build
npm start

Deployment

Option 1: Local with ngrok (Testing)

npm run dev
ngrok http 3000

Option 2: Railway/Render (Recommended)

  1. Connect your GitHub repository
  2. Set environment variables in the dashboard
  3. Deploy

Option 3: VPS

npm run build
npm start

Use a process manager like pm2:

pm2 start dist/index.js --name telegram-kilo-bridge

Requirements

  • Node.js 18+
  • Kilo CLI installed (npm install -g @kilocode/cli)
  • Telegram bot token (get from @BotFather)

License

MIT

About

A Telegram bot that enables you to interact with Kilo CLI directly from Telegram. Send coding tasks, manage workspaces, and use Kilo's AI capabilities through a familiar chat interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published