Telegram
Coming from tgcli
Move from tgcli to the Telegram CLI: map commands for accounts, archives, bots, groups, folders, contacts and message search.
tgcli is another command line client for a personal Telegram account.
This page lists each tgcli command and what does the same in tg. Where tg has no equivalent, the
row says so and why.
tg names a chat as an argument, not with --chat or --to: tg messages send "Book club" "hi".
Every command takes --json (cli-contract.md).
Login, profiles and the background service
| tgcli | tg |
|---|---|
auth, auth --qr | tg session start (QR by default), tg session start phone |
auth status | tg account show, tg doctor --online |
auth logout | tg session end |
accounts add, --account <id> | a profile: tg work chats list, or TG_PROFILE=work (profiles.md) |
config get/set/unset | tg config show/set/unset (configuration.md) |
proxy setting, TELEGRAM_PROXY | the proxy setting, TG_PROXY (configuration-reference.md) |
server, service install/start/stop/status/logs | tg serve, tg server start/stop/status/logs/install |
MCP over HTTP (mcp.enabled) | tg mcp --http (mcp.md, remote.md) |
sync --once, sync --follow | tg store fetch, tg serve (archive.md) |
sync jobs list/add/retry/cancel | tg store fetch --background, tg store jobs list/show/cancel |
owner request <id> | tg sends list, and --send-id to repeat a send whose outcome was unknown |
doctor | tg doctor |
Reading and searching
| tgcli | tg |
|---|---|
channels list, groups list | tg chats list --kind channel, --kind group |
channels show, groups info, metadata get | tg chats show <chat> |
topics list/search | tg topics list/search <chat> |
messages list --chat … --topic … | tg messages list <chat> --topic <id> |
messages list --after/--before | --after-time, --before-time, --after-id, --before-id |
messages show, messages context | tg messages show, tg messages context |
messages search --after --before --tag --topic --regex | the query: date:7d tag:work topic:12, --regex (query-language.md) |
messages search --source live/both | tg messages search --backend server/both (search.md) |
media download | tg messages download <chat> <id>, or a whole chat with --all |
contacts search, contacts show | tg contacts list --search, tg contacts show, tg contacts profile |
Sending
| tgcli | tg |
|---|---|
send text, send photo, send file | tg messages send <chat> [text], with --photo or --file |
--parse-mode markdown | --md (usage.md) |
--parse-mode html | --html |
--reply-to, --topic, --silent, --no-preview | the same flags |
--schedule <iso> | --at-time <time> |
--spoiler, --caption-above | the same flags |
--force-document | --as-file |
--filename | --filename |
--retries, --retry-backoff | not needed: a dropped upload is retried by itself, and never sent twice |
--no-forwards | not possible: Telegram lets only bots protect one message. Turn on the chat's own content protection in Telegram. |