Use the Telegram CLI from KosmoKrator to call Telegram tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Telegram can be configured headlessly with `kosmokrator integrations:configure telegram`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure telegram --set access_token="$TELEGRAM_ACCESS_TOKEN" --enable --read allow --write ask --jsonkosmokrator integrations:doctor telegram --jsonkosmokrator integrations:status --json
Credentials
Authentication type: Bearer tokenbearer_token. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
access_token
TELEGRAM_ACCESS_TOKEN
Secret secret
yes
Bot Token
url
TELEGRAM_URL
URL url
no
API Base URL
Call Telegram Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Telegram.
telegram.telegram_send_message
Write write
Send a text message to a Telegram chat. Provide the chat_id and message text. The chat_id can be a numeric ID or @channelusername. Supports optional parse_mode (Markdown, MarkdownV2, HTML) and other formatting options.
Get incoming updates (messages, callback queries, inline queries, etc.) for the Telegram bot. Use offset to acknowledge previously received updates. Returns an array of update objects.
List recent chats the bot has interacted with. Since Telegram Bot API does not have a native list-chats endpoint, this fetches recent updates and extracts unique chats. Returns chat IDs, types, and titles.
Use these parameter tables when building CLI payloads without calling integrations:schema first.
telegram.telegram_send_message
Send a text message to a Telegram chat. Provide the chat_id and message text. The chat_id can be a numeric ID or @channelusername. Supports optional parse_mode (Markdown, MarkdownV2, HTML) and other formatting options.
Unique identifier for the target chat or @username of the target channel.
text
string
yes
Text of the message to send.
parse_mode
string
no
Parse mode for the message: Markdown, MarkdownV2, or HTML.
reply_to_message_id
integer
no
If the message is a reply, ID of the original message.
disable_notification
boolean
no
Send the message silently. Default: false.
telegram.telegram_list_updates
Get incoming updates (messages, callback queries, inline queries, etc.) for the Telegram bot. Use offset to acknowledge previously received updates. Returns an array of update objects.
List recent chats the bot has interacted with. Since Telegram Bot API does not have a native list-chats endpoint, this fetches recent updates and extracts unique chats. Returns chat IDs, types, and titles.
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.