Telegram CLI
for cmdhub.
Telegram chats, messages, search, and safe send workflows.
cmdhub get telegram
data_object Agent Contract
Agents should start with auth/status and discovery commands, inspect schemas before composition, and treat commands marked as mutating as state-changing operations.
Output
Use human output for normal reads, `--json` for scripting or complete structured fields, and `--jsonl` for upstream pipe inputs.
Auth
private_session
Refs
Prefer list/search, then short refs or piped JSONL. Use `resolve` to inspect cached refs.
Schemas
Use `telegram schema` and `catalog.json` to inspect fields, flags, examples, and side effects.
terminal Command Reference
Generated from source. Global flags apply to all commands.
Global Flags
--json
bool
Emit JSON machine output--jsonl
bool
Emit JSONL records for piping--output, -o
string
Compatibility output mode: json|jsonl. Prefer --json or --jsonl--view
string = summary
View mode: summary|full--profile
string = default
Config/auth profile--config
string
Config path override--quiet, -q
bool
Suppress non-essential diagnostics--debug
bool
Enable debug diagnostics--limit
int = 50
Maximum items to emit--page-size
int = 50
Requested upstream page size--cursor
string
Continuation cursor--no-paginate
bool
Fetch only one page--version, -v
bool
Print version informationtelegram auth
Manage authenticationtelegram auth configure
Store Telegram API ID/hash for the selected profileStore the Telegram API ID and Telegram API hash from my.telegram.org/apps for the selected profile.
These are Telegram application credentials, not a normal Telegram account password, not a Bot API token, and not a session string.
--api-hash
string
Telegram API hash from my.telegram.org/apps--api-id
int
Telegram API ID from my.telegram.org/apps--phone
string
Telegram account phone number in international formattelegram auth continue
Continue an interrupted Telegram phone-code loginContinue an interrupted Telegram phone-code or 2FA login.
Resumes the stored Telegram phone-code hash or pending 2FA step without resending a login code when Telegram still accepts the pending authorization.
telegram auth login
Login with Telegram QR loginLogin to Telegram with the provider-supported QR flow by default.
Use –method phone only when no already logged-in Telegram app is available. Telegram API ID/hash are application credentials, not a normal account password and not a Bot API token.
--api-hash
string
Telegram API hash from my.telegram.org/apps--api-id
int
Telegram API ID from my.telegram.org/apps--method
string = qr
Telegram login method: qr or phone--phone
string
Telegram account phone number in international formattelegram auth logout
Remove the stored Telegram private session--revoke-provider-session
bool
also revoke the provider-side Telegram authorization when supportedtelegram auth refresh
Validate the stored Telegram private sessiontelegram auth status
Show Telegram private session statustelegram auth whoami
Show the active Telegram accounttelegram capabilities
Describe capabilities--section
string
Show one capability section: scopes, schemas, or commandstelegram chat
Find and inspect Telegram chatstelegram chat archive
Preview or archive a Telegram chat--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram chat get
Inspect a Telegram chattelegram chat leave
Preview or leave a Telegram chat--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram chat list
List recent Telegram chats--archived
bool
Only archived chats--folder
string
Telegram folder name or ID--muted
bool
Only muted chats--pinned
bool
Only pinned chats--query
string
Filter chats by title or username--type
string
Filter chat type--unread
bool
Only unread chatstelegram chat mute
Preview or mute a Telegram chat--dry-run
bool
Preview without changing Telegram--until
string
Mute duration or timestamp--yes
bool
Confirm destructive operationtelegram chat pin
Preview or pin a Telegram chat--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram chat read
Preview or mark a Telegram chat read--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram chat search
Search Telegram chats--archived
bool
Only archived chats--folder
string
Telegram folder name or ID--muted
bool
Only muted chats--pinned
bool
Only pinned chats--query
string
Filter chats by title or username--type
string
Filter chat type--unread
bool
Only unread chatstelegram chat unarchive
Preview or unarchive a Telegram chat--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram chat unmute
Preview or unmute a Telegram chat--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram chat unpin
Preview or unpin a Telegram chat--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram chat unread
Preview or mark a Telegram chat unread--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram config
Inspect local configurationtelegram config explain
Explain resolved configurationtelegram contact
Find and inspect Telegram contactstelegram contact get
Inspect a Telegram contacttelegram contact list
List Telegram contacts--query
string
Filter contactstelegram contact search
Search Telegram contacts--query
string
Search texttelegram doctor
Run diagnosticstelegram mcp
Run the MCP serverRun a stdio Model Context Protocol server for this adapter.
The server exposes read-only resource commands by default. Mutating commands are listed only when explicitly allowed with –allow and remain gated by the command contract safety class.
--allow
stringArray = []
Allow mutating command keys such as gmail.message.archive or gmail.message.label.*--allow-dangerous
bool
Allow --allow wildcards to include destructive or sends_external commands--concurrency
int
Maximum concurrent MCP subprocesses--max-output
int64 = 0
Maximum stdout/stderr bytes captured per MCP command--print-config
bool
Print MCP tool configuration and exit--timeout
duration = 0s
Per-command MCP subprocess timeout, for example 45s or 2mtelegram media
Find, inspect, and download Telegram mediatelegram media download
Download Telegram media to a path--output
string
Output path--overwrite
bool
Overwrite an existing output pathtelegram media get
Inspect Telegram mediatelegram media list
List Telegram media in a chat--chat
string
Chat selector--type
string
Media type filtertelegram message
Find, inspect, and send Telegram messagestelegram message delete
Preview or delete a Telegram message--dry-run
bool
Preview without changing Telegram--for-everyone
bool
Delete for everyone when Telegram permits it--yes
bool
Confirm destructive operationtelegram message forward
Preview or forward a Telegram message--chat
string
Destination chat selector--dry-run
bool
Preview without forwarding--yes
bool
Confirm destructive operationtelegram message get
Inspect a Telegram messagetelegram message list
List recent Telegram messages in a chat or Saved Messages--chat
string
Chat selector from telegram chat list--from
string
Sender user selector--query
string
Filter messages by text--saved
bool
List Saved Messages--since
string
Only show messages at or after this time--topic
string
Forum topic selector--type
string
Message type filter--until
string
Only show messages before this time--with-media
bool
Only show messages with mediatelegram message pin
Preview or pin a Telegram message--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram message read
Preview or mark a Telegram message read--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram message reply
Preview or reply to a Telegram message--dry-run
bool
Preview without sending--parse
string = plain
Parse mode: plain, markdown, or html--text
string
Text reply to send--text-file
string
Read reply text from a file--yes
bool
Confirm destructive operationtelegram message search
Search Telegram messages--chat
string
Optional chat selector from telegram chat list--from
string
Sender user selector--query
string
Text to search for--saved
bool
Search Saved Messages--since
string
Only show messages at or after this time--topic
string
Forum topic selector--type
string
Message type filter--until
string
Only show messages before this time--with-media
bool
Only show messages with mediatelegram message send
Preview or send a Telegram text message--chat
string
Destination chat selector from telegram chat list--disable-link-preview
bool
Disable link preview--dry-run
bool
Preview without sending--parse
string = plain
Parse mode: plain, markdown, or html--silent
bool
Send without notification--text
string
Text message to send--text-file
string
Read message text from a file--yes
bool
Confirm destructive operationtelegram message unpin
Preview or unpin a Telegram message--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram message unread
Preview or mark a Telegram message unread--dry-run
bool
Preview without changing Telegram--yes
bool
Confirm destructive operationtelegram profile
Manage provider profilestelegram profile create
Create an unauthenticated provider profiletelegram profile delete
Delete a local provider profiletelegram profile list
List provider profilestelegram profile rename
Rename a local provider profiletelegram profile use
Set the default provider profiletelegram reaction
Inspect and change Telegram message reactionstelegram reaction add
Preview or add a reaction--dry-run
bool
Preview without changing Telegram--emoji
string
Reaction emoji--yes
bool
Confirm destructive operationtelegram reaction list
List reactions on a Telegram messagetelegram reaction remove
Preview or remove a reaction--dry-run
bool
Preview without changing Telegram--emoji
string
Reaction emoji--yes
bool
Confirm destructive operationtelegram resolve
Resolve a local ref, short id, or URL aliastelegram saved
Work with Telegram Saved Messagestelegram saved add
Preview or add a Saved Message--dry-run
bool
Preview without saving--file
string
File path to save--parse
string = plain
Parse mode for --text: plain, markdown, or html--text
string
Text to save--yes
bool
Confirm destructive operationtelegram saved list
List Saved Messages--query
string
Filter Saved Messages--type
string
Message type filtertelegram saved search
Search Saved Messages--query
string
Search text--type
string
Message type filtertelegram schema
Emit schema hints--in
bool
Show input schema--input
bool
Show input schema--out
bool
Show output schematelegram topic
Find and inspect Telegram forum topicstelegram topic get
Inspect a Telegram forum topictelegram topic list
List Telegram forum topics--chat
string
Chat selectortelegram user
Find and inspect Telegram userstelegram user get
Inspect a known Telegram usertelegram user search
Search known Telegram users--query
string
Search texttelegram version
Show version informationplay_circle Live Examples
Output captured from a real workspace. Regenerate with
scripts/gen-docs.sh --update.
auth
Authenticated as authenticated account Next steps: - Run: telegram chat list --limit 20
{
"tool": "telegram",
"provider": "telegram",
"profile": "Philip Sterne",
"auth_mode": "private_session",
"authenticated": true,
"app_credentials_available": true,
"app_credentials_source": "profile",
"session_present": true,
"session_valid": true,
"provider_ready": true,
"account": {
"id": "{telegram-id}",
"display_name": "Philip Sterne",
"phone_masked": "27*****1879"
},
"authorization": {
"code_required": false,
"last_checked_at": "2026-06-29T08:45:42Z",
"login_method": "qr",
"login_required": false,
"password_required": false,
"pending_code_type": "",
"pending_login": false,
"phone_masked": ""
},
"suggested_next_step": "telegram chat list --limit 20",
"setup_url": "https://my.telegram.org/apps",
"credential_backend": {
"requested": "file",
"selected": "file",
"secure": false,
"fallback_active": false
}
}Telegram account Name: Philip Sterne Phone: 27*****1879 Profile: Philip Sterne Provider: telegram Next steps: - List chats: telegram chat list --limit 20 - Check readiness: telegram doctor
Login to Telegram with the provider-supported QR flow by default.
Use --method phone only when no already logged-in Telegram app is available. Telegram API ID/hash are application credentials, not a normal account password and not a Bot API token.
Usage:
telegram auth login [flags]
Examples:
telegram auth login
telegram auth login --help
telegram auth login --method phone
Flags:
--api-hash string Telegram API hash from my.telegram.org/apps
--api-id int Telegram API ID from my.telegram.org/apps
-h, --help help for login
--method string Telegram login method: qr or phone (default "qr")
--phone string Telegram account phone number in international format
Global Flags:
--config string Config path override
--cursor string Continuation cursor
--debug Enable debug diagnostics
--json Emit JSON machine output
--jsonl Emit JSONL records for piping
--limit int Maximum items to emit (default 50)
--no-paginate Fetch only one page
-o, --output string Compatibility output mode: json|jsonl. Prefer --json or --jsonl
--page-size int Requested upstream page size (default 50)
--profile string Config/auth profile (default "default")
-q, --quiet Suppress non-essential diagnostics
-v, --version Print version information
--view string View mode: summary|full (default "summary")telegram doctor: WARN Checks: credential_backend ok, credential_security warn, profiles ok, telegram_app_credentials ok, auth ok, connectivity warn CHECK STATUS DETAIL credential_backend OK using file credential_security WARN credential backend stores local plaintext secrets profiles OK active profile "Philip Sterne" telegram_app_credentials OK Telegram API ID/hash are available from profile auth OK Telegram private session is stored connectivity WARN not checked by default to avoid sending login codes; run tele... Next steps: - Status: prefer an OS keychain backend outside isolated test accounts - Capabilities: telegram capabilities
messages
Messages (2 total)
MARKER CHAT_TITLE TEXT DATE
m1 Saved Messages cmdhub-{token} saved messages roundtrip 7d ago
m2 Saved Messages cmdhub-{token} cleanup candidate 9d ago
Next steps:
- Open: telegram message get m1
- Search: telegram message search --query <text>
- List chats: telegram chat list --limit 20
- Capabilities: telegram capabilitiesNo message found. Next steps: - List: telegram message list - Status: telegram auth status - List chats: telegram chat list --limit 20 - Search messages: telegram message search --query <text>
Get message m1: cmdhub-{token} saved messages roundtrip
Field Value
----- -----
Ref m1
Type message
Title cmdhub-{token} saved messages roundtrip
When 2026-06-29T07:37:31Z
Next steps:
- Run: telegram saved list --limit 20
- Open: telegram message get m1
- List chats: telegram chat list --limit 20
- Search messages: telegram message search --query <text>Message send preview
Chat: c1 Saved Messages
From: You
Text: cmdhub-{token}
Status: not sent
To send this message, rerun with --yes.
Next steps:
- Send exactly this message: telegram message send --chat c1 --text "cmdhub-{token}" --yes
- Inspect destination first: telegram chat get c1Message reply preview
Text: cmdhub-{token}
Status: not sent
Next steps:
- Apply exactly this preview: telegram message reply m1 --text "cmdhub-{token}" --yesMessage delete preview Text: Saved Messages Status: not changed Next steps: - Apply exactly this preview: telegram message delete m1 --yes
alt_route Composition Patterns
Bridge your ecosystem with zero middleware.
# Read recent messages from a chat
telegram chat list --limit 20
telegram message list --chat c1 --limit 20
