@@ -13,8 +13,8 @@ Pure Rust Telegram client. No TDLib. Fast. Cross-platform.
1313tgcli auth # Authenticate (first time)
1414tgcli sync # Incremental sync
1515tgcli chats list --output markdown # List chats (markdown recommended)
16- tgcli messages list --chat < id > --output markdown # List messages
17- tgcli send --to < id > --message " Hello" # Send message
16+ tgcli messages list --chat 987654321 --output markdown # List messages from chat
17+ tgcli send --to 123456789 --message " Hello there! " # Send message
1818```
1919
2020## Core Commands
@@ -36,44 +36,44 @@ tgcli sync --stream # JSONL streaming (for pipelines)
3636Manage chats: list, search, archive, pin, mute, create groups, join, leave.
3737
3838``` bash
39- tgcli chats list --output markdown # List (markdown recommended)
40- tgcli chats list --limit 20 # Limit results
41- tgcli chats search " name " # Search chats
42- tgcli chats archive < id > # Archive chat
43- tgcli chats pin < id > # Pin chat
44- tgcli chats mute < id > # Mute notifications
45- tgcli chats create --group " Name " --user < id > # Create group
46- tgcli chats join < invite_link > # Join via link
47- tgcli chats leave < id > # Leave chat
39+ tgcli chats list --output markdown # List (markdown recommended)
40+ tgcli chats list --limit 50 # Limit results
41+ tgcli chats search " DevTeam " # Search by name
42+ tgcli chats archive 987654321 # Archive specific chat
43+ tgcli chats pin 987654321 # Pin chat
44+ tgcli chats mute 987654321 # Mute notifications
45+ tgcli chats create --group " Project Alpha " --user 111222333 # Create group
46+ tgcli chats join https://t.me/joinchat/... # Join via invite link
47+ tgcli chats leave 987654321 # Leave chat
4848```
4949
5050### Messages
5151
5252List, search, show, download, delete messages. Supports forum topics.
5353
5454``` bash
55- tgcli messages list --chat < id > --output markdown # List messages (markdown)
56- tgcli messages list --chat < id > --limit 50 # Limit results
57- tgcli messages list --chat < id > --topic < id > # Forum topic messages
58- tgcli messages search " query " --output markdown # Local FTS5 search (markdown)
59- tgcli messages search --global " query " # Telegram API search
60- tgcli messages show --chat < id > --message < id > # Show single message
61- tgcli messages context --chat < id > --message < id > # Show with context
62- tgcli messages download --chat < id > --message < id > # Download media
63- tgcli messages delete --chat < id > --message < id > # Delete message
55+ tgcli messages list --chat 987654321 --output markdown # List messages (markdown)
56+ tgcli messages list --chat 987654321 --limit 100 # Limit to 100 messages
57+ tgcli messages list --chat 987654321 --topic 42 # Forum topic messages
58+ tgcli messages search " project deadline " --output markdown # Local search (markdown)
59+ tgcli messages search --global " urgent task " # Telegram API search
60+ tgcli messages show --chat 987654321 --message 4567 # Show specific message
61+ tgcli messages context --chat 987654321 --message 4567 # Show with context
62+ tgcli messages download --chat 987654321 --message 4567 # Download media
63+ tgcli messages delete --chat 987654321 --message 4567 # Delete message
6464```
6565
6666### Send
6767
6868Send messages, files, voice/video notes, scheduled messages, replies.
6969
7070``` bash
71- tgcli send --to < id > --message " Hello" # Text message
72- tgcli send --to < id > --file /path/to/file # File
73- tgcli send --to < id > --voice /path/to/audio .ogg # Voice note
74- tgcli send --to < id > --video /path/to/ video.mp4 # Video note
75- tgcli send --to < id > --message " Hi " --schedule " tomorrow 9am" # Scheduled
76- tgcli send --to < id > --message " Hi " --reply-to < msg_id > # Reply
71+ tgcli send --to 123456789 --message " Hello from tgcli " # Text message
72+ tgcli send --to 123456789 --file report.pdf # Send file
73+ tgcli send --to 123456789 --voice note .ogg # Voice message
74+ tgcli send --to 123456789 --video video.mp4 # Video note
75+ tgcli send --to 123456789 --message " Meeting tomorrow " --schedule " tomorrow 9am" # Scheduled
76+ tgcli send --to 123456789 --message " Agreed " --reply-to 5678 # Reply to message
7777```
7878
7979### Contacts
@@ -82,17 +82,17 @@ List and search contacts.
8282
8383``` bash
8484tgcli contacts list --output markdown # List contacts (markdown)
85- tgcli contacts search " name " # Search contacts
85+ tgcli contacts search " Alice " # Search by name
8686```
8787
8888### Users
8989
9090Show user info, block/unblock.
9191
9292``` bash
93- tgcli users show < id > # Show user profile
94- tgcli users block < id > # Block user
95- tgcli users unblock < id > # Unblock user
93+ tgcli users show 123456789 # Show user profile
94+ tgcli users block 123456789 # Block user
95+ tgcli users unblock 123456789 # Unblock user
9696```
9797
9898### Stickers
@@ -101,30 +101,30 @@ List, search, and send stickers.
101101
102102``` bash
103103tgcli stickers list --output markdown # List sticker packs (markdown)
104- tgcli stickers search " query " # Search stickers
105- tgcli stickers send --to < id > --sticker < file_id > # Send sticker
104+ tgcli stickers search " cat " # Search sticker sets
105+ tgcli stickers send --to 123456789 --sticker CAT_ABC123 # Send sticker
106106```
107107
108108### Folders
109109
110110Create and manage chat folders.
111111
112112``` bash
113- tgcli folders list --output markdown # List folders (markdown)
114- tgcli folders create " Name " # Create folder
115- tgcli folders delete < id > # Delete folder
113+ tgcli folders list --output markdown # List folders (markdown)
114+ tgcli folders create " Work Chats " # Create new folder
115+ tgcli folders delete 5 # Delete folder by ID
116116```
117117
118118### Admin (Groups/Channels)
119119
120120Ban, kick, promote, demote members.
121121
122122``` bash
123- tgcli admin ban --chat < id > --user < id > # Ban user
124- tgcli admin kick --chat < id > --user < id > # Kick user
125- tgcli admin unban --chat < id > --user < id > # Unban user
126- tgcli admin promote --chat < id > --user < id > # Promote to admin
127- tgcli admin demote --chat < id > --user < id > # Demote admin
123+ tgcli admin ban --chat 111222333 --user 999888777 # Ban user
124+ tgcli admin kick --chat 111222333 --user 999888777 # Kick user
125+ tgcli admin unban --chat 111222333 --user 999888777 # Unban user
126+ tgcli admin promote --chat 111222333 --user 999888777 # Promote to admin
127+ tgcli admin demote --chat 111222333 --user 999888777 # Demote admin
128128```
129129
130130### Daemon (Real-Time)
@@ -135,29 +135,29 @@ Listen for real-time updates from Telegram servers. Optional — use `sync` for
135135tgcli daemon # Listen for updates
136136tgcli daemon --stream # JSONL output
137137tgcli daemon --no-backfill # Skip background sync
138- tgcli daemon --ignore < id > # Ignore specific chats
139- tgcli daemon --ignore-channels # Skip all channel updates
138+ tgcli daemon --ignore 987654321 # Ignore specific chat
139+ tgcli daemon --ignore-channels # Skip all channels
140140```
141141
142142### Other
143143
144144``` bash
145- tgcli read --chat < id > # Mark chat as read
146- tgcli typing --chat < id > # Send typing indicator
147- tgcli profile show # Show your profile
148- tgcli profile set --first-name " Name " # Update profile
149- tgcli completions bash # Shell completions
150- tgcli wipe # Reset database (keeps session )
145+ tgcli read --chat 987654321 # Mark chat as read
146+ tgcli typing --chat 987654321 # Send typing indicator
147+ tgcli profile show # Show your profile
148+ tgcli profile set --first-name " Alex " # Update your name
149+ tgcli completions bash # Shell completions
150+ tgcli wipe # Reset database (keeps auth )
151151```
152152
153153## Multi-Account
154154
155- Use ` --store ` to target different accounts:
155+ Use ` --store ` to manage multiple Telegram accounts:
156156
157157``` bash
158- tgcli --store ~ /.tgcli-work sync
159- tgcli --store ~ /.tgcli-personal chats list --output markdown
160- tgcli --store ~ /.tgcli-uae messages list --chat < id >
158+ tgcli --store ~ /.tgcli-personal sync
159+ tgcli --store ~ /.tgcli-work chats list --output markdown
160+ tgcli --store ~ /.tgcli-bot messages list --chat 987654321
161161```
162162
163163## Output Formats
@@ -166,50 +166,50 @@ Always use **markdown** when available (recommended for LLMs and piping):
166166
167167``` bash
168168tgcli chats list # Human-readable table (default)
169- tgcli chats list --output markdown # Markdown (recommended for LLMs)
170- tgcli chats list --output json # JSON output
169+ tgcli chats list --output markdown # Markdown (recommended for LLMs/pipes )
170+ tgcli chats list --output json # JSON for parsing
171171```
172172
173173** Markdown advantages:**
174174- Readable structure (headers, bullet points, dividers)
175- - Pipe to ripgrep/grep for fast filtering
175+ - Pipe to ripgrep/grep for filtering
176176- Feed to LLMs for processing
177- - Consistent across all commands
177+ - Consistent across commands
178178
179179## Storage
180180
181181Data stored in ` --store ` directory (default ` ~/.tgcli/ ` ):
182182
183183```
184- ~/.tgcli/session.db # Telegram session ( authentication)
185- ~/.tgcli/tgcli.db # Messages, chats, contacts (FTS5 indexed)
184+ ~/.tgcli/session.db # Telegram session & authentication
185+ ~/.tgcli/tgcli.db # Messages, chats, contacts (FTS5- indexed)
186186~/.tgcli/media/ # Downloaded media files
187187```
188188
189189## Tips & Tricks
190190
191- ** Search with ripgrep** (after exporting emails with markdown):
191+ ** Search messages with ripgrep: **
192192
193193``` bash
194- tgcli messages list --chat < id > --output markdown | rg " keyword"
194+ tgcli messages list --chat 987654321 --output markdown | rg " keyword"
195195```
196196
197- ** Export messages to markdown file:**
197+ ** Export to markdown file:**
198198
199199``` bash
200- tgcli messages list --chat < id > --output markdown > messages .md
200+ tgcli messages list --chat 987654321 --output markdown > exported .md
201201```
202202
203- ** Sync all accounts in parallel:**
203+ ** Sync multiple accounts in parallel:**
204204
205205``` bash
206- for store in ~ /.tgcli ~ /.tgcli- work ~ /.tgcli-uae ; do
207- tgcli --store $store sync -q &
206+ for account in personal work bot ; do
207+ tgcli --store ~ /.tgcli- $account sync -q &
208208done
209209wait
210210```
211211
212- ## More Info
212+ ## Links
213213
214214- GitHub: https://github.com/dgrr/tgcli
215- - crates .io: https://crates.io/crates/tgcli
215+ - Crates .io: https://crates.io/crates/tgcli
0 commit comments