A GitHub Copilot CLI extension that bridges Telegram messages bidirectionally with a CLI session -- send messages from Telegram, get agent responses back.
- GitHub Copilot CLI installed and working
- Extensions enabled (experimental feature -- run
/experimental on) - A Telegram account
- Node.js 18+ (the extension uses the built-in
fetchAPI)
- In Copilot CLI, run:
/plugin install examon/copilot-cli-telegram-bridge - Restart Copilot CLI
- Run the install skill to copy the extension into place:
/copilot-cli-telegram-bridge:telegram-install - Restart Copilot CLI again (the extension loads on startup)
- Clone the repo and copy the extension file:
git clone https://github.com/examon/copilot-cli-telegram-bridge.git mkdir -p ~/.copilot/extensions/copilot-cli-telegram-bridge cp copilot-cli-telegram-bridge/extension.mjs ~/.copilot/extensions/copilot-cli-telegram-bridge/
- Restart Copilot CLI
- Open Telegram and search for @BotFather
- Send
/newbot - Choose a display name and a username (must end in
bot) - BotFather replies with a token like
123456789:ABCdefGHI...-- copy it
- Register the bot in Copilot CLI:
/telegram setup mybot - Paste the bot token when prompted -- the extension validates it against the Telegram API
- Connect to the bot:
/telegram connect mybot - Open Telegram and send any message to your bot
- The bot replies asking you to check the Copilot CLI terminal for a pairing code
- Type the 6-character pairing code back to the bot in Telegram (case-insensitive, expires after 5 minutes)
- Done -- messages now flow both ways between Telegram and your CLI session
| Command | Description |
|---|---|
/telegram setup <name> |
Register a new bot with a local alias |
/telegram connect <name> |
Connect this session to the named bot |
/telegram connect |
List all registered bots with their status |
/telegram disconnect |
Disconnect from the current bot |
/telegram status |
Show all bots, availability, and paired users |
/telegram remove <name> |
Remove a bot from the registry |
You can register as many bots as you want with /telegram setup. Each Copilot CLI session connects to one bot at a time, but multiple sessions can run different bots simultaneously.
If a new session connects to a bot that another session already holds, the new session takes over and the old one releases gracefully.
Access control is shared -- pairing with any bot grants access to all bots managed by this extension.
- Extension not loading -- make sure you enabled the EXTENSIONS feature flag (
/experimentalin the CLI). Then verify the file exists at~/.copilot/extensions/copilot-cli-telegram-bridge/extension.mjs - Bot not responding -- check that the token is valid. Try
/telegram disconnectthen/telegram connectagain - Pairing code expired -- codes expire after 5 minutes. Send a new message to the bot to get a fresh one
- "Another session has this bot" -- the bot is locked by another CLI session. Connecting again takes it over
Bot tokens are stored in plain text in bots.json (with restricted file permissions -- owner read/write only). Anyone with read access to that file can control your bot. Keep this in mind:
- Do not commit
bots.jsonto version control - Do not share or back up the extension directory without removing
bots.jsonfirst - If a token is compromised, revoke it immediately via @BotFather (
/revoke) and register a new one with/telegram setup
- Disconnect if connected:
/telegram disconnect - Remove the extension:
rm -rf ~/.copilot/extensions/copilot-cli-telegram-bridge - If installed via plugin:
/plugin uninstall copilot-cli-telegram-bridge