Better-TG-CLI (Telegram)
v0.41.2Telegram on your own account: read, search, send and press bot buttons.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
telegram_help Telegram CLI reference
List telegram CLI commands and flags. Pass grep to filter (e.g. "thread", "search"). Call this before guessing flags.
| Parameter | Type | Description |
|---|---|---|
grep | string | Only commands whose name, description or flags mention this word, e.g. "thread" |
telegram_read Read Telegram
Run a read-only telegram CLI command on the user's account, e.g. ["inbox","-n","10"], ["read","@user","-n","20"], ["search","invoice","--chat","Work"]. args[0] is the command; chats are an ID, @username, "me" or a title. Output is compact text (add "--json" for JSON). Add "--full" (read/get/search/inbox/watch) for complete per-message stats: views, forwards, full reactions, comments, flags, media detail. watch needs -t or -n. A new public-post search (channels.SearchPosts) may use up the free daily search quota.
| Parameter | Type | Description |
|---|---|---|
args * | array | CLI argv, command first, one item per word: ["read","@user","-n","20"] |
telegram_write Write to Telegram
Run a telegram CLI command that sends, edits, deletes or changes something (or saves files: download, sync), e.g. ["send","@user","-"] with stdin as the text. Needs write access (mode "ask" after setup; if writes are off, call telegram_setup so the user can choose). In mode "ask" the user approves each write: either the client shows them a dialog, or the result has status "approval_required" with the action and a code (not an error); then show the user that action word for word, and only after their explicit yes call again with the same args, stdin and "approval": "<code>". Writes need an ID,…
| Parameter | Type | Description |
|---|---|---|
args * | array | CLI argv, command first, one item per word: ["send","-1004001","-"] (text in stdin) |
approval | string | Only in write mode "ask" when the user is not asked by a dialog: the code from the previous result, passed after the user said yes to that exact action in the chat. Never approve on the user's behalf. |
stdin | string | Text for a "-" argument (message body), avoids quoting issues |
telegram_setup Set up Telegram (for the user)
For "Not configured", "Session expired" or "Write access is disabled": opens a page on this computer where the USER logs in to Telegram (QR code, 2FA password) and chooses what you may do (read-only, ask before each write, or write freely). Returns the page link: give it to the user and wait for them. You never see their code or password, and you never choose the mode for them. Calling it again returns the same page while it is open.