forum
cmdhub adapter

Telegram CLI
for cmdhub.

Telegram chats, messages, search, and safe send workflows.

lock Auth: private_session
Quick Install 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 information
telegram auth Manage authentication
#cmd-telegram-auth discovery safe
$ telegram auth --help
telegram auth configure Store Telegram API ID/hash for the selected profile
#cmd-telegram-auth-configure discovery safe

Store 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 format
$ telegram auth configure --api-id 12345 --api-hash <api-hash> --phone +1555010100
telegram auth continue Continue an interrupted Telegram phone-code login
#cmd-telegram-auth-continue discovery safe

Continue 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 continue --help
telegram auth login Login with Telegram QR login
#cmd-telegram-auth-login mutates state

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.

--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 format
$ telegram auth login
$ telegram auth login --help
$ telegram auth login --method phone
telegram auth logout Remove the stored Telegram private session
#cmd-telegram-auth-logout mutates state
--revoke-provider-session bool also revoke the provider-side Telegram authorization when supported
$ telegram auth logout --help
telegram auth refresh Validate the stored Telegram private session
#cmd-telegram-auth-refresh mutates state
$ telegram auth refresh --help
telegram auth status Show Telegram private session status
#cmd-telegram-auth-status discovery safe
$ telegram auth status --help
telegram auth whoami Show the active Telegram account
#cmd-telegram-auth-whoami discovery safe
$ telegram auth whoami --help
telegram capabilities Describe capabilities
#cmd-telegram-capabilities discovery safe
--section string Show one capability section: scopes, schemas, or commands
$ telegram capabilities --help
telegram chat Find and inspect Telegram chats
#cmd-telegram-chat discovery safe
$ telegram chat --help
telegram chat archive Preview or archive a Telegram chat
#cmd-telegram-chat-archive mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram chat archive --help
$ telegram chat archive c1 --dry-run
telegram chat get Inspect a Telegram chat
#cmd-telegram-chat-get discovery safe
$ telegram chat get
$ telegram chat get c1 --view full
telegram chat leave Preview or leave a Telegram chat
#cmd-telegram-chat-leave discovery safe dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram chat leave --help
$ telegram chat leave c1 --dry-run
telegram chat list List recent Telegram chats
#cmd-telegram-chat-list discovery safe
--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 chats
$ telegram chat list
$ telegram chat list --limit 20
$ telegram chat list --query project
telegram chat mute Preview or mute a Telegram chat
#cmd-telegram-chat-mute discovery safe dry-run
--dry-run bool Preview without changing Telegram
--until string Mute duration or timestamp
--yes bool Confirm destructive operation
$ telegram chat mute --help
$ telegram chat mute c1 --dry-run
$ telegram chat mute c1 --until 1h --dry-run
telegram chat pin Preview or pin a Telegram chat
#cmd-telegram-chat-pin mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram chat pin --help
$ telegram chat pin c1 --dry-run
telegram chat read Preview or mark a Telegram chat read
#cmd-telegram-chat-read mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram chat read --help
$ telegram chat read c1 --dry-run
telegram chat unarchive Preview or unarchive a Telegram chat
#cmd-telegram-chat-unarchive mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram chat unarchive --help
$ telegram chat unarchive c1 --dry-run
telegram chat unmute Preview or unmute a Telegram chat
#cmd-telegram-chat-unmute discovery safe dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram chat unmute --help
$ telegram chat unmute c1 --dry-run
telegram chat unpin Preview or unpin a Telegram chat
#cmd-telegram-chat-unpin mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram chat unpin --help
$ telegram chat unpin c1 --dry-run
telegram chat unread Preview or mark a Telegram chat unread
#cmd-telegram-chat-unread mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram chat unread --help
$ telegram chat unread c1 --dry-run
telegram config Inspect local configuration
#cmd-telegram-config discovery safe
$ telegram config --help
telegram config explain Explain resolved configuration
#cmd-telegram-config-explain discovery safe
$ telegram config explain --help
telegram contact Find and inspect Telegram contacts
#cmd-telegram-contact discovery safe
$ telegram contact --help
telegram contact get Inspect a Telegram contact
#cmd-telegram-contact-get discovery safe
$ telegram contact get
$ telegram contact get u1
telegram contact list List Telegram contacts
#cmd-telegram-contact-list discovery safe
--query string Filter contacts
$ telegram contact list
$ telegram contact list --limit 20
telegram doctor Run diagnostics
#cmd-telegram-doctor discovery safe
$ telegram doctor --help
telegram mcp Run the MCP server
#cmd-telegram-mcp discovery safe

Run 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 2m
$ mcp
$ mcp --print-config
telegram media Find, inspect, and download Telegram media
#cmd-telegram-media discovery safe
$ telegram media --help
telegram media download Download Telegram media to a path
#cmd-telegram-media-download discovery safe
--output string Output path
--overwrite bool Overwrite an existing output path
$ telegram media download --help
$ telegram media download f1 --output ./file.bin
telegram media get Inspect Telegram media
#cmd-telegram-media-get discovery safe
$ telegram media get
$ telegram media get f1 --view full
telegram media list List Telegram media in a chat
#cmd-telegram-media-list discovery safe
--chat string Chat selector
--type string Media type filter
$ telegram media list
$ telegram media list --chat c1 --limit 20
telegram message Find, inspect, and send Telegram messages
#cmd-telegram-message discovery safe
$ telegram message --help
telegram message delete Preview or delete a Telegram message
#cmd-telegram-message-delete mutates state dry-run
--dry-run bool Preview without changing Telegram
--for-everyone bool Delete for everyone when Telegram permits it
--yes bool Confirm destructive operation
$ telegram message delete --help
$ telegram message delete m1 --dry-run
telegram message forward Preview or forward a Telegram message
#cmd-telegram-message-forward mutates state dry-run
--chat string Destination chat selector
--dry-run bool Preview without forwarding
--yes bool Confirm destructive operation
$ telegram message forward --help
$ telegram message forward m1 --to c2 --dry-run
telegram message get Inspect a Telegram message
#cmd-telegram-message-get discovery safe
$ telegram message get
$ telegram message get m1 --view full
telegram message list List recent Telegram messages in a chat or Saved Messages
#cmd-telegram-message-list discovery safe
--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 media
$ telegram message list
$ telegram message list --chat c1 --limit 20
$ telegram message list --saved --limit 20
telegram message pin Preview or pin a Telegram message
#cmd-telegram-message-pin mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram message pin --help
$ telegram message pin m1 --dry-run
telegram message read Preview or mark a Telegram message read
#cmd-telegram-message-read mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram message read --help
$ telegram message read m1 --dry-run
telegram message reply Preview or reply to a Telegram message
#cmd-telegram-message-reply mutates state dry-run
--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 operation
$ telegram message reply --help
$ telegram message reply m1 --text "hello" --dry-run
telegram message send Preview or send a Telegram text message
#cmd-telegram-message-send mutates state dry-run
--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 operation
$ telegram message send --chat c1 --text "hello" --dry-run
$ telegram message send --chat c1 --text "hello" --yes
$ telegram message send --help
telegram message unpin Preview or unpin a Telegram message
#cmd-telegram-message-unpin mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram message unpin --help
$ telegram message unpin m1 --dry-run
telegram message unread Preview or mark a Telegram message unread
#cmd-telegram-message-unread mutates state dry-run
--dry-run bool Preview without changing Telegram
--yes bool Confirm destructive operation
$ telegram message unread --help
$ telegram message unread m1 --dry-run
telegram profile Manage provider profiles
#cmd-telegram-profile discovery safe
$ telegram profile --help
telegram profile create Create an unauthenticated provider profile
#cmd-telegram-profile-create mutates state
$ telegram profile create --help
telegram profile delete Delete a local provider profile
#cmd-telegram-profile-delete mutates state
$ telegram profile delete --help
telegram profile list List provider profiles
#cmd-telegram-profile-list discovery safe
$ telegram profile list --help
telegram profile rename Rename a local provider profile
#cmd-telegram-profile-rename discovery safe
$ telegram profile rename --help
telegram profile use Set the default provider profile
#cmd-telegram-profile-use mutates state
$ telegram profile use --help
telegram reaction Inspect and change Telegram message reactions
#cmd-telegram-reaction discovery safe
$ telegram reaction --help
telegram reaction add Preview or add a reaction
#cmd-telegram-reaction-add mutates state dry-run
--dry-run bool Preview without changing Telegram
--emoji string Reaction emoji
--yes bool Confirm destructive operation
$ telegram reaction add --help
$ telegram reaction add m1 --emoji 👍 --dry-run
telegram reaction list List reactions on a Telegram message
#cmd-telegram-reaction-list discovery safe
$ telegram reaction list
$ telegram reaction list m1
telegram reaction remove Preview or remove a reaction
#cmd-telegram-reaction-remove mutates state dry-run
--dry-run bool Preview without changing Telegram
--emoji string Reaction emoji
--yes bool Confirm destructive operation
$ telegram reaction remove --help
$ telegram reaction remove m1 --emoji 👍 --dry-run
telegram resolve Resolve a local ref, short id, or URL alias
#cmd-telegram-resolve discovery safe
$ telegram resolve --help
$ telegram resolve <ref>
telegram saved Work with Telegram Saved Messages
#cmd-telegram-saved discovery safe
$ telegram saved --help
telegram saved add Preview or add a Saved Message
#cmd-telegram-saved-add mutates state dry-run
--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 operation
$ telegram saved add --help
$ telegram saved add --text "note" --dry-run
telegram saved list List Saved Messages
#cmd-telegram-saved-list discovery safe
--query string Filter Saved Messages
--type string Message type filter
$ telegram saved list
$ telegram saved list --limit 20
telegram schema Emit schema hints
#cmd-telegram-schema discovery safe
--in bool Show input schema
--input bool Show input schema
--out bool Show output schema
$ telegram schema --help
telegram topic Find and inspect Telegram forum topics
#cmd-telegram-topic discovery safe
$ telegram topic --help
telegram topic get Inspect a Telegram forum topic
#cmd-telegram-topic-get discovery safe
$ telegram topic get
$ telegram topic get t1
telegram topic list List Telegram forum topics
#cmd-telegram-topic-list discovery safe
--chat string Chat selector
$ telegram topic list
$ telegram topic list --chat c1
telegram user Find and inspect Telegram users
#cmd-telegram-user discovery safe
$ telegram user --help
telegram user get Inspect a known Telegram user
#cmd-telegram-user-get discovery safe
$ telegram user get
$ telegram user get u1
telegram version Show version information
#cmd-telegram-version discovery safe
$ telegram version --help

play_circle Live Examples

Output captured from a real workspace. Regenerate with scripts/gen-docs.sh --update.

auth

Show Telegram auth readiness
$ telegram auth status
Authenticated as authenticated account

Next steps:
- Run: telegram chat list --limit 20
Show Telegram auth readiness JSON
$ telegram auth status --json
{
  "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
  }
}
Show current Telegram identity
$ telegram auth whoami
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
Show QR login help
$ telegram auth login --help
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")
Run Telegram doctor
$ telegram doctor
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

List recent chat messages
$ telegram message list --chat c1 --limit 5
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 capabilities
Recover from empty message search
$ telegram message search --chat c1 --query cmdhub-docshot-no-such-token --limit 3
Empty state
No 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>
Inspect a Telegram message
$ telegram message get m1 --view full
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>
Preview a Telegram send
$ telegram message send --chat c1 --text cmdhub-docshot-send-preview --dry-run
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 c1
Preview a Telegram reply
$ telegram message reply m1 --text cmdhub-docshot-reply-preview --dry-run
Message reply preview
Text:   cmdhub-{token}
Status: not sent

Next steps:
- Apply exactly this preview: telegram message reply m1 --text "cmdhub-{token}" --yes
Preview Telegram message deletion
$ telegram message delete m1 --dry-run
Message 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