Personal account

Login, reading, search, files, sending, archive and your account settings.

This reference covers personal-account commands. Use it to find the exact command, arguments and options for login, reading, searching, files and sending.

Login, reading, search, files, sending, archive and your account settings.

Options for every command

OptionWhat it does
-V, --versionoutput the version number.
-v, --verbosemore detail in what is shown: -v ids, -vv everything we know. Default: 0.
--jsonmachine-readable output: one JSON value on stdout, nothing else.
--jsonlmachine-readable output: one JSON object per line, for streaming and jq.
--quietdiagnostics off; a failure is still said.
--tracethe connection's own log lines on stderr — never message content.
--timeout <duration>give up on the whole command after this — 30s, 2m, 500ms.
--offlineanswer from what was recorded and never connect; fails if nothing was.
--no-inputnever prompt or open interactive login; piped input remains available.
--max-input-bytes <bytes>maximum buffered input bytes (default: 16777216).
--max-output-bytes <bytes>maximum machine output bytes (default: 4194304; 0 disables).
--fields <paths>comma-separated item or object fields: id,text; preserve pagination and operation ids.
--dry-runpreview parsed arguments and permissions before running the action.
--yesgo ahead without the question an ask level puts before a write.
--recordkeep this run — ids and timings, never message content.
--no-recorddo not keep it, whatever the configuration says.

Commands

tg session

log this profile in to Telegram, or out

tg session start

log in by QR code (default) or by phone number, code and 2FA password

tg session start [method] [options]
ArgumentRequirementWhat it is
methodoptionalhow to log in. One of: qr, phone. Default: qr.
OptionWhat it does
--app <how>the first time only: how to get this profile's app from my.telegram.org. One of: browser, auto. Default: browser.
--qr-file <png>write the QR code to this PNG instead of drawing it, for an agent to pass on.
--smsphone login: ask Telegram to send the code by SMS, not to the app; Telegram may still refuse.

tg session end

log this profile out on Telegram's side and forget the session here

Changes something in Telegram.

tg session end

tg setup

set up Telegram and connect your agent

Changes something in Telegram.

tg setup [options]
OptionWhat it does
--agent <agent>install the skill for this agent; asks at a terminal, otherwise none. One of: none, codex, cursor, claude, gemini, all.
--app <how>how to get your Telegram app credentials the first time. One of: auto, browser. Default: auto.
--method <method>how to log in when there is no session. One of: qr, phone. Default: qr.
--qr-file <png>write a temporary login QR image for an agent; needs stored app credentials without a terminal.

tg account

the logged-in account

tg account list

every profile on this computer, and the account each is logged in as; asks the messenger nothing

tg account list

tg account show

who this profile is logged in as; the phone number shows its last four digits

tg account show [options]
OptionWhat it does
--show-phoneprint the whole phone number.

tg account update

change the name, the description or the photo everyone sees on your profile

Changes something in Telegram.

tg account update [options]
OptionWhat it does
--first-name <name>your first name.
--last-name <name>your last name.
--description <text>about you.
--photo <file>a new profile photo — an image file.

tg account sessions

where else this account is logged in — not tg session, which is this tool's own login

tg account sessions list

every device and app logged in to this account; nothing is ended

tg account sessions list

tg account sessions end

log out every other device, your phone included; this one stays

Changes something in Telegram.

tg account sessions end [options]
OptionWhat it does
--othersevery session but this one.

tg chats

the account's chats

tg chats list

chats, newest first, archived ones included

tg chats list [options]
OptionWhat it does
--limit <n>how many to show.
--page <n>which page, starting at 1.
--allevery row, no paging.
--search <text>only chats whose name contains this; at least 3 characters.
--kind <kind>only chats of this kind: dialog, group, channel, saved.
--unreadonly chats with unread messages.

tg chats events

who joined, left, was added or removed, and by whom — from the chat's service messages

tg chats events <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--since-time <time>ISO 8601, or 2h / 1d ago; 7 days ago if not given.
--type <names>only these, comma-separated: join, leave, add, remove, create, title, pin.

tg chats inspect

what an invite or public link leads to, without joining it

tg chats inspect <link>
ArgumentRequirementWhat it is
linkrequiredan invite link or a public one.

tg chats show

one chat: its kind, unread count, last message time and who is in it

tg chats show <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg chats send-as

who this account may post as in a chat; changes no saved choice

tg chats send-as <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg chats mark-read

mark a chat read; the other side sees that you read it

Changes something in Telegram.

tg chats mark-read <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--until <message>only up to this message id; the newest by default.
--topic <id>mark only this forum topic read; unsupported by messengers without topics.

tg chats tracking

the chats whose member lists serve fetches daily into the local store — chats members fetch --track adds one

tg chats tracking list

every tracked chat: since when, and its last member count

tg chats tracking list

tg chats tracking show

one chat: whether it is tracked, and its member count per day for the last 30 days

tg chats tracking show <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg chats tracking add

fetch this chat's member list daily while serve runs, from its next run

tg chats tracking add <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg chats tracking remove

stop fetching it daily; the history already kept stays

tg chats tracking remove <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg chats join

join a group or channel by its link; the others in it see that you joined

Changes something in Telegram.

tg chats join <link>
ArgumentRequirementWhat it is
linkrequiredan invite link, or a public one.

tg chats leave

leave a group or channel; the others in it see that you left

Changes something in Telegram.

tg chats leave <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg chats folders

your chat folders

tg chats folders list

your chat folders, in the order the app shows them

tg chats folders list

tg chats folders show

one chat folder, with the names of the chats in it

tg chats folders show <folder>
ArgumentRequirementWhat it is
folderrequiredthe folder's id, or its title exactly.

tg chats folders create

create a chat folder

Changes something in Telegram.

tg chats folders create <title> [options]
ArgumentRequirementWhat it is
titlerequiredthe folder's name; the app may refuse a long one.
OptionWhat it does
--chat <chat>a chat to put in it, by id or name; repeat it for more.
--include <kinds>every chat of these kinds: contacts, non-contacts, groups, channels, bots.
--skip <which>leave out chats that are muted, read, archived.
--exclude-chat <chat>never show this chat in it; repeat it for more.
--pin <chat>pin this chat at the top of the folder; repeat it for more.
--emoji <emoji>the folder's icon.

tg chats folders update

rename a folder, or change which chats are in it

Changes something in Telegram.

tg chats folders update <folder> [options]
ArgumentRequirementWhat it is
folderrequiredfolder id, or its title exactly.
OptionWhat it does
--title <title>a new name.
--add <chat>put a chat in it; repeat it for more.
--remove <chat>take a chat out of it, and off its excluded and pinned lists; repeat it for more.
--include <kinds>every chat of these kinds: contacts, non-contacts, groups, channels, bots; replaces what it had, none clears it.
--skip <which>leave out chats that are muted, read, archived; replaces what it had, none clears it.
--exclude-chat <chat>never show this chat in it; repeat it for more.
--pin <chat>pin this chat at the top of the folder; repeat it for more.
--emoji <emoji>the folder's icon.

tg chats folders delete

delete a folder; the chats in it stay

Changes something in Telegram.

tg chats folders delete <folder>
ArgumentRequirementWhat it is
folderrequiredfolder id, or its title exactly.

tg chats folders order

put folders in this order; the ones not named keep theirs after them

Changes something in Telegram.

tg chats folders order <folders>
ArgumentRequirementWhat it is
foldersrequiredfolder ids, or titles exactly, first one first.

tg chats folders join

add a folder someone shared by a link; joins every chat in it, and the others there see you joined

Changes something in Telegram.

tg chats folders join <link>
ArgumentRequirementWhat it is
linkrequiredthe folder's link, as t.me/addlist/….

tg chats rules

what chats moderate judges a group by, kept in a file of this profile

tg chats rules show

the group's rules; the defaults, marked not saved, if it has none yet

tg chats rules show <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg chats rules set

change one rule; the group's first change writes every rule with its default

Changes something on this computer only.

tg chats rules set <chat> <key> <value>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
keyrequiredone of: trusted, blocked, blockedNames, links, invites, forwards, blockedPeople, flood.messages, flood.minutes, flood.action, newAccount.days, newAccount.action, consent.delete, consent.remove.
valuerequiredthe new value; a list is comma-separated.

tg chats rules unset

put one rule back to its default

Changes something on this computer only.

tg chats rules unset <chat> <key>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
keyrequiredone of: trusted, blocked, blockedNames, links, invites, forwards, blockedPeople, flood.messages, flood.minutes, flood.action, newAccount.days, newAccount.action, consent.delete, consent.remove.

tg contacts

people this account has a one-to-one chat with

tg contacts list

people you have a one-to-one chat with

tg contacts list [options]
OptionWhat it does
--limit <n>how many to show.
--page <n>which page, starting at 1.
--allevery row, no paging.
--order <recent|name>newest conversation first, or alphabetical. Default: recent.
--search <text>only people whose name, local alias or @username contains this.
--search-notes <text>only people whose private notes contain this text.

tg contacts show

one person and the chats you share with them

tg contacts show <person> [options]
ArgumentRequirementWhat it is
personrequiredtheir id, @username, or part of their name.
OptionWhat it does
--with-notesinclude your private notes, subject to contacts.notes.list permission.

tg contacts profile

everything the messenger says about one person — handles, flags, last seen, when they registered — and how many of their messages the store holds in each chat you share, the first and the last, and the earlier names and usernames the store saw them with

tg contacts profile <person> [options]
ArgumentRequirementWhat it is
personrequiredtheir id, @username, or part of their name.
OptionWhat it does
--show-phoneprint the whole phone number.

tg contacts context

what the local store holds about a person; --chat --refresh explicitly asks Telegram first

tg contacts context <person> [options]
ArgumentRequirementWhat it is
personrequiredtheir id, @username, or part of their name.
OptionWhat it does
--limit <n>at most this many messages in each list; 10 if not given.
--since-time <time>nothing older than this ISO 8601 time, or 2h / 1d ago.
--chat <chat>a chat, by id or name; repeat it for more — then their newest messages in each, 20 unless --limit, short unless -v.
--refreshwith --chat, read their newest messages in each from the messenger first.

tg contacts check

whether one person looks like a bot, a fake or a spammer: their profile, what they wrote in the store, and the public ban lists (Combot Anti-Spam (CAS), lols.bot), which are sent their id — a hint, never a verdict

tg contacts check <person> [options]
ArgumentRequirementWhat it is
personrequiredtheir id, @username, or part of their name.
OptionWhat it does
--no-registriesskip public ban lists; still ask Telegram for the profile and photos unless --offline.

record that two people in the store are one person — the same name is never enough

tg contacts link <person> <other>
ArgumentRequirementWhat it is
personrequiredtheir id, @username, or part of their name.
otherrequiredthe same in another messenger of the store, as : — max:Ana.

undo contacts link for one identity: it is a person of its own again

tg contacts unlink <person>
ArgumentRequirementWhat it is
personrequiredtheir id, @username, or part of their name; : for another messenger.

tg contacts lookup

who has this phone number — asks for it, or reads it from stdin; never an argument

tg contacts lookup

tg contacts sync

take the whole contact list from the messenger into the local store

tg contacts sync

tg contacts alias

a private local display name in the selected account

tg contacts alias set

Changes something on this computer only.

tg contacts alias set <person> <alias>
ArgumentRequirementWhat it is
personrequired
aliasrequired

tg contacts alias rm

Changes something on this computer only.

tg contacts alias rm <person>
ArgumentRequirementWhat it is
personrequired

tg contacts notes

your private notes on a stored contact, the same in every account that sees them

tg contacts notes list

tg contacts notes list <person>
ArgumentRequirementWhat it is
personrequired

tg contacts notes show

tg contacts notes show <person> <id>
ArgumentRequirementWhat it is
personrequired
idrequired

tg contacts notes add

Changes something on this computer only.

tg contacts notes add <person> [options]
ArgumentRequirementWhat it is
personrequired
OptionWhat it does
--file <path>read note text from a file; omitted or - reads stdin.

tg contacts notes edit

Changes something on this computer only.

tg contacts notes edit <person> <id> [options]
ArgumentRequirementWhat it is
personrequired
idrequired
OptionWhat it does
--file <path>read note text from a file; omitted or - reads stdin.
--revision <number>the revision you read before editing.

tg contacts notes remove

Changes something on this computer only.

tg contacts notes remove <person> <id>
ArgumentRequirementWhat it is
personrequired
idrequired

tg contacts add

add a person to your contacts — contacts list still shows only people you have a dialog with

Changes something in Telegram.

tg contacts add <person>
ArgumentRequirementWhat it is
personrequiredperson id — contacts lookup finds one — or part of a known name.

tg contacts remove

remove a person from your contacts; the chat stays, a name you gave them may not

Changes something in Telegram.

tg contacts remove <person>
ArgumentRequirementWhat it is
personrequiredperson id — contacts lookup finds one — or part of a known name.

tg contacts block

stop a person from writing to you — they need not be a contact

Changes something in Telegram.

tg contacts block <person>
ArgumentRequirementWhat it is
personrequiredperson id — contacts lookup finds one — or part of a known name.

tg contacts unblock

let a blocked person write to you again

Changes something in Telegram.

tg contacts unblock <person>
ArgumentRequirementWhat it is
personrequiredperson id — contacts lookup finds one — or part of a known name.

tg contacts rename

rename the contact in the messenger address book; use contacts alias for a private local name

Changes something in Telegram.

tg contacts rename <person> <first-name> [last-name]
ArgumentRequirementWhat it is
personrequiredperson id — contacts lookup finds one — or part of a known name.
first-namerequiredthe name you want to see for them.
last-nameoptional

tg contacts import

upload phone numbers and add the people the messenger has under them

Changes something in Telegram.

tg contacts import <file>
ArgumentRequirementWhat it is
filerequiredone person per line: number, then a comma, a tab or a semicolon, then the name.

tg messages

read and send messages

tg messages evidence

a bounded evidence packet from stored messages, newest first

tg messages evidence <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--limit <n>how many, 1–100.
--before-id <id>only messages older than this message id.

tg messages list

a chat's messages, oldest to newest

tg messages list <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--limit <n>how many.
--before-id <id>only messages older than this message id.
--before-time <time>only messages older than this ISO 8601 time, or 2h / 1d ago.
--after-id <id>only messages newer than this message id.
--after-time <time>only messages newer than this ISO 8601 time, or 2h / 1d ago.
--topic <id>only this forum topic; read back from its newest message or --before-id.
--transcribeturn voice messages not heard yet into text — by the messenger, or a model on this machine; can take minutes.
--model <id>which downloaded speech model hears them, with --transcribe; models audio list shows them.
--mark-readalso mark the chat read up to the newest message shown; the other person sees it.

tg messages send

send a text message; without [text], the text is read from stdin

Changes something in Telegram.

tg messages send <chat> [text] [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
textoptionalthe message.
OptionWhat it does
--topic <id>send to this forum topic; unsupported by messengers without topics.
--reply-to <message>answer this message, by its id in the same chat.
--comment-to <post>comment on this post of the channel; it goes to the post's discussion group.
--send-as <id>post as one of the identities chats send-as lists; required where the chat posts as someone else by default.
--send-id <id>repeat a send whose outcome was unknown, without risking a second copy.
--silentdeliver without a notification.
--no-previewno preview card for a link in the text.
--mdread this messenger's Markdown; see its formatting guide for supported syntax.
--file <file>attach a file; the text becomes its caption.
--photo <file>attach a .jpg, .png or .webp as a photo; the text becomes its caption.
--as-filesend the --file as a file to download, a video included.
--voice <file>send an Ogg Opus file as a voice message, alone, with no text.
--allow-any-filesend a file even from a hidden folder, ~/.ssh or this CLI's own folders.
--at-time <time>let the messenger send it later, even with this machine off: 2026-09-25T09:00 (local time), or 30m, 2h, 1d from now.
--spoilerhide the --photo or video behind a spoiler until tapped.
--caption-aboveshow the text above the --photo or --file, not below it.
--filename <name>the name others see for the --file, instead of its name on disk.
--htmlthe text is HTML: , , , .

tg messages show

one message, by its chat and id or by its msg: locator

tg messages show <chat> [message]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages; or a msg: locator, with no message id after it.
messageoptionalthe message id.

tg messages context

a message and what came either side of it, oldest first

tg messages context <chat> [message] [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages; or a msg: locator, with no message id after it.
messageoptionalthe message id.
OptionWhat it does
--threadthe stored reply chain and replies instead of time neighbours; falls back when no graph exists.
--thread-hops <n>at most this many links from the hit (default: 8).
--thread-messages <n>at most this many messages in each thread context (default: 50).
--thread-bytes <n>at most this many bytes of whole messages and links in each context (default: 65536).
--thread-within <duration>messages within this long either side of the hit (default: 1d).
--before-n <n>how many before it. Default: 5.
--after-n <n>how many after it. Default: 5.

tg messages download

save a message's photos, files, videos and voice notes to a folder — or a whole chat's with --all

tg messages download <chat> [message] [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messageoptionalthe message id; left out with --all.
OptionWhat it does
--output-dir <dir>where to save them; created if missing. Default: ..
--allevery file of the chat, newest first; run it again to continue where it stopped.
--pause <duration>with --all, a pause between pages, to stay under the provider's limits. Default: 1s.
--extractread text layers from the files this download maps into the local content index.

tg messages transcribe

a voice message as text — by Telegram where it can, else by a model on this machine

tg messages transcribe <chat> <message> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe id of a voice message.
OptionWhat it does
--localuse the model on this machine, never the messenger.
--model <id>which downloaded model; implies --local (models audio list).

tg messages edit

change the text of your own message; the other side may have read it already

Changes something in Telegram.

tg messages edit <chat> <message> [text] [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe id of your own message.
textoptionalthe new text; without it, read from stdin.
OptionWhat it does
--mdread this messenger's Markdown; see its formatting guide for supported syntax.
--htmlthe text is HTML: , , , .

tg messages delete

delete messages for you only; with --for-everyone, for everyone in the chat

Changes something in Telegram.

tg messages delete <chat> <messages> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagesrequiredthe message ids, at most 10.
OptionWhat it does
--for-everyonedelete for everyone in the chat, not only for you — they cannot get it back.
--allow-dangerousgo ahead without the question an ask level puts before a deletion.

tg messages forward

forward one message to another chat

Changes something in Telegram.

tg messages forward <chat> <message> [options]
ArgumentRequirementWhat it is
chatrequiredthe chat the message is in: a chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe message id.
OptionWhat it does
--to <chat>where it goes: a chat: its title or part of it, its id, @username, or me for Saved Messages.
--silentdeliver it without a notification.
--send-as <id>post as one of the identities chats send-as lists for the --to chat; required where the chat posts as someone else by default.
--send-id <id>repeat a forward whose outcome was unknown, without risking a second copy.
--topic <id>forward into this forum topic of the --to chat.

tg messages pin

pin a message in a chat, quietly unless --notify

Changes something in Telegram.

tg messages pin <chat> <message> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe message id.
OptionWhat it does
--notifytell the chat's members about the pin.

tg messages unpin

unpin a message in a chat

Changes something in Telegram.

tg messages unpin <chat> <message>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe message id.

tg messages scheduled

messages waiting to be sent later in a chat, soonest first; cancel one in the app

tg messages scheduled <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

a message permalink when supported, and its account-scoped locator

tg messages link <chat> [message]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages; or a msg: locator, with no message id after it.
messageoptionalthe message id.

tg messages comments

the comments under a channel post, oldest to newest; they live in its discussion group

tg messages comments <chat> <post> [options]
ArgumentRequirementWhat it is
chatrequiredthe channel: a chat: its title or part of it, its id, @username, or me for Saved Messages.
postrequiredthe post's message id in the channel.
OptionWhat it does
--limit <n>how many.
--before-id <id>only comments older than this comment id.

why a message is in its conversation: each link it has, and the chain of answers back to the start

tg messages links <chat> <message>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe message id.

tg reactions

react to messages

tg reactions add

put your reaction on a message; it replaces the one you had

Changes something in Telegram.

tg reactions add <chat> <message> <emoji>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe message id.
emojirequiredone emoji, for example 👍.

tg reactions remove

take your reaction off a message

Changes something in Telegram.

tg reactions remove <chat> <message>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe message id.

tg polls

read a poll, vote in it, close your own, create one

tg polls show

a poll and its answer ids, as the message carries it now

tg polls show <chat> <message>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe id of the message that carries the poll.

tg polls voters

who voted for what, newest first; not in an anonymous poll

tg polls voters <chat> <message> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe id of the message that carries the poll.
OptionWhat it does
--answer <id>only those who chose this answer, as polls show prints it.
--limit <n>how many.

tg polls vote

vote in a poll, or take your vote back; the others see it unless the poll is anonymous

Changes something in Telegram.

tg polls vote <chat> <message> [answers] [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe id of the message that carries the poll.
answersoptionalanswer ids, as polls show prints them.
OptionWhat it does
--retracttake your vote back.

tg polls close

close your own poll; nobody can vote after that, and it cannot be reopened

Changes something in Telegram.

tg polls close <chat> <message>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequiredthe id of your own message that carries the poll.

tg polls create

send a poll to a chat, as a message of its own; public unless --anonymous

Changes something in Telegram.

tg polls create <chat> <question> <answers> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
questionrequiredthe question.
answersrequiredtwo answers or more.
OptionWhat it does
--topic <id>send to this forum topic; unsupported by messengers without topics.
--multiplepeople may pick several answers.
--anonymousnobody sees who voted for what.
--revotepeople may change their vote.
--silentsend without a notification.
--send-as <id>post as one of the identities chats send-as lists; required where the chat posts as someone else by default.
--send-id <id>repeat a create whose outcome was unknown, without risking a second poll.
--quiza quiz: one answer is right, and a vote is final.
--correct <n>with --quiz: the right answer's position, from 1.
--solution <text>with --quiz: what people see once they answered.
--close-time <delay>it closes by itself this long after sending: 5s to 10m, like 90s or 5m.

tg models

models that run on this machine

tg models audio

speech models for transcribing voice messages

tg models audio list

the speech models, most suitable first, which are downloaded, and which one is the default

tg models audio list

tg models audio download

download a speech model once, checked against the sha256 this version expects

tg models audio download <model>
ArgumentRequirementWhat it is
modelrequireda model id from models audio list.

tg models text

embedding models for searching conversations by meaning

tg models text list

the embedding models, most suitable first, which are downloaded, and which one is the default

tg models text list

tg models text download

download an embedding model once, checked against the sha256 this version expects

tg models text download <model> [options]
ArgumentRequirementWhat it is
modelrequireda model id from models text list.
OptionWhat it does
--accept-termsaccept the model's licence terms, for a model that has its own.

tg models text key

API keys for embedding and analysis providers

tg models text key set

store a key, typed at a hidden prompt or piped on stdin — never as an argument

tg models text key set <provider>
ArgumentRequirementWhat it is
providerrequiredopenai, anthropic, or the host of a --base-url server that wants a key.

tg models text key remove

forget a stored key

tg models text key remove <provider>
ArgumentRequirementWhat it is
providerrequiredopenai, anthropic, or a server's host.

tg inbox

other people's unread messages in every chat; --new for what arrived since the last check

tg inbox [options]
OptionWhat it does
--newwhat arrived since the last check, each message once — for scheduled runs.
--since-time <time>what arrived after this ISO 8601 time, or 2h / 1d ago; the saved point stays put.
--limit <n>at most this many per chat, the newest.
--allmuted and archived chats too — left out unless they mention you or reply to you.
--kind <kinds>only chats of these kinds, comma-separated: dialog, group, channel, saved.
--transcribeturn voice messages not heard yet into text — by the messenger, or a model on this machine; can take minutes.
--model <id>which downloaded speech model hears them, with --transcribe; models audio list shows them.
--mark-readalso mark each chat shown read, up to the newest message shown; the other side sees it.
--no-mark-readdo not, whatever the catchUpMarksRead setting says.

tg review

every message, yours too, in chats that changed since a point — for reviewing who owes what

tg review [options]
OptionWhat it does
--since-time <time>where the last review ended — ISO 8601, or 2h / 1d ago; 3 days ago if not given.
--chat <chat>only this chat: a chat: its title or part of it, its id, @username, or me for Saved Messages.
--kind <kinds>only chats of these kinds, comma-separated: dialog, group, channel, saved.
--unanswered [duration]only questions to you or a group's admins that nobody answered, asked at least this long ago — 4h, 1d; 24h if not given.
--allmuted and archived chats too — left out unless they mention you or reply to you.
--transcribeturn voice messages not heard yet into text — by the messenger, or a model on this machine; can take minutes.
--model <id>which downloaded speech model hears them, with --transcribe; models audio list shows them.
--newwhat changed since the last review --new, a point per chat — for scheduled runs.
--mark-readalso mark each chat shown read, up to the newest message shown; the other side sees it.
--no-mark-readdo not, whatever the catchUpMarksRead setting says.

tg topics

the topics of a forum group

tg topics list

a forum group's topics, newest activity first

tg topics list <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--limit <n>how many to show.
--page <n>which page, starting at 1.
--allevery row, no paging.

tg topics show

one forum topic: its title, state and last activity

tg topics show <chat> <topic>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
topicrequiredthe topic id, from topics list.

tg topics enable

enable forum topics; only the owner, with an explicit upgrade for a basic group

Changes something in Telegram.

tg topics enable <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--upgradeupgrade a basic group to a supergroup first; its chat id changes.

tg topics create

create a named topic in an existing forum; never enable or upgrade a group implicitly

Changes something in Telegram.

tg topics create <chat> <title> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
titlerequiredthe topic title, at most 128 UTF-8 bytes.
OptionWhat it does
--send-id <id>identify this creation attempt; an already sent or unknown id is refused.

tg topics edit

rename, close or reopen a forum topic

Changes something in Telegram.

tg topics edit <chat> <topic> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
topicrequiredthe topic id, from topics list.
OptionWhat it does
--title <title>the new title, at most 128 UTF-8 bytes.
--closed <on|off>on closes the topic to new messages, off reopens it.
--pinned <on|off>on pins the topic at the top of the list, off unpins it.
--hidden <on|off>on hides the General topic from the topic list, off shows it.

tg topics delete

delete a forum topic and every message in it, for everyone; it cannot be undone

Changes something in Telegram.

tg topics delete <chat> <topic> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
topicrequiredthe topic id, from topics list.
OptionWhat it does
--allow-dangerousgo ahead without the question an ask level puts before a deletion.

tg topics order

put the pinned topics in this order; it pins and unpins nothing

Changes something in Telegram.

tg topics order <chat> <topic>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
topicrequiredthe pinned topics' ids, first to last.

tg watch

print new messages as they arrive, until Ctrl-C or --timeout (either ends it normally)

tg watch [options]
OptionWhat it does
--eventsalso edits, deletions and reactions; every line then names its event.

tg serve

keep the local store current until stopped — what a systemd or launchd unit runs

tg serve

tg server

tg serve in the background: start, stop, restart, status, logs; install adds a systemd or launchd unit

tg server start

start serve in the background — through the unit if one is installed — and answer once it connects

tg server start

tg server stop

stop this profile's serve — through the unit if it runs under one

tg server stop

tg server restart

stop it and start it again

tg server restart

tg server status

whether serve runs for this profile, since when, who started it, and the unit if there is one

tg server status

tg server logs

serve's latest log lines — from the journal under systemd, else its log file

tg server logs [options]
OptionWhat it does
-n, --lines <n>how many lines. Default: 50.

tg server install

write a systemd user unit or a launchd agent for this profile; starts nothing

tg server install

tg server uninstall

remove this profile's unit; stop it first

tg server uninstall

tg store

the local store of messages

tg store status

per chat: messages stored, the oldest and newest, and the stretches held completely

tg store status [chat]
ArgumentRequirementWhat it is
chatoptionala chat: its title or part of it, its id, @username, or me for Saved Messages.

tg store fetch

fetch a chat's history into the local store, newest first; run it again to continue; --all fetches every chat

tg store fetch [chat] [options]
ArgumentRequirementWhat it is
chatoptionala chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--allevery chat, most recently active first — what search needs; the last 90d unless --since-time or --last.
--limit <n>at most this many messages in this run, per chat with --all; 1000 if not given.
--page-size <n>how many messages one request asks for; 100 if not given.
--pause <duration>pause between pages, to stay under the provider's limits. Default: 1s.
--since-time <time>stop once it reaches messages older than this: ISO 8601, or 2h / 1d ago.
--last <n>stop once the newest n messages are held.
--catch-upprepare local search after fetch; overrides searchCatchUp.
--no-catch-upskip local preparation after this fetch.
--catch-up-chunks <n>at most this many local vector chunks.
--catch-up-messages <n>skip a graph rebuild larger than this many messages.
--catch-up-time <duration>local preparation time budget, 30s by default.
--backgroundrun as a job that outlives this command; store jobs show follows it.
--estimateonly estimate how many messages, requests and minutes a full fetch would still take — from the store, no request.

tg store gaps

inspect recorded interior coverage gaps and explicitly fetch them

tg store gaps plan

local coverage plan; missing message ids alone do not imply missing history

tg store gaps plan <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg store gaps repair

fetch bounded interior gaps and recheck coverage; never delete unseen messages

tg store gaps repair <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--limit <n>total messages in this repair, 500 by default.
--max-gaps <n>at most this many gaps, 5 by default.
--repair-time <duration>time budget for the repair, 30s by default. Default: 30s.
--page-size <n>messages per provider page.
--pause <duration>provider pause between pages. Default: 1s.
--fingerprint <hash>refuse if this previously inspected coverage plan changed.
--catch-upprepare local search after repair; overrides searchCatchUp.
--no-catch-upskip local search preparation after repair.
--catch-up-chunks <n>maximum local chunks prepared.
--catch-up-messages <n>maximum stored messages read for preparation.
--catch-up-time <duration>preparation time within the repair's remaining budget.
--backgroundrepair as an existing store job; inspect store jobs show.

tg store jobs

background fetch jobs

tg store jobs list

background fetch jobs, newest first

tg store jobs list [options]
OptionWhat it does
--state <state>only jobs in this state. One of: running, done, failed, cancelled, died.

tg store jobs show

one background job — the newest when none is named — and what the store now holds of its chat

tg store jobs show [job]
ArgumentRequirementWhat it is
joboptionalthe job id store fetch --background printed.

tg store jobs cancel

stop a running background job after its current page; a later fetch resumes where it stopped

tg store jobs cancel <job>
ArgumentRequirementWhat it is
jobrequiredthe job id.

tg store jobs retry

start a failed or died job again, as a new job; the fetch resumes where the store stopped

tg store jobs retry [job] [options]
ArgumentRequirementWhat it is
joboptionalthe job id.
OptionWhat it does
--failedevery chat whose newest job failed or died.

tg store jobs clear

forget finished jobs and remove their logs; a running job is kept

Changes something on this computer only.

tg store jobs clear

tg store export

a chat's stored messages as JSON lines, oldest first; never asks the messenger

tg store export [chats] [options]
ArgumentRequirementWhat it is
chatsoptionala chat: its title or part of it, its id, @username, or me for Saved Messages; several with --to.
OptionWhat it does
--format <format>jsonl (the default): one message per line; markdown: a transcript with a heading per day, replies and forwards quoted.
--since-time <time>only from this ISO 8601 time, or 30m / 2h / 1d ago, on.
--output <file>write JSON lines, or the transcript, to this new file, readable only by you.
--to <dir>write into this folder, a file per chat and a manifest; run again on it for only what changed since.
--kind <kinds>with --to: every stored chat of these kinds, comma-separated: dialog, group, channel, saved.
--allwith --to: every stored chat of this account.
--encryptcompress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept — lose it and the file cannot be opened.

tg store clear

delete from the store the chats this account has left, with their messages

tg store clear [options]
OptionWhat it does
--leftthe chats this account has left — the only thing this clears.
--allow-dangerousyes, delete — it cannot be undone, and a chat you left cannot be fetched again.

tg store info

the store file: where it is, its size, its schema and how many rows it holds; changes nothing

tg store info

tg store check

whether the store is healthy — integrity, search indexes, disk, and which chats are behind

tg store check

tg store migrate

bring the store up to this build's schema, then normalize, index and stem the messages and notes stored before it

tg store migrate

tg store reindex

rebuild the word index, its typo vocabulary, the stems, the files' word index and the notes' indexes from what is stored; loses nothing

tg store reindex

tg store backup

copy the store into a new file, while it is in use; never overwrites a file

tg store backup <file> [options]
ArgumentRequirementWhat it is
filerequiredthe new file.
OptionWhat it does
--encryptcompress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept — lose it and the file cannot be opened.

tg store restore

put a backup in place of the store; the store it replaces is kept beside it, never deleted

tg store restore <file>
ArgumentRequirementWhat it is
filerequireda file store backup wrote; one written with --encrypt asks for its password.

tg store decrypt

open a file written with --encrypt into a new file; asks for its password

tg store decrypt <file> [options]
ArgumentRequirementWhat it is
filerequireda file store backup --encrypt or store export --encrypt wrote.
OptionWhat it does
--output <file>the new file, readable only by you.

tg store repair

bring every table to this build's shape, deleting nothing: a table of the wrong shape is kept as a copy beside a new one

tg store repair [options]
OptionWhat it does
--dry-runsay what it would do, and change nothing.

tg store copies

the tables store repair kept as copies

tg store copies delete

delete one copy store repair kept, named exactly; refuses any other table

tg store copies delete <name>
ArgumentRequirementWhat it is
namerequiredthe copy's name, as store repair printed it.

tg conversations

the conversations inside a chat, found in the stored messages by replies, mentions and who wrote next

tg conversations build

find a chat's conversations in what the store holds, replacing the last build; without --chat, every chat that changed since its build and every group never built; never asks the messenger

tg conversations build [options]
OptionWhat it does
--chat <chat>a chat: its title or part of it, its id, @username, or me for Saved Messages.
--analyzelink batches using the configured analysis provider; requires --chat and remembers consent for this chat/provider.
--provider <provider>analysis: agent, openai or anthropic.
--model <model>analysis model; overrides analysisModel.
--base-url <url>analysis API endpoint; overrides analysisBaseUrl.
--size <n>analysis answer messages per batch, 10–200; default 50.
--max-tokens <n>analysis input/output reservation cap per run; default 100000.
--max-chats <n>at most this many chats in one run; 20 if not given.

tg conversations list

a chat's conversations, the newest first: when, how many messages, how many people

tg conversations list [options]
OptionWhat it does
--chat <chat>a chat: its title or part of it, its id, @username, or me for Saved Messages.
--since-time <time>only those that started at this ISO 8601 time, or 30m / 2h / 1d ago, or later.
--limit <n>how many.

tg conversations show

one conversation's messages, oldest first — by its id, or the one a message is in

tg conversations show <conversation> [message]
ArgumentRequirementWhat it is
conversationrequireda conversation id from conversations list; or a chat: its title or part of it, its id, @username, or me for Saved Messages, with a message.
messageoptionala message id in that chat: show the conversation it is in.

the conversations nearest in meaning to the one a message is in, in every built chat, best first — from the vectors conversations embed stored; runs no model

tg conversations related <chat> <message> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
messagerequireda message id in that chat.
OptionWhat it does
--limit <n>how many.
--model <model>local: a model id from models text list (default: e5-small); remote: the provider's model.
--provider <provider>embedding provider: local or openai; flags override profile settings.
--base-url <url>a server with OpenAI's /v1/embeddings: Gemini, Jina, or Ollama and LM Studio on this machine.
--dims <n>remote: the vector size — needed with --base-url; shortens an OpenAI model's.

tg conversations status

how fresh each built chat's conversations and vectors are: messages the build has not seen, chunks with a current, stale or missing vector

tg conversations status [options]
OptionWhat it does
--chat <chat>only this chat: a chat: its title or part of it, its id, @username, or me for Saved Messages.
--model <model>local: a model id from models text list (default: e5-small); remote: the provider's model.
--provider <provider>embedding provider: local or openai; flags override profile settings.
--base-url <url>a server with OpenAI's /v1/embeddings: Gemini, Jina, or Ollama and LM Studio on this machine.
--dims <n>remote: the vector size — needed with --base-url; shortens an OpenAI model's.

tg conversations batches

windows of a chat for your own AI agent to link: which earlier message each one answers

tg conversations batches status

how many messages still wait for an answer, in how many batches, and how much text

tg conversations batches status [options]
OptionWhat it does
--chat <chat>a chat: its title or part of it, its id, @username, or me for Saved Messages.
--size <n>messages to answer per batch, 10–200; 50 by default.

tg conversations batches next

the next window to answer, with the messages before it; message text goes to stdout only

tg conversations batches next [options]
OptionWhat it does
--chat <chat>a chat: its title or part of it, its id, @username, or me for Saved Messages.
--size <n>messages to answer per batch, 10–200; 50 by default.

your agent's answers: which earlier message each message of a batch answers

store your agent's answer to a batch, read as JSON from stdin: { "model", "answers": [{ "message", "parent", "confidence" }] }; all or nothing

tg conversations links add [options]
OptionWhat it does
--batch <id>the batch id conversations batches next printed.

drop your agent's answers for a chat, or only one model's; messages are never touched

tg conversations links clear [options]
OptionWhat it does
--chat <chat>a chat: its title or part of it, its id, @username, or me for Saved Messages.
--model <model>only the answers this model gave.

tg conversations consents

remembered analysis permissions for this account's chats and provider endpoints

tg conversations consents list

tg conversations consents list

tg conversations consents revoke

tg conversations consents revoke [options]
OptionWhat it does
--chat <chat>revoke only this chat's consents; defaults to every chat.
--provider <identity>exact provider identity from consents list; defaults to every provider.

tg conversations embed

compute a vector for each chunk of a chat's conversations for search by meaning — on this machine, or with --provider through a service and your key; resumes where it stopped; without --chat, every built chat with chunks left, on this machine only

tg conversations embed [options]
OptionWhat it does
--chat <chat>a chat: its title or part of it, its id, @username, or me for Saved Messages.
--model <model>local: a model id from models text list (default: e5-small); remote: the provider's model.
--provider <provider>embedding provider: local or openai; flags override profile settings.
--base-url <url>a server with OpenAI's /v1/embeddings: Gemini, Jina, or Ollama and LM Studio on this machine.
--dims <n>remote: the vector size — needed with --base-url; shortens an OpenAI model's.
--workers <n>local: sessions in parallel, each with its own copy of the model (~0.7 GB each).
--threads <n>local: threads in all (default: min(8, cores)).
--concurrency <n>remote: requests at once (default: 4).
--max-tokens <n>remote: stop before a run that could send more tokens than this.
--max-chats <n>at most this many chats in one run; 20 if not given.
--max-chunks <n>at most this many chunks embedded in one run; 2000 if not given, and no limit with --chat.

tg conversations embed status

how many chunks of a chat have a vector of the model, how many are left, and what is left costs

tg conversations embed status [options]
OptionWhat it does
--chat <chat>a chat: its title or part of it, its id, @username, or me for Saved Messages.
--model <model>local: a model id from models text list (default: e5-small); remote: the provider's model.
--provider <provider>embedding provider: local or openai; flags override profile settings.
--base-url <url>a server with OpenAI's /v1/embeddings: Gemini, Jina, or Ollama and LM Studio on this machine.
--dims <n>remote: the vector size — needed with --base-url; shortens an OpenAI model's.

tg conversations embed clear

drop a chat's vectors, or only one model's; messages and conversations are never touched

tg conversations embed clear [options]
OptionWhat it does
--chat <chat>a chat: its title or part of it, its id, @username, or me for Saved Messages.
--model <model>local: a model id from models text list (default: e5-small); remote: the provider's model.
--provider <provider>embedding provider: local or openai; flags override profile settings.
--base-url <url>a server with OpenAI's /v1/embeddings: Gemini, Jina, or Ollama and LM Studio on this machine.
--dims <n>remote: the vector size — needed with --base-url; shortens an OpenAI model's.

tg attachments

the files of stored messages: their text in the local store, for content: in a search

tg attachments extract

read the text of downloaded files — text, PDF/DOCX text layers, ODT/ODS/XLSX/PPTX/EPUB — into the local store, for content: in a search

tg attachments extract [options]
OptionWhat it does
--chat <chat>only this chat's files; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--from-dir <dir>match files in this nonrecursive directory; needs --chat.
--cursor <cursor>continue from the cursor returned by a bounded extraction.
--downloadfirst save the files no download saved yet, from the messenger, into --output-dir.
--output-dir <dir>with --download, where to save them; created if missing.
--limit <n>read at most this many files; run it again to continue.
--ocrexplicitly call models.ocr for bulk image and scanned-PDF text extraction.
--concurrency <n>remote: requests at once (default: 4).

tg attachments list

files of stored messages, where each was saved and whether its text is held — never the text

tg attachments list [options]
OptionWhat it does
--chat <chat>only this chat's files; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--needs-textonly files saved here whose text nobody has yet: what an agent reads and writes back.
--limit <n>how many to show.
--page <n>which page, starting at 1.
--allevery row, no paging.

tg attachments show

read a bounded chunk of one retained attachment; JSON includes base64 bytes

tg attachments show <chat> [message] [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages; or a msg: locator alone.
messageoptionalthe message id.
OptionWhat it does
--attachment <n>file position from 1; required for several files.
--page <n>render one PDF page as PNG, from 1; optional unpdf/canvas, no OCR.
--offset-bytes <n>byte offset from 0.
--chunk-bytes <n>bytes to return, 1–1048576 (default524288).
--if-sha256 <hash>require the whole file SHA-256 from the preceding chunk.

tg attachments text

the text of one file, as an agent read it

tg attachments text set

keep the text an agent read from a file — a scan, a photo — so content: finds it; nothing is sent

tg attachments text set <chat> [message] [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages; or a msg: locator, with no message id after it.
messageoptionalthe message id.
OptionWhat it does
--attachment <n>which file of the message, from 1; needed when it has more than one.
--text-file <path>read the text from this file; - or none reads stdin.

tg tags

your own labels on chats, people and messages, kept in the local store and never sent; tag: in a search finds them

tg tags auto

derive local group/channel tags from cached metadata using keyword rules

Changes something on this computer only.

tg tags auto [options]
OptionWhat it does
--chat <chat>a stored group/channel; repeat to select several. Default: ``.
--limit <number>process at most 1–500 chats. Default: 50.
--refresh-metadataread current descriptions from the messenger before classifying.
--dry-runpreview cached classification without changing the store.

tg tags add

put tags on one chat, person or message

Changes something on this computer only.

tg tags add <tag> [options]
ArgumentRequirementWhat it is
tagrequiredone or more tags: 1–32 letters a–z, digits and hyphens; upper case is lowered.
OptionWhat it does
--chat <chat>the chat to tag, or the chat of --message; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--contact <person>the person to tag: their id, @username or name, as the local store knows them.
--message <message>the message to tag: its id in --chat, or a msg: locator alone.

tg tags remove

take tags off one chat, person or message

Changes something on this computer only.

tg tags remove <tag> [options]
ArgumentRequirementWhat it is
tagrequiredone or more tags: 1–32 letters a–z, digits and hyphens; upper case is lowered.
OptionWhat it does
--chat <chat>the chat to untag, or the chat of --message; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--contact <person>the person to untag: their id, @username or name, as the local store knows them.
--message <message>the message to untag: its id in --chat, or a msg: locator alone.
--source <manual|auto>remove only this ownership claim.

tg tags list

what is tagged: this account's chats and messages, and the people of its messenger

tg tags list [options]
OptionWhat it does
--tag <tag>only this tag.
--source <manual|auto>only labels with this ownership claim.
--type <names>only what is tagged of this type: chat, contact or message.

tg metadata

cached group/channel descriptions for local automatic tags

tg metadata get

tg metadata get [options]
OptionWhat it does
--chat <chat>a stored chat.

tg metadata refresh

Changes something on this computer only.

tg metadata refresh [options]
OptionWhat it does
--chat <chat>stored group/channel; repeat for several. Default: ``.
--only-missingonly chats with no metadata yet; without --chat, every stored group/channel.
--limit <number>process at most 1–500 chats. Default: 50.

tg stats

statistics about messages, chats and their authors

tg stats messages

message statistics from the local store

tg stats messages show

how many stored messages match, by chat, sender, day or hour — the local store only; optionally fetches new messages with --sync-first

tg stats messages show [query] [options]
ArgumentRequirementWhat it is
queryoptionala strict Lucene query, as for search messages; none counts every stored message; with --saved, more words AND-ed to it.
OptionWhat it does
--sync-firstfirst fetch new messages within the chat, time and message bounds.
--max-chats <n>refresh at most this many chats (default: 5).
--sync-time <duration>stop fetching after this long (default: 30s).
--max-messages <n>fetch at most this many messages total (default: 500).
--by <chat|sender|day|hour>what to count by (default: chat).
--chat <chat>only this chat — the same as chat: in the query; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>every account of this messenger held in the store; personal, bots or all — the same as in: in the query.
--limit <n>how many rows.
--timezone <zone>the IANA timezone for calendar days and hours.
--exactbare words and quotes match their exact form only, as exact:word does; text: still matches every form.
--saved <name|id>count what a saved search or an earlier run matches; options typed here replace its own.

tg stats messages counters

per-counter observations and bounded remote refresh

tg stats messages counters show

show saved counter values and their observation freshness

tg stats messages counters show [query] [options]
ArgumentRequirementWhat it is
queryoptionalstrict Lucene query over stored messages.
OptionWhat it does
--chat <chat>only this chat; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>held accounts of this messenger; refresh uses the active account.
--exactbare words match exact forms.
--timezone <zone>IANA timezone for query dates.
--selection <json>pinned counter-targets selection from counters show; conflicts with query and scope.
--counters <names>distinct views,reactions,comments fields; all three by default.
--limit <n>messages, 1–100; 20 by default.
--max-age <duration>maximum fresh observation age; 24h by default.

tg stats messages counters refresh

read authoritative counters for bounded messages and update their local observations

Changes something on this computer only.

tg stats messages counters refresh [query] [options]
ArgumentRequirementWhat it is
queryoptionalstrict Lucene query over stored messages.
OptionWhat it does
--chat <chat>only this chat; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>held accounts of this messenger; refresh uses the active account.
--exactbare words match exact forms.
--timezone <zone>IANA timezone for query dates.
--selection <json>pinned counter-targets selection from counters show; conflicts with query and scope.
--counters <names>distinct views,reactions,comments fields; all three by default.
--limit <n>messages, 1–100; 20 by default.
--max-messages <n>maximum messages to refresh, 1–100.
--sync-time <duration>remote refresh budget; 30s by default, maximum 5m.
--dry-runpreview exact stored targets and counter capabilities without connecting.

tg stats messages unanswered

oldest detected questions without an observed qualifying explicit reply

tg stats messages unanswered [query] [options]
ArgumentRequirementWhat it is
queryoptionala strict Lucene query; none selects every stored message.
OptionWhat it does
--chat <chat>only this chat; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>every held account of this messenger; personal, bots or all.
--exactbare words match exact forms rather than stems.
--saved <name|id>run a saved report of this kind; typed report options replace stored options.
--timezone <zone>the IANA timezone for calendar date boundaries.
--limit <n>report rows, 1–100; 20 if not given.
--answerer <person>stored name, alias, @username, ID or person:provider/account/id; ambiguous names require a choice; repeat for more.
--older-than <duration>minimum age of a question without an observed qualifying answer.

tg stats messages discussion

viewed posts with little recorded discussion

tg stats messages discussion [query] [options]
ArgumentRequirementWhat it is
queryoptionala strict Lucene query; none selects every stored message.
OptionWhat it does
--chat <chat>only this chat; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>every held account of this messenger; personal, bots or all.
--exactbare words match exact forms rather than stems.
--saved <name|id>run a saved report of this kind; typed report options replace stored options.
--timezone <zone>the IANA timezone for calendar date boundaries.
--limit <n>report rows, 1–100; 20 if not given.
--min-views <n>minimum known cumulative views.
--max-replies <n>maximum observed discussion replies.

tg stats messages top

rank stored messages by a measure or explainable score; counters are snapshots with per-field observation freshness

tg stats messages top [query] [options]
ArgumentRequirementWhat it is
queryoptionala strict Lucene query; none selects every stored message.
OptionWhat it does
--sync-firstfirst fetch new messages within the chat, time and message bounds.
--max-chats <n>refresh at most this many chats (default: 5).
--sync-time <duration>stop fetching after this long (default: 30s).
--max-messages <n>fetch at most this many messages total (default: 500).
--measure <name>the ranking metric; not with score or weights. One of: views, reactions, forwards, comments, replies, thread-size.
--score <preset>helpful/active for authors; engaging for either target. One of: helpful, active, engaging.
--weights <json>the complete component weights; replaces preset weights.
--message-kind <kind>select proven all, posts or comments before ranking. One of: all, posts, comments.
--chat <chat>only this chat; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>every held account of this messenger; personal, bots or all.
--timezone <zone>the IANA timezone for dates and active days.
--exactbare words match exact forms rather than stems.
--limit <n>ranked rows, 1–100.
--saved <name|id>run a saved query or ranking run; typed options replace stored options.

tg stats messages evidence

bounded messages, answer pairs or retention members from an exact drilldown selection

tg stats messages evidence <message> [options]
ArgumentRequirementWhat it is
messagerequiredthe canonical message locator, or retention cohort reference, from drilldown.
OptionWhat it does
--selection <json>the resolved ranking selection returned in drilldown.
--component <name>the exposed ranking component.
--limit <n>evidence rows, 1–100; 20 if not given.
--cursor <cursor>continue the same component and stored-evidence fingerprint.

tg stats contacts

statistics about human authors

tg stats contacts responses

counts and median/p90 latency for selected human answering identities

tg stats contacts responses [query] [options]
ArgumentRequirementWhat it is
queryoptionala strict Lucene query; none selects every stored message.
OptionWhat it does
--chat <chat>only this chat; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>every held account of this messenger; personal, bots or all.
--exactbare words match exact forms rather than stems.
--saved <name|id>run a saved report of this kind; typed report options replace stored options.
--timezone <zone>the IANA timezone for calendar date boundaries.
--limit <n>report rows, 1–100; 20 if not given.
--answerer <person>stored name, alias, @username, ID or person:provider/account/id; ambiguous names require a choice; repeat for more.

tg stats contacts top

rank the human authors of stored messages by a measure or explainable score; counters are snapshots with per-field observation freshness

tg stats contacts top [query] [options]
ArgumentRequirementWhat it is
queryoptionala strict Lucene query; none selects every stored message.
OptionWhat it does
--sync-firstfirst fetch new messages within the chat, time and message bounds.
--max-chats <n>refresh at most this many chats (default: 5).
--sync-time <duration>stop fetching after this long (default: 30s).
--max-messages <n>fetch at most this many messages total (default: 500).
--measure <name>the ranking metric; not with score or weights. One of: messages, words, reactions, replies, answers, answer-time, threads, active-days.
--score <preset>helpful/active for authors; engaging for either target. One of: helpful, active, engaging.
--weights <json>the complete component weights; replaces preset weights.
--message-kind <kind>select proven all, posts or comments before ranking. One of: all, posts, comments.
--chat <chat>only this chat; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>every held account of this messenger; personal, bots or all.
--timezone <zone>the IANA timezone for dates and active days.
--exactbare words match exact forms rather than stems.
--limit <n>ranked rows, 1–100.
--saved <name|id>run a saved query or ranking run; typed options replace stored options.
--min-messages <n>minimum selected messages per author; 1, or 5 for engaging.

tg stats contacts evidence

bounded messages, answer pairs or retention members from an exact drilldown selection

tg stats contacts evidence <person> [options]
ArgumentRequirementWhat it is
personrequiredthe exact native person id from the ranking row.
OptionWhat it does
--selection <json>the resolved ranking selection returned in drilldown.
--component <name>the exposed ranking component.
--limit <n>evidence rows, 1–100; 20 if not given.
--cursor <cursor>continue the same component and stored-evidence fingerprint.

tg stats chats

statistics about one chat

tg stats chats show

a group's or channel's numbers for a period: messages, active members, replies, reactions, questions answered, joins and leaves — counted from the local store; joins and leaves are asked of the messenger

tg stats chats show <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--since-time <time>ISO 8601, or 2h / 1d ago; 7 days ago if not given.
--by <day|week>also one row per calendar day or week (weeks start on Monday).
--timezone <zone>the IANA timezone for calendar days.

tg stats chats newcomers

known-join members and their help within a join window

tg stats chats newcomers <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--since-time <time>from this ISO 8601 time, or 2h / 1d ago; 30d ago if not given.
--until-time <time>through this ISO 8601 time, or 2h / 1d ago.
--within <duration>the help window after a known newcomer join.
--saved <name|id>run a saved report of this kind; typed report options replace stored options.
--timezone <zone>the IANA timezone for calendar date boundaries.
--limit <n>report rows, 1–100; 20 if not given.
--answerer <person>stored name, alias, @username, ID or person:provider/account/id; ambiguous names require a choice; repeat for more.

tg stats chats retention

joining cohorts and observed checkpoint membership from saved roster observations

tg stats chats retention <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--since-time <time>joining period starts at ISO 8601 or a relative time; last 90 days by default.
--until-time <time>joining period ends at this time; now by default.
--checkpoints <durations>up to 10 increasing joining ages, comma separated; 1d,7d,30d by default.
--within <duration>activity and early departure window after joining; 7d by default.
--by <day|week>group joining dates by calendar day or Monday week. One of: day, week.
--timezone <zone>IANA timezone for joining cohorts.
--limit <n>cohorts and member evidence, 1–100.

tg stats chats official

what Telegram itself computed for a group or channel you administer: totals against the previous period, top people and every graph as JSON series; the messenger picks the period

tg stats chats official <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg stats tasks

task statistics

tg stats tasks show

per chat: how many tasks are open, the oldest open one, the median time to close

tg stats tasks show [options]
OptionWhat it does
--chat <chat>only this chat; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--type <name>only this type: question, request, mention or promise.

tg stats charts

a chart's data from a chat's statistics, and optionally a dark SVG or PNG image

tg stats charts <chat> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
OptionWhat it does
--chart-kind <messages|active|membership>what to draw: messages, active authors, or joins and leaves. Default: messages.
--by <day|week>one point per calendar day or week (weeks start on Monday). Default: day.
--since-time <time>ISO 8601, or 2h / 1d ago; 7 days ago if not given.
--timezone <zone>the IANA timezone for calendar days.
--output <file>write a dark image to a new .svg or .png file.

tg tasks

what waits on you — unanswered questions, mentions, requests, promises — kept in the local store; review and serve add them

tg tasks list

tasks, oldest first, with their message or note source

tg tasks list [options]
OptionWhat it does
--state <state>only tasks in this state: open, done or dismissed.
--chat <chat>only this chat's tasks; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--type <names>only these types, comma-separated: question, request, mention, promise.
--before-time <time>only tasks opened before this ISO 8601 time, or 2h / 1d ago.
--limit <n>how many.

tg tasks add

add a task for a stored message or note — a promise, a request

tg tasks add <message> [options]
ArgumentRequirementWhat it is
messagerequireda message locator, msg:///, or note:.
OptionWhat it does
--type <name>the task's type: question, request, mention or promise.

tg tasks close

close a task: done, or dismissed when it needs no answer; a closed task stays closed

tg tasks close <task> [options]
ArgumentRequirementWhat it is
taskrequiredthe task's id, as tasks list shows it.
OptionWhat it does
--as <state>how it is closed: done, or dismissed — it needs no answer.
--reason <text>why, kept with the task — no-reply-needed, for example.

find things by text: search all for everything the local store holds, or one resource

tg search all

search everything the local store holds — messenger messages, mail and notes — best match first; start here when you do not know where something was written

tg search all <query> [options]
ArgumentRequirementWhat it is
queryrequiredstrict Lucene query: words, "phrases", AND/OR/NOT, field groups and date ranges.
OptionWhat it does
--only <resources>only these, separated by commas: messages, mail, notes.
--limit <n>how many.
--exactbare words and quotes match their exact form only, as exact:word does.
--timezone <zone>the IANA timezone for calendar date boundaries.

tg search messages

search messenger messages in the local store and on the messenger's server (--backend); optionally fetches new messages with --sync-first

tg search messages [query] [options]
ArgumentRequirementWhat it is
queryoptionalstrict Lucene query: words, "phrases", AND/OR/NOT, field groups and date ranges; --language legacy keeps discovery; with --saved, more words AND-ed to it.
OptionWhat it does
--sync-firstfirst fetch new messages within the chat, time and message bounds.
--max-chats <n>refresh at most this many chats (default: 5).
--sync-time <duration>stop fetching after this long (default: 30s).
--max-messages <n>fetch at most this many messages total (default: 500).
--threadthe stored reply chain and replies instead of time neighbours; falls back when no graph exists.
--thread-hops <n>at most this many links from the hit (default: 8).
--thread-messages <n>at most this many messages in each thread context (default: 50).
--thread-bytes <n>at most this many bytes of whole messages and links in each context (default: 65536).
--thread-within <duration>messages within this long either side of the hit (default: 1d).
--backend <archive|server|both>where to search: the local archive, the messenger's server, or both (default: both).
--server-time <duration>stop waiting for the server after this long (default: 5s).
--chat <chat>only this chat — the same as chat: in the query; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>every account of this messenger held in the store; personal, bots or all — the same as in: in the query.
--type <text|voice|file>only messages of this type: text alone, a voice message, or a file.
--limit <n>how many.
--newestnewest first instead of best first.
--exactbare words and quotes match their exact form only, as exact:word does; text: still matches every form.
--context <n>messages before and after each hit; 2 in the terminal, 0 otherwise.
--language <lucene|legacy>the query language: strict Lucene or legacy discovery.
--timezone <zone>the IANA timezone for calendar date boundaries.
--regexthe words are one regular expression, case-insensitive, tested against every stored text.
--saved <name|id>run a saved search or an earlier run; options typed here replace its own.

tg search mail

search the mail imported into the local store — memo mail import brings it in

tg search mail [query] [options]
ArgumentRequirementWhat it is
queryoptionalstrict Lucene query: words, "phrases", AND/OR/NOT, field groups and date ranges.
OptionWhat it does
--chat <chat>only this mail thread, by id or subject.
--limit <n>how many.
--newestnewest first instead of best first.
--exactbare words and quotes match their exact form only, as exact:word does; text: still matches every form.
--context <n>messages before and after each hit; 2 in the terminal, 0 otherwise.
--timezone <zone>the IANA timezone for calendar date boundaries.

tg search notes

search the notes — written in memo, or imported from a notes folder — by words and, with the local text model, by meaning; each hit says which found it and what it links to

tg search notes <query> [options]
ArgumentRequirementWhat it is
queryrequiredstrict Lucene query: words, "phrases", AND/OR/NOT, tag: and date ranges.
OptionWhat it does
--type <internal|file>only notes written in memo, or only notes from a folder.
--folder <id>only this notes folder, by its id; repeat it for more.
--tag <tag>only notes with this tag.
--filter <query>a query every hit must also match; it does not change the search by meaning.
--limit <n>how many.
--offset <n>skip this many, for the next page.
--exactwords as written only; meaning is not searched.
--timezone <zone>the IANA timezone for calendar date boundaries.

tg search conversations

the conversations nearest to a query in meaning and in words, best first, in one chat or every one — meaning after conversations embed; runs on this machine

tg search conversations <query> [options]
ArgumentRequirementWhat it is
queryrequiredwhat to look for, in your own words, in any language the model reads.
OptionWhat it does
--model <model>local: a model id from models text list (default: e5-small); remote: the provider's model.
--provider <provider>embedding provider: local or openai; flags override profile settings.
--base-url <url>a server with OpenAI's /v1/embeddings: Gemini, Jina, or Ollama and LM Studio on this machine.
--dims <n>remote: the vector size — needed with --base-url; shortens an OpenAI model's.
--max-chats <n>at most this many chats; 5 with --sync-first, 20 with --refresh if not given.
--max-chunks <n>at most this many chunks embedded in one run; 2000 if not given.
--sync-firstfirst fetch new messages within the chat, time and message bounds.
--sync-time <duration>stop fetching after this long (default: 30s).
--max-messages <n>fetch at most this many messages total (default: 500).
--chat <chat>only this chat: a chat: its title or part of it, its id, @username, or me for Saved Messages.
--since-time <time>only those still going at this ISO 8601 time, or 30m / 2h / 1d ago, or later.
--filter <query>strict Lucene filter: any message in a conversation must match; does not change the meaning query.
--source <source>accounts to search: personal, bots, all, or a provider; defaults to the active account.
--timezone <zone>IANA timezone for filter dates; system timezone by default.
--limit <n>how many.
--refreshfirst build and embed, on this machine, the chats in scope that changed or were never built — within --max-chats and --max-chunks.

tg search topics

a forum group's topics whose title matches

tg search topics <chat> <text> [options]
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.
textrequiredwords from the topic's title.
OptionWhat it does
--limit <n>how many to show.
--page <n>which page, starting at 1.
--allevery row, no paging.

tg searches

saved searches and the history of search messages and stats messages show, kept in the local store; --saved runs one

tg searches create

save a search under a name without running it; search messages --saved runs it

tg searches create <name> [query] [options]
ArgumentRequirementWhat it is
namerequiredup to 64 letters a–z, digits and hyphens, not only digits.
queryoptionalthe query, as for search messages; none matches every stored message.
OptionWhat it does
--chat <chat>only this chat — the same as chat: in the query; a chat: its title or part of it, its id, @username, or me for Saved Messages.
--source <messenger>every account of this messenger held in the store; personal, bots or all — the same as in: in the query.
--limit <n>how many.
--newestnewest first instead of best first.
--exactbare words and quotes match their exact form only, as exact:word does; text: still matches every form.
--context <n>messages before and after each hit.
--language <lucene|legacy>the query language: strict Lucene or legacy discovery.
--timezone <zone>the IANA timezone for calendar date boundaries.
--regexthe words are one regular expression, case-insensitive, tested against every stored text.
--by <chat|sender|day|hour>what stats messages show --saved counts by.
--selection <json>save the resolved parent ranking query and options from a drilldown.
--replaceoverwrite a saved search of the same name.

tg searches show

one saved search or earlier run: its query, options and how often it ran

tg searches show <name|id>
ArgumentRequirementWhat it is
name|idrequireda saved search's name, or the id of any row of searches history.

tg searches list

the saved searches, by name

tg searches list

tg searches history

the searches and counts that ran, newest first — saved ones included; never their results

tg searches history [options]
OptionWhat it does
--limit <n>how many.

tg searches delete

delete a saved search, or one run from the history

tg searches delete <name|id>
ArgumentRequirementWhat it is
name|idrequireda saved search's name, or the id of any row of searches history.

tg searches clear

empty the history; saved searches stay

tg searches clear

tg flood

the waits Telegram asked this profile to keep, and a hold on its writes

tg flood clear

forget them, lift the hold and the profile's pace, once Telegram no longer limits the account; changes nothing there

tg flood clear

tg replies

rules that answer messages for you, kept in a file of this profile

tg replies add

add a rule with every default written out, off until you edit and enable it

Changes something on this computer only.

tg replies add <id>
ArgumentRequirementWhat it is
idrequiredlower-case letters, digits and -; unique in this profile.

tg replies on

enable one reply rule; its template must be ready

Changes something on this computer only.

tg replies on <id>
ArgumentRequirementWhat it is
idrequiredthe rule's id.

tg replies off

disable one reply rule

Changes something on this computer only.

tg replies off <id>
ArgumentRequirementWhat it is
idrequiredthe rule's id.

tg replies edit

change only the named fields of a reply rule; lists replace the whole list

Changes something on this computer only.

tg replies edit <id> [options]
ArgumentRequirementWhat it is
idrequiredthe rule's id.
OptionWhat it does
--do <actions>actions: reply, task, or both, comma-separated.
--kinds <kinds>chat kinds: dialog, group; comma-separated, empty for any.
--chats <ids>only these chat ids, comma-separated; empty for any.
--not-chats <ids>leave these chat ids out, comma-separated; empty clears.
--words <words>match any of these whole words, comma-separated; empty clears.
--questionmatch only questions.
--no-questiondo not require a question.
--mentions-merequire a mention of you or a reply to you.
--no-mentions-medo not require a mention of you or a reply to you.
--people <ids>only these sender ids, comma-separated; empty for any.
--not-people <ids>leave these sender ids out, comma-separated; empty clears.
--contacts-onlymatch only contacts.
--no-contacts-onlydo not require a contact.
--template <text>the reply template.
--model <mode>legacy template mode: fill-only or may-reword; use ai blocks instead.
--as-replysend as a reply to the matched message.
--no-as-replysend without linking to the matched message.
--per-chat <limit>at most this many per chat, such as 1/12h.
--per-person <limit>at most this many per person, such as 1/1d.
--outside <hours>answer outside this 24-hour window, such as 09:00-19:00.
--days <days>days of the working window, such as mon-fri or sat,sun.
--timezone <zone>the IANA timezone for the working window.
--no-hoursclear the working window.

tg replies audience

show the profile's reply audience, or replace its named fields; testers still limit answers

Changes something on this computer only.

tg replies audience [options]
OptionWhat it does
--reply <mode>answer all or only listed senders and chats: all, listed.
--allow-people <ids>replace allowed sender ids, comma-separated; empty clears.
--allow-chats <ids>replace allowed chat ids, comma-separated; empty clears.
--deny-people <ids>replace denied sender ids, comma-separated; empty clears; deny wins.
--deny-chats <ids>replace denied chat ids, comma-separated; empty clears; deny wins.

tg replies consents

consent for reply models once per profile and endpoint, with chat opt-outs

tg replies consents show

show the reply model consent and chat opt-outs; never calls a model

tg replies consents show

tg replies consents grant

allow incoming message data to go to the configured reply model for this profile; chat opt-outs remain

Changes something on this computer only.

tg replies consents grant

tg replies consents revoke

revoke the profile's reply model consent immediately; chat opt-outs remain

Changes something on this computer only.

tg replies consents revoke

tg replies consents deny

keep this chat's incoming data away from the reply model

Changes something on this computer only.

tg replies consents deny <chat>
ArgumentRequirementWhat it is
chatrequiredthe native chat id, used as written; never resolved over the network.

tg replies consents allow

remove this chat's model opt-out; does not grant profile consent

Changes something on this computer only.

tg replies consents allow <chat>
ArgumentRequirementWhat it is
chatrequiredthe native chat id, used as written; never resolved over the network.

tg replies test

what the rules would have answered in the stored messages, to whom and why — sends nothing, changes nothing, never connects

tg replies test [rule] [options]
ArgumentRequirementWhat it is
ruleoptionalonly this rule, by its id; every rule in file order if not given.
OptionWhat it does
--since-time <time>from this ISO 8601 time, or 2h / 1d ago; 7d ago if not given.
--aicall the configured reply model with stored message data; requires reply consent, otherwise uses fallback.

tg replies pause

stop every reply rule of this profile at once, a running serve too; resume undoes it

tg replies pause

tg replies resume

let the reply rules answer again after pause

tg replies resume

tg replies status

whether the rules may send, which are on, and who they may answer

tg replies status

tg recipients

the chats this profile may send to, when the list is on

tg recipients list

the chats on the list; empty and off until the first add

tg recipients list

tg recipients add

allow sending to this chat; the first add turns the list on

Changes something on this computer only.

tg recipients add <chat>
ArgumentRequirementWhat it is
chatrequireda chat: its title or part of it, its id, @username, or me for Saved Messages.

tg recipients remove

stop allowing this chat; the list stays on

Changes something on this computer only.

tg recipients remove <chat>
ArgumentRequirementWhat it is
chatrequiredchat id, or the title as the list shows it.

tg recipients clear

delete the list, which turns it off: this profile may send to any chat again

Changes something on this computer only.

tg recipients clear

tg sends

every attempt to send from this profile — never the text

tg sends list

attempts to send, newest first: sent, refused, failed, or not known

tg sends list [options]
OptionWhat it does
--limit <n>how many to show.

tg runs

recorded runs — what this tool did, and when

tg runs list

recorded runs, newest first

tg runs list [options]
OptionWhat it does
--limit <n>how many to show. Default: 20.

tg runs show

one run: what it was, and one line per operation

tg runs show <run-id>
ArgumentRequirementWhat it is
run-idrequiredan id from tg runs list.

tg runs path

the directory holding one run

tg runs path <run-id>
ArgumentRequirementWhat it is
run-idrequiredan id from tg runs list.

tg config

the settings in force, and where each one came from

tg config migrate

replace legacy access settings with permissions, preserving this file's effective levels

Changes something on this computer only.

tg config migrate [options]
OptionWhat it does
--dry-runshow the migration without writing the file.

tg config show

the profile, the profiles that exist, and each setting with where it came from

tg config show [options]
OptionWhat it does
--botthe settings a bot command on this profile gets, rather than the personal account's.

tg config set

save a setting to the configuration file

Changes something on this computer only.

tg config set <setting> <value> [options]
ArgumentRequirementWhat it is
settingrequiredone of: limit, timeoutMs, color, senderColors, record, keepRunsForDays, readOnly, allow, permissions, sendsPerHour, requestsPerMinute, transcribeWith, speechModel, catchUpMarksRead, searchCatchUp, embeddingProvider, embeddingModel, embeddingBaseUrl, embeddingDims, analysisProvider, analysisModel, analysisBaseUrl, models, proxy, readOtherBots, updateCheck, skillHint, searchStemmers.cyrillic, searchStemmers.latin.
valuerequireda number, true or false, or for allow a list like send,reaction.
OptionWhat it does
--defaultschange what every profile gets, rather than this profile.
--personalonly for personal accounts — the personal section of the file.
--botonly for bots — the bot section of the file.

tg config unset

remove a setting from the configuration file

Changes something on this computer only.

tg config unset <setting> [options]
ArgumentRequirementWhat it is
settingrequiredone of: limit, timeoutMs, color, senderColors, record, keepRunsForDays, readOnly, allow, permissions, sendsPerHour, requestsPerMinute, transcribeWith, speechModel, catchUpMarksRead, searchCatchUp, embeddingProvider, embeddingModel, embeddingBaseUrl, embeddingDims, analysisProvider, analysisModel, analysisBaseUrl, models, proxy, readOtherBots, updateCheck, skillHint, searchStemmers.cyrillic, searchStemmers.latin.
OptionWhat it does
--defaultschange what every profile gets, rather than this profile.
--personalonly for personal accounts — the personal section of the file.
--botonly for bots — the bot section of the file.

tg doctor

the state this installation is in, without connecting unless --online

tg doctor [options]
OptionWhat it does
--onlinealso connect once and read the account; sends nothing.

tg doctor report

what a problem report holds; writes nothing

tg doctor report create

write a problem report to a file, and say where to send it

tg doctor report create [options]
OptionWhat it does
--run <id>the run the report is about; the newest failed one if not given.
--output <file>where to write it; a new file in this directory if not given.

tg commands

commands, options and exit codes as JSON — inspect one command path per call

tg commands schema

one command's argv and result schemas, effects, permissions and retry guidance

tg commands schema <path>
ArgumentRequirementWhat it is
pathrequiredone command path, for example: stats messages show.

tg complete

shell completion: tg complete zsh prints the script to source

tg complete [words]
ArgumentRequirementWhat it is
wordsoptional

tg upgrade

upgrade tg with the package manager that installed it; --check only looks

tg upgrade [options]
OptionWhat it does
--checksay whether a newer version exists, and install nothing.

tg mcp

serve this profile to an agent over MCP, on stdin and stdout — claude mcp add tg -- tg mcp

tg mcp [options]
OptionWhat it does
--permission <key=level>override a permission for this server only; repeat for more keys.
--confirm-sendno longer used — writes show no form; the profile's permissions decide.
--allow-dangerousno longer used — writes show no form; the profile's permissions decide.
--allow-sendno longer used — the profile's permissions decide; kept so an old setup still starts.
--allow-mark-readno longer used — the profile's permissions decide.
--allow-deleteno longer used — the profile's permissions decide.
--httpserve over HTTP on 127.0.0.1 for ChatGPT and Claude in the browser, behind your tunnel.
--http-confirmation <mode>no longer used — writes show no form; the profile's permissions decide.
--port <port>the local port for --http (default 8765).
--public-url <url>the tunnel's https address the browser apps use, e.g. https://.ts.net.
--revokeforget every login given to a browser app; each must log in again.

tg mcp config

print the mcpServers entry for Claude Desktop, Cursor and others, with full paths; writes nothing

tg mcp config [options]
OptionWhat it does
--permission <key=level>override a permission for this server only; repeat for more keys.
--confirm-sendno longer used — writes show no form; the profile's permissions decide.
--allow-dangerousno longer used — writes show no form; the profile's permissions decide.
--allow-sendno longer used — the profile's permissions decide; kept so an old setup still starts.
--allow-mark-readno longer used — the profile's permissions decide.
--allow-deleteno longer used — the profile's permissions decide.

tg mcp setup

add this profile's local MCP server to Codex or Claude Code

Changes something on this computer only.

tg mcp setup <client> [options]
ArgumentRequirementWhat it is
clientrequiredcodex or claude-code.
OptionWhat it does
--allow-writesacknowledge that this profile offers writing tools.
--permission <key=level>override a permission for this server only; repeat for more keys.
--confirm-sendno longer used — writes show no form; the profile's permissions decide.
--allow-dangerousno longer used — writes show no form; the profile's permissions decide.
--allow-sendno longer used — the profile's permissions decide; kept so an old setup still starts.
--allow-mark-readno longer used — the profile's permissions decide.
--allow-deleteno longer used — the profile's permissions decide.

tg mcp doctor

check this profile's local MCP handshake and tool list

tg mcp doctor [options]
OptionWhat it does
--permission <key=level>override a permission for this server only; repeat for more keys.
--confirm-sendno longer used — writes show no form; the profile's permissions decide.
--allow-dangerousno longer used — writes show no form; the profile's permissions decide.
--allow-sendno longer used — the profile's permissions decide; kept so an old setup still starts.
--allow-mark-readno longer used — the profile's permissions decide.
--allow-deleteno longer used — the profile's permissions decide.

tg skill

the instructions an agent is given for this tool

tg skill show

print SKILL.md — tg skill install puts it where Claude Code, Codex and Gemini CLI look for it

tg skill show [name]
ArgumentRequirementWhat it is
nameoptionalone of the skills shipped for a task: link-conversations.

tg skill install

write SKILL.md to ~/.claude/skills/tg-cli/ (Claude Code) and ~/.agents/skills/tg-cli/ (Codex, Gemini CLI)

tg skill install [options]
OptionWhat it does
--for <agents>which agents to install for. One of: claude, agents, all. Default: all.

Exit codes

Branch on the code, not on the text: the text can change, the code does not.

CodeWhen
0it worked
2validation_error
3configuration_error
4authentication_error
5permission_error
6not_found
7confirmation_required
8rate_limited
9timeout
10network_error
11provider_error
12provider_unavailable
13invalid_response
14outcome_unknown
130cancelled
1anything else

0 and only 0 means the operation was done. 14 (outcome_unknown) means a message may have gone: repeat it only with the same --send-id, which Telegram uses to drop a second copy.