Skip to content

side2k/tg-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tg-cli - a simple CLI tool for Telegram

Work in progress.

Usage: tg-cli [OPTIONS] --api-id <API_ID> --api-hash <API_HASH> <COMMAND>

Commands:
  login  Logs into the telegram account, saving session file
  help   Print this message or the help of the given subcommand(s)

Options:
  -s, --session-file <SESSION_FILE>  [default: .session]
      --api-id <API_ID>              [env: API_ID=12345678]
      --api-hash <API_HASH>          [env: API_HASH=abcde123456abcde]
  -h, --help                         Print help
  -V, --version                      Print version

Commands

login

Log in and save session. tg-cli will ask for verification code and password, if 2-step verification is enabled.

Example:

$ export TGCLI_PASSWORD=mysuperpassword
$ tg-cli login --phone +79001234567

list-dialogs

Put all dialog, their types (User/Group/Channel), ids and titles to stdout.

Example:

$ tg-cli list-dialogs

Listing 4 dialogs:
Group 1839823152 Old School Cruisers
Group 2223334444 Party makers
Channel 1234567899 Some interesting channel
User 111333 Telegram

Options:

  • --filter <FILTER> - list only dialogs that contain FILTER in their titles (case insensitive). If FILTER starts with @ - dialogs with matching usernames will be shown

msg <dialog> <message>

Send message message to the dialog identifiedy by dialog. By default, dialog is treated similar to --filter option argument in list-dialogs command. If you want it to be treated as numeric id, you can use -n (--numeric-id) option.

Examples:

$ tg-cli msg @someone_special "Whats cooking, good looking?"
$ tg-cli msg -n 12345678 "hey there!"

About

Simple CLI tool for Telegram messenger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages