CLI tools

tg

tg is a Telegram client for the command line and for AI agents. It works with your own Telegram account: read your chats, find what was said, and answer — yourself, or through Claude, Codex, Cursor and other agents, within limits you set. In the groups you run, see which questions nobody answered and who joined.

It is built for scripts and agents first: one operation per call, the same shape of answer every time, and a fixed exit code for each kind of failure.

The first minute

npm install -g @leemour/tg-cli
tg session start          # your app from my.telegram.org, then a QR code to scan
tg inbox                  # other people's unread messages, in every chat; nothing is marked read
tg messages list me       # Saved Messages, the latest 20

It needs Node 22 or newer, or Bun (installation.md). The first login asks for your own Telegram app; tg can register it for you (sessions.md).

What it can do, how agents use it and how it differs from other tools: the README.

Where to go next

PageAnswers
installation.mdWhat does it need, where do its files go, how do I upgrade or remove it?
usage.mdHow do I read, page, send, and use it from a script?
sessions.mdHow does login work, where are the keys, how do profiles work?
archive.mdWhat does the local store keep, and how do I fill, search, export and back it up?
groups.mdHow do I keep up with a group I run?
bot.mdHow do I run a Telegram bot from the command line?
mcp.mdHow do I connect Claude Desktop, Cursor or another client without a terminal?
remote.mdHow do I reach it from ChatGPT or Claude in the browser?
recipes.mdWhat can an agent do for me every day, and how do I run it on a schedule?
commands.mdEvery command, option and exit code
configuration.mdWhat can I set, and which value wins?
diagnostics.mdWhat did a command do, and what is never recorded?
troubleshooting.mdSomething does not work: what the screen says, and what to do
security.mdWhat reaches the disk and the network, and what stops a send going to the wrong place?
roadmap.mdWhat is coming next?

On this page