A Python service that bridges Telegram with Kiro CLI, maintaining persistent conversation context.
- Persistent Session: Maintains a single Kiro CLI session across all messages
- Auto Tool Trust: Automatically trusts all tools to avoid prompts
- Clean Output: Strips ANSI escape codes for Telegram compatibility
- User Filtering: Only responds to authorized user (configurable)
- Error Handling: Robust error handling and automatic recovery
- Progress Updates: Shows typing indicators during processing
- Copy settings template and configure:
cp settings.ini.template settings.ini
# Edit settings.ini with your bot token and authorized user- Setup and run:
# Setup virtual environment and run tests
make setup
make test
# Run the bot
make run# Install and start service
make install
make service-start
# Check status and logs
make service-status
make service-logs
# Stop service
make service-stop- Persistent Kiro Session: Starts
kiro-cli chat --trust-all-toolsonce and keeps it running - Threaded I/O: Uses separate threads for input, output, and response processing
- Auto Tool Trust: Automatically trusts all tools using
/tools trust-allcommand and handles prompts - Smart Response Buffering: Accumulates output until prompt detected or timeout (3 seconds)
- Message Processing: Sends user messages to Kiro, captures and buffers responses
- Output Cleaning: Removes ANSI codes, filters prompts, and handles multi-line messages
- Timeout Handling: Automatically sends buffered responses after inactivity
- Telegram Integration: Uses python-telegram-bot library with thread-safe async messaging
- True Persistence: Single Kiro session maintains full context
- Better Performance: No process startup overhead per message
- Cleaner Output: Proper ANSI stripping and response filtering
- Error Recovery: Handles timeouts and connection issues
- Simpler Deployment: Single Python file, easy to manage as service
View logs with:
sudo journalctl -u telegram-kiro-bot -f