Skip to content

Commands

tg --help shows 96 commands. This page is generated from Cobra help output.

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-limits Show authenticated account capabilities and effective Telegram limits
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 archive Archive one chat
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-permissions Inspect advisory rights for the current account or a selected user in a group/channel.
tg chat-photo Edit chat photo
tg chat-pinned-list List up to 100 pinned messages in 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 contact-add Add a known user to contacts
tg contact-remove Remove a known contact without deleting the conversation
tg contacts List cached contacts
tg db-backup Create a consistent private cache snapshot (session and media excluded)
tg db-restore Restore a cache snapshot into an account with no existing database
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 discussion-message Resolve a channel post to its discussion thread without joining it
tg doctor Diagnose tgctl-go setup
tg download-album Download one cached Telegram media group
tg download-media Download media attached to a message
tg edit-msg Edit a previously sent message
tg events-ack Acknowledge one event after saving it in your own durable inbox
tg events-list Read pending cached updates without consuming them or opening Telegram
tg export Export cached Telegram history locally
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 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 logout Revoke this account's current session; keep cached history and downloads
tg mark-read Mark history read up to and including --up-to
tg me Print authenticated user info
tg media-find Find cached Telegram media by exact SHA-256
tg media-hash Compute a local file's exact SHA-256
tg media-index Index a bounded page of downloaded cached media by SHA-256
tg media-similar Find approximate visual matches in the local index
tg mute Mute notifications from one chat
tg operations-list Inspect durable write outcomes without exposing request payloads
tg pin-msg Pin a message in a chat
tg promote promote user in chat
tg react Send a reaction to a message
tg reader Serve bounded chat history on loopback, with sponsored messages and genuine browser interaction reporting.
tg replies Retrieve a bounded server page of replies to a message
tg resolve Resolve a selector to a marked Telegram peer identity
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 setup Create or update a private .env with Telegram app credentials
tg show Show recent cached messages in a chat
tg stats Show local cache statistics
tg sync Synchronize cached messages and optionally follow updates
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-history Retrieve a bounded server page from a forum topic
tg topic-pin Pin a forum topic
tg topic-unpin Unpin a forum topic
tg topics-list List forum topics
tg unarchive Move one chat to the inbox
tg unban-from-chat unban-from-chat user in chat
tg unblock-user Unblock a previously blocked user
tg unmute Unmute notifications from one chat
tg unpin-msg Unpin a previously pinned message
tg unread List cached incoming messages beyond known Telegram read markers
tg upload-album Upload a 2–10 item media album
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-limits

Show authenticated account capabilities and effective Telegram limits

Use

tg account-limits [flags]

Example

tg account-limits [flags] --json

Flags

Flag Description
-h, --help help for account-limits
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)

tg account-sessions

List authorized Telegram sessions

Use

tg account-sessions [flags]

Example

tg account-sessions --json

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

tg accounts-add <name> [flags]

Example

tg accounts-add work --json

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

tg accounts-list [flags]

Example

tg accounts-list --json

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

tg accounts-remove <name> [flags]

Example

tg accounts-remove work --confirm work --json

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

tg accounts-show [flags]

Example

tg accounts-show --json

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

tg accounts-use <name> [flags]

Example

tg accounts-use work --json

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 archive

Archive one chat

Use

tg archive <chat> [flags]

Example

tg archive <chat> [flags] --json

Flags

Flag Description
--allow-write Required for any Telegram-side write
--dry-run Print payload preview without contacting Telegram
--fuzzy Allow title-based selectors for write commands
-h, --help help for archive
--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 backfill

Backfill cached messages for a chat

Use

tg backfill <chat> [flags]

Example

tg backfill 123456789 --max-messages 100 --allow-write --json

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 main database plus WAL allocation in MiB (0 disables the cap)
--max-media-size-mb int Maximum size per downloaded media file in MiB (0 disables the limit) (default 100)
--max-messages int Maximum cached messages per chat (maximum 10000) (default 100)
--overwrite-media Overwrite existing backfill media files
--throttle-seconds float Seconds to sleep between Telegram history pages

tg backfill-entities

Populate the local entity cache so chat_id-keyed sends work

Use

tg backfill-entities [flags]

Example

tg backfill-entities --allow-write --json

Flags

Flag Description
--allow-write Required for local DB writes
-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

tg ban-from-chat <chat> <user-id> [flags]

Example

tg ban-from-chat <group-chat-id> 123456789 --allow-write --confirm 123456789 --json

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

tg block-user <user> [flags]

Example

tg block-user 123456789 --allow-write --confirm 123456789 --json

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

tg chat-description <chat> <value> [flags]

Example

tg chat-description <group-chat-id> "Description" --allow-write --json

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)

Export an invite link

Use

tg chat-invite-link <chat> [flags]

Example

tg chat-invite-link <group-chat-id> --allow-write --json

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

tg chat-members <chat> [flags]

Example

tg chat-members <group-chat-id> --limit 50 --json

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-permissions

Inspect advisory rights for the current account or a selected user in a group/channel.

Use

tg chat-permissions <chat> [user] [flags]

Example

tg chat-permissions <chat> [user] [flags] --json

Flags

Flag Description
-h, --help help for chat-permissions
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)

tg chat-photo

Edit chat photo

Use

tg chat-photo <chat> <value> [flags]

Example

tg chat-photo <group-chat-id> ./photo.png --allow-write --json

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 up to 100 pinned messages in a chat

Use

tg chat-pinned-list <chat> [flags]

Example

tg chat-pinned-list 123456789 --json

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

tg chat-title <chat> <value> [flags]

Example

tg chat-title <group-chat-id> "New title" --allow-write --json

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

tg chats-info <chat-ids> [flags]

Example

tg chats-info 123456789 --json

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

tg completion [flags]
tg completion [command]

Example

tg completion zsh > ~/.zsh/completions/_tg

Flags

Flag Description
-h, --help help for completion

tg contact-add

Add a known user to contacts

Use

tg contact-add <user> [flags]

Example

tg contact-add <user> [flags] --json

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
--first-name string Required contact first name
--fuzzy Allow title-based selectors for write commands
-h, --help help for contact-add
--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)
--last-name string Contact last name
--share-phone Explicitly allow this contact to see your phone number

tg contact-remove

Remove a known contact without deleting the conversation

Use

tg contact-remove <user> [flags]

Example

tg contact-remove <user> [flags] --json

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 contact-remove
--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 contacts

List cached contacts

Use

tg contacts [flags]

Example

tg contacts --json

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 db-backup

Create a consistent private cache snapshot (session and media excluded)

Use

tg db-backup <snapshot> [flags]

Example

tg db-backup <snapshot> [flags] --json

Flags

Flag Description
--allow-write Required for local DB writes
--dry-run Preview paths without creating a snapshot or contacting Telegram
-h, --help help for db-backup
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)

tg db-restore

Restore a cache snapshot into an account with no existing database

Use

tg db-restore <snapshot> [flags]

Example

tg db-restore <snapshot> [flags] --json

Flags

Flag Description
--allow-write Required for local DB writes
--dry-run Preview paths without creating a snapshot or contacting Telegram
-h, --help help for db-restore
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)

tg delete-msg

Delete one or more messages (revoke for everyone by default)

Use

tg delete-msg <chat> <message-ids> [flags]

Example

tg delete-msg 123456789 1 --allow-write --confirm 123456789 --json

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

tg demote <chat> <user-id> [flags]

Example

tg demote 987654321 123456789 --allow-write --confirm 987654321 --json

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

tg discover [flags]

Example

tg discover --allow-write --json

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 discussion-message

Resolve a channel post to its discussion thread without joining it

Use

tg discussion-message <chat> <message-id> [flags]

Example

tg discussion-message <chat> <message-id> [flags] --json

Flags

Flag Description
-h, --help help for discussion-message
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)

tg doctor

Diagnose tgctl-go setup

Use

tg doctor [flags]

Example

tg doctor --json

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 download-album

Download one cached Telegram media group

Use

tg download-album <chat> [message-id] [flags]

Example

tg download-album <chat> [message-id] [flags] --json

Flags

Flag Description
--allow-write Required for album media/cache writes
--dry-run Print album metadata without contacting Telegram
--fuzzy Allow title-based chat selectors
--grouped-id int Telegram grouped_id to download
-h, --help help for download-album
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--max-size-mb int Maximum download size per item in MiB (0 = unlimited) (default 100)
--message-id int Anchor message id (or pass it as the second argument)
--output string Output directory (default account media//)
--overwrite Overwrite existing media files

tg download-media

Download media attached to a message

Use

tg download-media <chat> <message-id> [flags]

Example

tg download-media 123456789 42 --max-size-mb 100 --allow-write --json

Flags

Flag Description
--allow-write Required because the download updates the local media cache
--fuzzy Allow title-based chat selectors
-h, --help help for download-media
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--max-size-mb int Maximum download size in MiB (0 = unlimited) (default 100)
--output string Output directory (default account media//)
--overwrite Overwrite an existing media file

tg edit-msg

Edit a previously sent message

Use

tg edit-msg <chat> <message-id> <new-text> [flags]

Example

tg edit-msg 123456789 1 "updated" --allow-write --json

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
--entities string Explicit JSON text entities with UTF-16 offsets (plain text by default)
--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 events-ack

Acknowledge one event after saving it in your own durable inbox

Use

tg events-ack <receipt> [flags]

Example

tg events-ack <receipt> [flags] --json

Flags

Flag Description
--allow-write Required for local DB writes
--dry-run Validate receipt without removing the event
-h, --help help for events-ack
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)

tg events-list

Read pending cached updates without consuming them or opening Telegram

Use

tg events-list [flags]

Example

tg events-list [flags] --json

Flags

Flag Description
-h, --help help for events-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 pending events (1–100) (default 20)

tg export

Export cached Telegram history locally

Use

tg export <chat> [flags]

Example

tg export <chat> [flags] --json

Flags

Flag Description
--format string Export format: jsonl, csv, or html (default "jsonl")
-h, --help help for export
--human Force human-readable output (default on a TTY)
--include-media Include media paths relative to the account media root
--json Force JSON envelope output (default when stdout is not a TTY)
--limit int Maximum rows (0 means all cached rows)
--manifest string Write an archive manifest JSON file
--manifest-hash Include SHA-256 hashes in --manifest
--output string Output file, or - for stdout (default "-")
--since string Inclusive lower date/time bound
--until string Inclusive upper date/time bound
--verify string Verify a local archive manifest instead of exporting

tg folder-add-chat

Mutate folder chat membership

Use

tg folder-add-chat <id> <chat> [flags]

Example

tg folder-add-chat 2 123456789 --allow-write --json

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

tg folder-create <name> [flags]

Example

tg folder-create "support" --include-chats 123456789 --allow-write --json

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

tg folder-delete <id> [flags]

Example

tg folder-delete 2 --allow-write --confirm 2 --json

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

tg folder-edit <id> [flags]

Example

tg folder-edit 2 --name "support" --allow-write --json

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

tg folder-remove-chat <id> <chat> [flags]

Example

tg folder-remove-chat 2 123456789 --allow-write --json

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

tg folder-show <id> [flags]

Example

tg folder-show 2 --json

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

tg folders-list [flags]

Example

tg folders-list --json

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

tg folders-reorder <id-csv> [flags]

Example

tg folders-reorder 2,3,4 --allow-write --json

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

tg forward <from-chat> <to-chat> <message-ids> [flags]

Example

tg forward 123456789 123456789 1 --allow-write --json

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

tg get-msg <chat> <message-id> [flags]

Example

tg get-msg 123456789 1 --json

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)
--source string Read source: cache or telegram (default "cache")

tg help

Help provides help for any command in the application.

Use

tg help [command] [flags]

Example

tg help send

Flags

Flag Description
-h, --help help for help

tg kick

kick user in chat

Use

tg kick <chat> <user-id> [flags]

Example

tg kick <group-chat-id> 123456789 --allow-write --confirm 123456789 --json

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

tg leave-chat <chat> [flags]

Example

tg leave-chat <group-chat-id> --allow-write --confirm <group-chat-id> --json

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

tg list-msgs <chat> [flags]

Example

tg list-msgs 123456789 --limit 10 --json

Flags

Flag Description
--cursor string Continue from next_cursor using the same filters and order
-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
--source string Read source: cache or telegram (default "cache")
--until string YYYY-MM-DD inclusive upper bound

tg listen

Listen for live Telegram updates

Use

tg listen [flags]

Example

tg listen --once --json

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)
--manual-ack With --once, retain the delivered event until events-ack confirms durable consumption
--once Exit after one filter-matching update
--only-dms Emit only 1-on-1 user messages; skip groups/channels
--only-groups Emit only group/channel messages; skip 1-on-1 DMs

tg login

Interactively authorize this account against Telegram

Use

tg login [flags]

Example

tg login

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)
--qr Authorize by scanning a Telegram QR code (API credentials still required)
--qr-uri Print the QR login URI instead of rendering terminal blocks

tg logout

Revoke this account's current session; keep cached history and downloads

Use

tg logout [flags]

Example

tg logout [flags] --json

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 logout
--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 mark-read

Mark history read up to and including --up-to

Use

tg mark-read <chat> [flags]

Example

tg mark-read 123456789 --up-to 1 --allow-write --json

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

tg me [flags]

Example

tg me --json

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 media-find

Find cached Telegram media by exact SHA-256

Use

tg media-find <sha256> [flags]

Example

tg --account work media-find <sha256> --json

Flags

Flag Description
-h, --help help for media-find
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--limit int Maximum records (1–1000) (default 100)

tg media-hash

Compute a local file's exact SHA-256

Use

tg media-hash <file> [flags]

Example

tg --account work media-hash ./photo.jpg --json

Flags

Flag Description
-h, --help help for media-hash
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--max-size-mb int Maximum file size in MiB (0 = unlimited) (default 100)
--visual Also compute JPEG/PNG visual hashes (20 MiB / 24 MP cap)

tg media-index

Index a bounded page of downloaded cached media by SHA-256

Use

tg media-index <chat> [flags]

Example

tg --account work media-index 123456789 --allow-write --limit 100 --json

Flags

Flag Description
--after-id int Continue after this message ID
--allow-write Allow local hash index updates
--fuzzy Allow title-based chat selectors
-h, --help help for media-index
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--limit int Maximum records (1–1000) (default 100)
--max-size-mb int Maximum file size in MiB (0 = unlimited) (default 100)
--visual Also compute JPEG/PNG visual hashes (20 MiB / 24 MP cap)

tg media-similar

Find approximate visual matches in the local index

Use

tg media-similar <dhash> [flags]

Example

tg --account work media-similar 0123456789abcdef --distance 6 --json

Flags

Flag Description
--distance int Maximum differing bits (0–64); lower is stricter (default 6)
-h, --help help for media-similar
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--limit int Maximum records (1–1000) (default 100)

tg mute

Mute notifications from one chat

Use

tg mute <chat> [flags]

Example

tg mute 123456789 --for 8h --allow-write --json

Flags

Flag Description
--allow-write Required for any Telegram-side write
--dry-run Print payload preview without contacting Telegram
--for duration Mute duration, for example 30m or 8h
--forever Mute indefinitely
--fuzzy Allow title-based selectors for write commands
-h, --help help for mute
--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)
--until string Mute until an RFC3339 timestamp with timezone

tg operations-list

Inspect durable write outcomes without exposing request payloads

Use

tg operations-list [flags]

Example

tg operations-list [flags] --json

Flags

Flag Description
-h, --help help for operations-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 operations (1–1000) (default 100)

tg pin-msg

Pin a message in a chat

Use

tg pin-msg <chat> <message-id> [flags]

Example

tg pin-msg 123456789 1 --allow-write --json

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

tg promote <chat> <user-id> [flags]

Example

tg promote 987654321 123456789 --allow-write --confirm 987654321 --json

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)
--rights string Comma-separated explicit admin rights: other,change_info,delete_messages,ban_users,invite_users,pin_messages,manage_topics,post_messages,edit_messages,manage_call,add_admins (default "other")

tg react

Send a reaction to a message

Use

tg react <chat> <message-id> <emoji> [flags]

Example

tg react 123456789 1 "👍" --allow-write --json

Flags

Flag Description
--allow-write Required for any Telegram-side write
--big Send an animated big reaction
--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 reader

Serve bounded chat history on loopback, with sponsored messages and genuine browser interaction reporting.

Use

tg reader <chat> [flags]

Example

tg --account work reader self --allow-write --human

Flags

Flag Description
--allow-write Allow genuine sponsored view/click/report callbacks and local audit/ledger writes
--dry-run Validate the local reader plan without opening a listener or contacting Telegram
--duration duration Maximum reader lifetime (1–60 minutes) (default 15m0s)
-h, --help help for reader
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--limit int Messages per page (1–100; at most 20 continuation pages) (default 50)

tg replies

Retrieve a bounded server page of replies to a message

Use

tg replies <chat> <message-id> [flags]

Example

tg replies <chat> <message-id> [flags] --json

Flags

Flag Description
--cursor string Continue from next_cursor using the same root and chat
-h, --help help for replies
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--limit int Maximum replies to return (1-100) (default 50)

tg resolve

Resolve a selector to a marked Telegram peer identity

Use

tg resolve <selector> [flags]

Example

tg resolve <selector> [flags] --json

Flags

Flag Description
-h, --help help for resolve
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--source string Resolution source: cache or telegram (default "cache")

Search cached messages in a chat

Use

tg search <chat> <query> [flags]

Example

tg search 123456789 "shipping" --limit 20 --json

Flags

Flag Description
--case-sensitive Case-sensitive matching
--cursor string Continue from next_cursor using the same filters and order
-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)
--media-type string Filter by media type: photo, video, photo-video, document, voice, or audio
--sender string Filter by sender selector in Telegram source
--since string YYYY-MM-DD inclusive lower bound (Telegram source)
--source string Read source: cache or telegram (default "cache")
--until string YYYY-MM-DD inclusive upper bound (Telegram source)

tg send

Send a text message

Use

tg send <chat> <text> [flags]

Example

tg send 123456789 "hello" --allow-write --json

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
--entities string Explicit JSON text entities with UTF-16 offsets (plain text by default)
--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

tg send-by-username <@user|@channel> <text> [flags]

Example

tg send-by-username @username "hello" --allow-write --json

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
--entities string Explicit JSON text entities with UTF-16 offsets (plain text by default)
--fuzzy Allow title-based selectors for write commands
-h, --help help for send-by-username
--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

tg set-permissions

Set default chat permissions

Use

tg set-permissions <chat> [permissions] [flags]

Example

tg set-permissions <group-chat-id> --send-messages --allow-write --json

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 setup

Create or update a private .env with Telegram app credentials

Use

tg setup [flags]

Example

tg setup [flags] --json

Flags

Flag Description
--api-hash string Telegram app API hash (never printed)
--api-id string Telegram app API ID (never printed)
--env-file string Environment file to create or update (default: stable tgctl config root)
-h, --help help for setup
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)

tg show

Show recent cached messages in a chat

Use

tg show <chat> [flags]

Example

tg show 123456789 --limit 5 --json

Flags

Flag Description
--cursor string Continue from next_cursor using the same filters and order
-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
--source string Read source: cache or telegram (default "cache")

tg stats

Show local cache statistics

Use

tg stats [flags]

Example

tg stats --json

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

Synchronize cached messages and optionally follow updates

Use

tg sync <chat> [flags]

Example

tg sync <chat> [flags] --json

Flags

Flag Description
--allow-write Required for local DB writes
--backoff-max-seconds float Maximum reconnect delay in seconds (default 30)
--download-media Download media during catch-up
--follow Continue listening after the initial catch-up
-h, --help help for sync
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--max-media-size-mb int Maximum media file size during catch-up (default 100)
--max-messages int Maximum history messages to reconcile (default 100)
--once With --follow, stop after one matching live event
--overwrite-media Overwrite existing catch-up media

tg sync-contacts

Sync Telegram contacts into the local DB

Use

tg sync-contacts [flags]

Example

tg sync-contacts --allow-write --json

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

tg terminate-session <session-hash> [flags]

Example

tg terminate-session <session-hash> --allow-write --confirm <session-hash> --json

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

tg topic-create <chat> <title> [flags]

Example

tg topic-create <forum-chat-id> "Support" --allow-write --json

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

tg topic-edit <chat> <topic-id> [flags]

Example

tg topic-edit <forum-chat-id> 1 --title "Renamed" --allow-write --json

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-history

Retrieve a bounded server page from a forum topic

Use

tg topic-history <chat> <topic-id> [flags]

Example

tg topic-history <chat> <topic-id> [flags] --json

Flags

Flag Description
--cursor string Continue from next_cursor using the same topic and chat
-h, --help help for topic-history
--human Force human-readable output (default on a TTY)
--json Force JSON envelope output (default when stdout is not a TTY)
--limit int Maximum topic messages to return (1-100) (default 50)

tg topic-pin

Pin a forum topic

Use

tg topic-pin <chat> <topic-id> [flags]

Example

tg topic-pin <forum-chat-id> 1 --allow-write --json

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

tg topic-unpin <chat> <topic-id> [flags]

Example

tg topic-unpin <forum-chat-id> 1 --allow-write --json

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

tg topics-list <chat> [flags]

Example

tg topics-list <forum-chat-id> --json

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 unarchive

Move one chat to the inbox

Use

tg unarchive <chat> [flags]

Example

tg unarchive <chat> [flags] --json

Flags

Flag Description
--allow-write Required for any Telegram-side write
--dry-run Print payload preview without contacting Telegram
--fuzzy Allow title-based selectors for write commands
-h, --help help for unarchive
--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 unban-from-chat

unban-from-chat user in chat

Use

tg unban-from-chat <chat> <user-id> [flags]

Example

tg unban-from-chat <group-chat-id> 123456789 --allow-write --confirm 123456789 --json

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

tg unblock-user <user> [flags]

Example

tg unblock-user 123456789 --allow-write --confirm 123456789 --json

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 unmute

Unmute notifications from one chat

Use

tg unmute <chat> [flags]

Example

tg unmute 123456789 --allow-write --json

Flags

Flag Description
--allow-write Required for any Telegram-side write
--dry-run Print payload preview without contacting Telegram
--fuzzy Allow title-based selectors for write commands
-h, --help help for unmute
--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

tg unpin-msg <chat> <message-id> [flags]

Example

tg unpin-msg 123456789 1 --allow-write --json

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 cached incoming messages beyond known Telegram read markers

Use

tg unread [flags]

Example

tg unread --json

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-album

Upload a 2–10 item media album

Use

tg upload-album <chat> <file>... [flags]

Example

tg upload-album <chat> <file>... [flags] --json

Flags

Flag Description
--allow-write Required for any Telegram-side write
--caption string Album caption (placed on the first item)
--dry-run Print payload preview without contacting Telegram
--entities string Explicit JSON text entities with UTF-16 offsets (plain text by default)
--fuzzy Allow title-based selectors for write commands
-h, --help help for upload-album
--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 size per item in MiB (default 100)
--media-kind string Album media kind: auto, photo, video, audio, or document (default "auto")
--reply-to int Reply-to message id
--silent Send silently
--supports-streaming Mark video items as streamable

tg upload-document

Upload a document

Use

tg upload-document <chat> <file> [flags]

Example

tg upload-document 123456789 ./file.txt --allow-write --json

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
--entities string Explicit JSON text entities with UTF-16 offsets (plain text by default)
--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

tg upload-photo <chat> <file> [flags]

Example

tg upload-photo 123456789 ./photo.png --allow-write --json

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
--entities string Explicit JSON text entities with UTF-16 offsets (plain text by default)
--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

tg upload-video <chat> <file> [flags]

Example

tg upload-video 123456789 ./video.mp4 --allow-write --json

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
--entities string Explicit JSON text entities with UTF-16 offsets (plain text by default)
--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

tg upload-voice <chat> <file> [flags]

Example

tg upload-voice 123456789 ./voice.ogg --allow-write --json

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
--entities string Explicit JSON text entities with UTF-16 offsets (plain text by default)
--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

tg version [flags]

Example

tg version --json

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)