Telegram

Step-by-step scenarios

Common Telegram CLI tasks step by step: the commands in order, why each one runs and what to look at.

Each scenario is a common task in order: the commands to run, why each one runs and what to look at in the answer. The same scenarios are in the terminal: tg guide lists them and tg guide <name> prints one.

Commands that use an account start with your profile, the name you gave the account at login: tg <profile> ….

Give an agent your account, never the send button

Let an agent read and draft from your Telegram while every send is refused.

  1. tg mcp setup claude-code --permission messages.send=deny --allow-writes

    add this profile to Claude Code; its server refuses messages send whatever the profile allows, and --allow-writes acknowledges the other tools that may write

  2. tg schedule agent morning claude "run the daily follow-up review: tg skill show follow-ups" --at 08:00

    a review every morning by an agent that runs with TG_READ_ONLY=1, so it drafts and never sends

  3. tg sends list

    every attempt to send, refused ones too, so you can see what the agent tried

What to look at:

  • refused lines in sends list, and which command asked
  • the schedule's last run in tg schedule list

In the terminal: tg guide agent-without-send

Catch up after a day away

Know what changed, who waits on you and what you promised, without opening every chat.

  1. tg review 'date>1d' --transcribe

    every message since yesterday in the chats that changed, yours too, with voice notes as text

  2. tg review --unanswered 4h

    questions to you that nobody answered for four hours or more

  3. tg tasks agenda

    tasks due today, replies you owe and replies you are waiting for

What to look at:

  • who asked first and how long ago
  • promises in your own messages that no task holds yet

review reads the local store and the chats that changed; by default nothing is marked read; --mark-read asks for it.

In the terminal: tg guide catch-up

Find what someone said

Find a message you half remember, read it in context and share a link to it.

  1. tg search all invoice

    messages and notes in one search, best match first; add --offline to stay on this computer

  2. tg messages context Team 1234

    the message and what came either side of it, from the hit's chat and id

  3. tg messages link Team 1234

    a link to the message to paste into a note or a task

What to look at:

  • the chat and the time of each hit
  • the ref of the hit you want, which the next commands take

In the terminal: tg guide find-what-was-said

Make a chat's files searchable

Find words inside the PDFs and documents people sent you, not only in the messages.

  1. tg messages sync Team

    bring the chat's history in the local store up to date

  2. tg attachments extract --chat Team --download --output-dir tg-files

    save the files not downloaded yet and keep their text in the local store

  3. tg search all invoice --offline

    the files' text is now found with the messages, without asking Telegram

What to look at:

  • files whose text could not be read; scans need --ocr
  • the cursor in the answer when there are more files to read

In the terminal: tg guide searchable-files

Works with other tools

These Memo scenarios also use tg: