Communication
Telegram

Telegram CLI

Bot messages, groups, polls and notifications — pure REST

✓ 24 tests passed
Install
$ pip install cli-anything-telegram
About

Full Telegram Bot API access with zero extra dependencies beyond click. Send text, photos, documents, polls and location. Manage groups, pin messages, kick members and set Bot commands.

Bot APINotificationsZero Dependencies
Requirements
TELEGRAM_BOT_TOKEN (from @BotFather)
Command Reference
Command Arguments Description
detect Verify Bot token and get Bot info
schema Output full capability schema (no token needed)
send text CHAT_ID TEXT --parse-mode HTML|Markdown Send text message
send photo CHAT_ID PHOTO_URL --caption TEXT Send photo
send document CHAT_ID DOC_URL --caption TEXT Send document
send poll CHAT_ID QUESTION --option A --option B Create poll
send location CHAT_ID LAT LON Send location
chat info CHAT_ID Get chat/group details
chat pin CHAT_ID MESSAGE_ID Pin message
chat kick CHAT_ID USER_ID Kick member
updates get --limit N Get latest updates
bot set-commands --cmd cmd:desc ... Set Bot command menu
Usage Examples
# Install
$ pip install cli-anything-telegram

# Health check
$ telegram-cli detect

# Get capabilities schema (Agent-ready, no token needed)
$ telegram-cli schema

# Run with JSON output (for AI Agent integration)
$ telegram-cli --json detect

# Example JSON response:
{"message_id":42,"chat_id":"@mychannel","date":1710000000,"status":"sent"}
Agent Integration
# Python — call from AI Agent
import subprocess, json

result = subprocess.run(
    ["telegram-cli", "--json", "detect"],
    capture_output=True, text=True
)
data = json.loads(result.stdout)
print(data)

# Discover all commands without credentials:
schema = subprocess.run(
    ["telegram-cli", "schema"],
    capture_output=True, text=True
)
capabilities = json.loads(schema.stdout)