npx claudepluginhub danizord/telecliTelegram Bot CLI integration for Claude Code with automatic polling
A thin, zero-dependency CLI wrapper around the Telegram Bot API. Built with Bun for speed and simplicity.
# Install globally via bun
bun add -g telecli
# Or install directly from GitHub
bun add -g github:danizord/telecli
After installation, configure your token once:
tg config token YOUR_BOT_TOKEN
Then use the tg command from anywhere:
tg me
git clone https://github.com/danizord/telecli.git
cd telecli
bun install
bun link # Makes 'tg' available globally
tg <command> [options]
# Get bot info
bun run tg me
# Poll for updates
bun run tg updates poll --timeout 30
# Send a message
bun run tg message send <chat_id> "Hello, World!"
# Send a photo
bun run tg media photo <chat_id> /path/to/photo.jpg
# Create a poll
bun run tg poll send <chat_id> "What's your favorite?" '["Option 1", "Option 2"]'
tg me # Get bot info
tg bot commands list # List bot commands
tg bot commands set <json> # Set bot commands
tg bot name get # Get bot name
tg bot description get # Get bot description
tg updates poll # Poll for updates
tg updates poll --timeout 30 # With long polling
tg updates poll --offset <n> # Resume from offset
tg updates webhook info # Get webhook info
tg updates webhook set <url> # Set webhook
tg message send <chat_id> <text> # Send message
tg message send <chat_id> <text> --parse-mode HTML
tg message reply <chat_id> <msg_id> <text> # Reply
tg message forward <chat_id> <from> <id> # Forward
tg message edit <chat_id> <msg_id> <text> # Edit
tg message delete <chat_id> <msg_id> # Delete
tg media photo <chat_id> <photo> # Photo (path, URL, or file_id)
tg media video <chat_id> <video> # Video
tg media audio <chat_id> <audio> # Audio
tg media document <chat_id> <file> # Document
tg media sticker <chat_id> <sticker> # Sticker
tg media photo <chat_id> <photo> --caption "Caption here"
tg chat info <chat_id> # Get chat info
tg chat admins <chat_id> # List admins
tg chat count <chat_id> # Member count
tg chat leave <chat_id> # Leave chat
tg member ban <chat_id> <user_id> # Ban user
tg member unban <chat_id> <user_id> # Unban user
tg member restrict <chat_id> <user_id> <json>
tg member promote <chat_id> <user_id> <json>
tg poll send <chat_id> "Question?" '["A", "B", "C"]'
tg poll send <chat_id> "Quiz?" '["A", "B"]' --quiz --correct 0
tg poll stop <chat_id> <msg_id>
tg forum create <chat_id> "Topic Name"
tg forum close <chat_id> <topic_id>
tg forum reopen <chat_id> <topic_id>
tg forum delete <chat_id> <topic_id>
tg reaction <chat_id> <msg_id> "👍"
tg pin <chat_id> <msg_id>
tg unpin <chat_id> <msg_id>
tg file info <file_id> # Get file info
tg file download <file_id> <path> # Download file
tg photos <user_id> # Get user profile photos
tg location <chat_id> <lat> <lon>
tg location <chat_id> <lat> <lon> --live 3600
tg contact <chat_id> "+1234567890" "John" "Doe"
tg dice <chat_id> 🎲
tg inline answer <query_id> <results_json>
tg callback answer <query_id> "Text"
tg callback answer <query_id> "Alert!" --alert
tg payment invoice <chat_id> "Title" "Desc" "payload" "USD" '[{"label":"Item","amount":1000}]'
tg payment stars # Get star transactions
All commands output JSON for easy parsing:
{"ok": true, "result": {...}}
Errors:
{"ok": false, "error": "description"}
Store your token once:
tg config token YOUR_BOT_TOKEN
The token is saved to ~/.telecli/config.json.
You can also use an environment variable:
export TELEGRAM_BOT_TOKEN="your_token_here"
The CLI checks the environment variable first, then falls back to the config file.
Getting a bot token:
/newbot and follow the prompts123456789:ABCdefGHIjklmNOpqrsTUVwxyz)This repo includes a Claude Code plugin that provides: