Commands¶
tg --help shows all 70 commands. This page is generated from the local Cobra help output, then kept as plain Markdown for the docs site.
Every command supports the global flags shown by tg --help: --account, --full, --json, --human, --lock-wait, --read-only, and --version where applicable.
Index¶
| Command | What |
|---|---|
tg account-sessions |
List authorized Telegram sessions |
tg accounts-add |
Create a new account directory |
tg accounts-list |
List known accounts |
tg accounts-remove |
Delete an account directory |
tg accounts-show |
Show the currently selected account and its paths |
tg accounts-use |
Select an existing account |
tg backfill |
Backfill cached messages for a chat |
tg backfill-entities |
Populate the local entity cache so chat_id-keyed sends work |
tg ban-from-chat |
ban-from-chat user in chat |
tg block-user |
Block a user |
tg chat-description |
Edit chat description |
tg chat-invite-link |
Export an invite link |
tg chat-members |
List chat members |
tg chat-photo |
Edit chat photo |
tg chat-pinned-list |
List pinned dialogs for a chat |
tg chat-title |
Edit chat title |
tg chats-info |
Show chat info for comma-separated chat ids |
tg completion |
Generate the autocompletion script for tg for the specified shell. |
tg contacts |
List cached contacts |
tg delete-msg |
Delete one or more messages (revoke for everyone by default) |
tg demote |
demote user in chat |
tg discover |
Discover dialogs and cache chat metadata |
tg doctor |
Diagnose tgctl-go setup |
tg edit-msg |
Edit a previously sent message |
tg folder-add-chat |
Mutate folder chat membership |
tg folder-create |
Create a dialog folder |
tg folder-delete |
Delete a dialog folder |
tg folder-edit |
Edit a dialog folder |
tg folder-remove-chat |
Mutate folder chat membership |
tg folder-show |
Show one dialog folder |
tg folders-list |
List dialog folders |
tg folders-reorder |
Reorder dialog folders |
tg forward |
Forward one or more messages between chats |
tg get-msg |
Print one cached message in full |
tg help |
Help provides help for any command in the application. |
tg import-telethon-session |
Adopt a Python tgctl/Telethon session as the current Go account's session |
tg kick |
kick user in chat |
tg leave-chat |
Leave a group or channel (typed confirm required) |
tg list-msgs |
List cached messages in a chat with optional date filters |
tg listen |
Listen for live Telegram updates |
tg login |
Interactively authorize this account against Telegram |
tg mark-read |
Mark history read up to and including --up-to |
tg me |
Print authenticated user info |
tg pin-msg |
Pin a message in a chat |
tg promote |
promote user in chat |
tg react |
Send a reaction to a message |
tg search |
Search cached messages in a chat |
tg send |
Send a text message |
tg send-by-username |
Send a text message by resolving an @username (no entity cache required) |
tg set-permissions |
Set default chat permissions |
tg show |
Show recent cached messages in a chat |
tg stats |
Show local cache statistics |
tg sync-contacts |
Sync Telegram contacts into the local DB |
tg terminate-session |
Terminate one of your authorized Telegram sessions |
tg topic-create |
Create a forum topic |
tg topic-edit |
Edit a forum topic |
tg topic-pin |
Pin a forum topic |
tg topic-unpin |
Unpin a forum topic |
tg topics-list |
List forum topics |
tg unban-from-chat |
unban-from-chat user in chat |
tg unblock-user |
Unblock a previously blocked user |
tg unpin-msg |
Unpin a previously pinned message |
tg unread |
List recently cached incoming messages |
tg upload-document |
Upload a document |
tg upload-photo |
Upload a photo |
tg upload-video |
Upload a video |
tg upload-voice |
Upload an OGG/Opus voice message |
tg version |
Print build version |
tg account-sessions¶
List authorized Telegram sessions
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for account-sessions |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg accounts-add¶
Create a new account directory
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for accounts-add |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg accounts-list¶
List known accounts
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for accounts-list |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg accounts-remove¶
Delete an account directory
Use
Example
Flags
| Flag | Description |
|---|---|
--confirm string |
Typed account name to confirm removal |
-h, --help |
help for accounts-remove |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg accounts-show¶
Show the currently selected account and its paths
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for accounts-show |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg accounts-use¶
Select an existing account
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for accounts-use |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg backfill¶
Backfill cached messages for a chat
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for local DB writes |
--download-media |
Download media during backfill |
-h, --help |
help for backfill |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--max-db-size-mb int |
Maximum database size in MiB |
--max-messages int |
Maximum cached messages per chat (default 100) |
--throttle-seconds float |
Seconds to sleep between chats |
tg backfill-entities¶
Populate the local entity cache so chat_id-keyed sends work
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for backfill-entities |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Max dialogs to fetch in one pass (Telegram caps at ~200) (default 200) |
tg ban-from-chat¶
ban-from-chat user in chat
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for ban-from-chat |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg block-user¶
Block a user
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for block-user |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg chat-description¶
Edit chat description
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for chat-description |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg chat-invite-link¶
Export an invite link
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for chat-invite-link |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg chat-members¶
List chat members
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for chat-members |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Maximum members (default 50) |
tg chat-photo¶
Edit chat photo
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for chat-photo |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg chat-pinned-list¶
List pinned dialogs for a chat
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for chat-pinned-list |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg chat-title¶
Edit chat title
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for chat-title |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg chats-info¶
Show chat info for comma-separated chat ids
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for chats-info |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg completion¶
Generate the autocompletion script for tg for the specified shell.
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for completion |
tg contacts¶
List cached contacts
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for contacts |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Maximum contacts (default 100) |
tg delete-msg¶
Delete one or more messages (revoke for everyone by default)
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--for-everyone |
Force revoke for everyone |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for delete-msg |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--no-for-everyone |
Force delete only for self |
tg demote¶
demote user in chat
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for demote |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg discover¶
Discover dialogs and cache chat metadata
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for local DB writes |
-h, --help |
help for discover |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Maximum dialogs to fetch (default 200) |
tg doctor¶
Diagnose tgctl-go setup
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for doctor |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg edit-msg¶
Edit a previously sent message
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for edit-msg |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg folder-add-chat¶
Mutate folder chat membership
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for folder-add-chat |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg folder-create¶
Create a dialog folder
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--emoji string |
Folder emoji |
--exclude-chats string |
Comma-separated chat ids to exclude |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for folder-create |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--include-chats string |
Comma-separated chat ids to include |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg folder-delete¶
Delete a dialog folder
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for folder-delete |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg folder-edit¶
Edit a dialog folder
Use
Example
Flags
| Flag | Description |
|---|---|
--add string |
Comma-separated chat ids to add |
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--emoji string |
Folder emoji |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for folder-edit |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--name string |
New folder name |
--remove string |
Comma-separated chat ids to remove |
tg folder-remove-chat¶
Mutate folder chat membership
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for folder-remove-chat |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg folder-show¶
Show one dialog folder
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for folder-show |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg folders-list¶
List dialog folders
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for folders-list |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--query string |
Filter by title |
tg folders-reorder¶
Reorder dialog folders
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for folders-reorder |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg forward¶
Forward one or more messages between chats
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for forward |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--topic int |
Forum topic id on destination |
tg get-msg¶
Print one cached message in full
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for get-msg |
--human |
Force human-readable output (default on a TTY) |
--include-deleted |
Look up tombstoned messages too |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg help¶
Help provides help for any command in the application.
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for help |
tg import-telethon-session¶
Adopt a Python tgctl/Telethon session as the current Go account's session.
Use
Flags
Standard global flags only. No write gate (this is a local-file copy, not a Telegram-side write).
Example
The auth_key is reused, so no SMS round-trip is needed. The
destination is the current --account's tg.session file.
tg kick¶
kick user in chat
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for kick |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg leave-chat¶
Leave a group or channel (typed confirm required)
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for leave-chat |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg list-msgs¶
List cached messages in a chat with optional date filters
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for list-msgs |
--human |
Force human-readable output (default on a TTY) |
--include-deleted |
Include tombstoned messages |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Max messages to return (default 50) |
--reverse |
Oldest first |
--since string |
YYYY-MM-DD inclusive lower bound |
--until string |
YYYY-MM-DD inclusive upper bound |
tg listen¶
Listen for live Telegram updates
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for local DB writes |
-h, --help |
help for listen |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--once |
Exit after one update |
tg login¶
Interactively authorize this account against Telegram
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for login |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg mark-read¶
Mark history read up to and including --up-to
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for mark-read |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--up-to int |
Mark read up to and including this message id; 0 means latest |
tg me¶
Print authenticated user info
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for me |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--offline |
Read cached self user info without connecting to Telegram |
tg pin-msg¶
Pin a message in a chat
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for pin-msg |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--silent |
Pin silently (no notification) |
tg promote¶
promote user in chat
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for promote |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg react¶
Send a reaction to a message
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--big |
Send a big reaction (Premium) |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for react |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg search¶
Search cached messages in a chat
Use
Example
Flags
| Flag | Description |
|---|---|
--case-sensitive |
Case-sensitive matching |
-h, --help |
help for search |
--human |
Force human-readable output (default on a TTY) |
--include-deleted |
Include tombstoned messages |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Max messages to return (default 50) |
tg send¶
Send a text message
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for send |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--no-webpage |
Disable link preview |
--reply-to int |
Reply-to message id |
--silent |
Send silently (no notification) |
--topic int |
Forum topic id |
tg send-by-username¶
Send a text message by resolving an @username (no entity cache required)
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--dry-run |
Print payload preview without contacting Telegram |
-h, --help |
help for send-by-username |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--no-webpage |
Disable link preview |
--reply-to int |
Reply-to message id |
--silent |
Send silently |
tg set-permissions¶
Set default chat permissions
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for set-permissions |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--send-messages |
Allow sending messages |
tg show¶
Show recent cached messages in a chat
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for show |
--human |
Force human-readable output (default on a TTY) |
--include-deleted |
Include tombstoned messages |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Max messages to return (default 20) |
--reverse |
Show oldest first |
tg stats¶
Show local cache statistics
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for stats |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg sync-contacts¶
Sync Telegram contacts into the local DB
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for local DB writes |
-h, --help |
help for sync-contacts |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg terminate-session¶
Terminate one of your authorized Telegram sessions
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for terminate-session |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg topic-create¶
Create a forum topic
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for topic-create |
--human |
Force human-readable output (default on a TTY) |
--icon-color int |
Topic icon color |
--icon-emoji-id int |
Topic icon custom emoji id |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg topic-edit¶
Edit a forum topic
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for topic-edit |
--human |
Force human-readable output (default on a TTY) |
--icon-emoji-id int |
New icon custom emoji id |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--title string |
New topic title |
tg topic-pin¶
Pin a forum topic
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for topic-pin |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg topic-unpin¶
Unpin a forum topic
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for topic-unpin |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg topics-list¶
List forum topics
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for topics-list |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Maximum topics (default 50) |
--query string |
Filter query |
tg unban-from-chat¶
unban-from-chat user in chat
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for unban-from-chat |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg unblock-user¶
Unblock a previously blocked user
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for unblock-user |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
tg unpin-msg¶
Unpin a previously pinned message
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for unpin-msg |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--silent |
Pin silently (no notification) |
tg unread¶
List recently cached incoming messages
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for unread |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--limit int |
Maximum messages (default 50) |
tg upload-document¶
Upload a document
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--caption string |
Media caption |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--filename string |
Override uploaded filename |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for upload-document |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--max-size-mb int |
Maximum upload size in MiB (default 100) |
--reply-to int |
Reply-to message id |
--silent |
Send silently |
tg upload-photo¶
Upload a photo
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--caption string |
Media caption |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for upload-photo |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--max-size-mb int |
Maximum upload size in MiB (default 100) |
--reply-to int |
Reply-to message id |
--silent |
Send silently |
tg upload-video¶
Upload a video
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--caption string |
Media caption |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for upload-video |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--max-size-mb int |
Maximum upload size in MiB (default 100) |
--reply-to int |
Reply-to message id |
--silent |
Send silently |
--supports-streaming |
Mark video as streamable |
tg upload-voice¶
Upload an OGG/Opus voice message
Use
Example
Flags
| Flag | Description |
|---|---|
--allow-write |
Required for any Telegram-side write |
--caption string |
Media caption |
--confirm string |
Typed confirm against the resolved id |
--dry-run |
Print payload preview without contacting Telegram |
--fuzzy |
Allow title-based selectors for write commands |
-h, --help |
help for upload-voice |
--human |
Force human-readable output (default on a TTY) |
--idempotency-key string |
Per-account replay-safe key |
--json |
Force JSON envelope output (default when stdout is not a TTY) |
--max-size-mb int |
Maximum upload size in MiB (default 100) |
--reply-to int |
Reply-to message id |
--silent |
Send silently |
tg version¶
Print build version
Use
Example
Flags
| Flag | Description |
|---|---|
-h, --help |
help for version |
--human |
Force human-readable output (default on a TTY) |
--json |
Force JSON envelope output (default when stdout is not a TTY) |