Telegram Coding Agent
Use OpenClaw as a mobile-first coding assistant through Telegram - code from anywhere, anytime.
One of the most powerful ways to use OpenClaw is through Telegram. This gives you a mobile-first AI coding assistant that you can interact with from your phone, tablet, or any device with Telegram installed.
Why Telegram?
Traditional coding requires sitting at a computer with an IDE open. But what if you could:
- Fix a bug while commuting on the train
- Review and merge PRs from your phone
- Deploy updates while away from your desk
- Brainstorm solutions during a walk
Telegram + OpenClaw makes this possible.
Setting Up the Telegram Bot
Prerequisites
- A running Clawdy instance
- A Telegram account
- The Telegram app (mobile or desktop)
Step 1: Get Your Bot Token
- Open Telegram and search for @BotFather
- Send
/newbotto create a new bot - Follow the prompts to name your bot
- Copy the API token you receive
Use this token to access the HTTP API:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Step 2: Configure OpenClaw
SSH into your instance or use the web terminal:
# Navigate to OpenClaw config
cd ~/openclaw
# Set your Telegram bot token
export TELEGRAM_BOT_TOKEN="your-token-here"
# Restart OpenClaw to apply
sudo systemctl restart openclaw
Or set it through the Clawdy dashboard under Settings > Environment Variables.
Step 3: Start Chatting
- Open Telegram
- Search for your bot by its username
- Click Start
- Send your first message!
You: Create a Python script that fetches weather data from an API
Bot: I'll create a weather fetching script for you...
Use Cases
Mobile Code Review
Review pull requests from your phone:
You: Show me the open PRs in my-project repo
Bot: Here are 3 open pull requests:
1. #42 - Add user authentication (by @alice)
2. #43 - Fix pagination bug (by @bob)
3. #44 - Update dependencies (by @dependabot)
You: Show me the diff for PR #42
Bot: Here's the diff for "Add user authentication":
[Shows code changes]
You: Looks good, merge it
Bot: PR #42 has been merged into main.
Quick Bug Fixes
Fix issues without opening your laptop:
You: There's a typo in src/utils/format.ts line 23,
"recieve" should be "receive"
Bot: I found the typo. Here's the fix:
- const recieve = (data) => {
+ const receive = (data) => {
Should I commit this change?
You: Yes, commit with message "fix: correct typo in format.ts"
Bot: Committed and pushed to main.
Deployment Management
Deploy and monitor from anywhere:
You: What's the status of the production deployment?
Bot: Production status:
- Last deploy: 2 hours ago
- Commit: abc123 "Add new feature"
- Health: All systems operational
- CPU: 23% | Memory: 45%
You: Deploy the staging branch to production
Bot: Starting deployment...
[Progress updates]
Deployment complete!
Learning and Exploration
Ask questions about your codebase:
You: How does the authentication middleware work?
Bot: The auth middleware in src/middleware/auth.ts:
1. Extracts JWT from Authorization header
2. Validates token signature
3. Decodes user payload
4. Attaches user to request context
Here's the relevant code:
[Shows code snippet]
Tips for Mobile Coding
Use Voice Messages
Telegram supports voice messages. Describe your request verbally:
- Hold the microphone button
- Describe what you need
- OpenClaw transcribes and responds
"Hey, can you add error handling to the user registration function and make sure it validates email format?"
Save Common Commands
Pin frequently used prompts or create a saved messages list:
- "Show git status"
- "Run the tests"
- "Deploy to staging"
- "Show recent errors"
Use Telegram's Features
- Reply to specific messages for context
- Forward code snippets from other chats
- Use inline formatting for code: `like this`
- Send files directly for OpenClaw to analyze
Security Considerations
Private Bot
Your Telegram bot is private by default. Only you can interact with it unless you:
- Share the bot username publicly
- Add others to the allowed users list
Sensitive Data
Be cautious about:
- Sending API keys or secrets via Telegram
- Committing credentials through the bot
- Sharing screenshots that include sensitive info
The bot runs on your private Clawdy instance, but Telegram messages pass through Telegram's servers.
Two-Factor Authentication
Enable 2FA on your Telegram account for additional security:
- Go to Settings > Privacy and Security
- Enable Two-Step Verification
- Set a strong password
Troubleshooting
Bot Not Responding
- Check that OpenClaw is running:
systemctl status openclaw - Verify the bot token is set correctly
- Check logs:
journalctl -u openclaw -f
Slow Responses
Mobile networks can have latency. If responses are slow:
- Wait for the "typing..." indicator
- Avoid sending multiple messages before receiving a response
- Check your internet connection
Rate Limits
Telegram has rate limits. If you're sending many messages:
- Wait a few seconds between messages
- Batch related requests into single messages
- Use the web interface for intensive sessions
Advanced Configuration
Allowed Users
Restrict who can use your bot:
# In OpenClaw config
TELEGRAM_ALLOWED_USERS="123456789,987654321"
Custom Commands
Add bot commands for quick access:
- Open @BotFather
- Send
/setcommands - Select your bot
- Add commands:
status - Show instance status
deploy - Deploy to production
logs - Show recent logs
help - Show available commands
Webhooks vs Polling
For faster responses, configure webhooks:
# Set webhook URL
TELEGRAM_WEBHOOK_URL="https://your-slug.clawdy.app/telegram/webhook"
Next Steps
- Quick Start - Set up your Clawdy instance
- Web Terminal - Access the full terminal when needed
- Dashboard Overview - Manage settings and configuration