tlgr skill
✓ VerifiedControl a personal Telegram account via the terminal to manage messages, chats, media, and account settings using the MTProto protocol.
- GitHub stars
- 199
- Files
- 1
- Last commit
- Oct 28, 2026
- License
- MIT
- Allowed tools
- —
What does the tlgr skill do?
tlgr controls a personal Telegram account via the terminal to manage messages, chats, media, and account settings using the MTProto protocol.
Summary generated from the skill's SKILL.md.
About the tlgr skill
Managing a personal Telegram account through a terminal interface is what tlgr enables for developers building autonomous agents. This tool uses the MTProto protocol to act as a real user rather than a bot, allowing an agent to perform any action available in a standard Telegram application. It is designed for agents that need to monitor unread messages, search chat histories, or interact with groups, channels, and contacts.
An agent should load this skill when it needs to send, edit, or schedule messages, manage media, or respond to real-time events via webhooks. The tool relies on a local daemon and provides all responses in JSON format with stable exit codes to ensure reliable programmatic control. Developers can restrict an agent to specific operations like reading or sending through command enablement to provide guard rails. It handles complex tasks such as managing polls, reactions, stories, and account privacy settings while respecting Telegram rate limits.
What an agent can do with it
- 1Receive real-time Telegram updatesAn agent can be notified of new messages or edits through an HTTP webhook instead of constant polling.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the tlgr skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the tlgr skill in Plugin
/plugin marketplace add tlgrcli/tlgr /plugin install tlgr@tlgr
Install the tlgr skill in Claude Code
~/.claude/skills/tlgr/SKILL.md
$ npx degit tlgrcli/tlgr/plugin/skills/tlgr ~/.claude/skills/tlgrInstall the tlgr skill in Claude Code (project)
.claude/skills/tlgr/SKILL.md
$ npx degit tlgrcli/tlgr/plugin/skills/tlgr .claude/skills/tlgrInstall the tlgr skill in Codex
~/.agents/skills/tlgr/SKILL.md
$ npx degit tlgrcli/tlgr/plugin/skills/tlgr ~/.agents/skills/tlgrInstall the tlgr skill in Gemini CLI
~/.gemini/skills/tlgr/SKILL.md
$ npx degit tlgrcli/tlgr/plugin/skills/tlgr ~/.gemini/skills/tlgrInstall the tlgr skill in Claude.ai
npx degit tlgrcli/tlgr/plugin/skills/tlgr tlgr && zip -r tlgr.zip tlgr # claude.ai → Customize → Skills → + → Create skill → Upload a skill → tlgr.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachabletlgrcli/tlgr/plugin/skills/tlgr is public and reachablegithub.com/tlgrcli/tlgr/tree/HEAD/plugin/skills/tlgr ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-10-28github.com/tlgrcli/tlgr/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/tlgrcli/tlgr/blob/HEAD/plugin/skills/tlgr/SKILL.m ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/tlgrcli/tlgr/blob/HEAD/plugin/skills/tlgr/SKILL.m ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 135 linesgithub.com/tlgrcli/tlgr/blob/HEAD/plugin/skills/tlgr/SKILL.m ↗Pass
SKILL.md
View on GitHubtlgr: Telegram for agents
tlgr controls a real Telegram user account over MTProto through a local
daemon. Everything you can do in a Telegram app, you can do from a shell:
messages, chats, groups, channels, contacts, media, stories, polls and more.
The full reference is AGENT.md in the repository, and tlgr schema --json
describes every command, flag and response.
Install and check
pipx install tlgr-cli # the command is `tlgr`
tlgr agent whoami --json # active account, daemon health, schema version
tlgr status --check # non-zero exit when anything is wrong
The daemon starts itself on first use. If whoami reports no account, go to
Logging in.
Rules that matter
- Always pass
--json. Errors are JSON on stdout too, and the exit code is the contract.--results-onlystrips the envelope and--select a,b.cprojects fields. - Reading can be visible.
chat opensends a read receipt the other side sees and clears the owner's unread badge. To look without a trace usechat catchup,message listorchat open --no-read. A read receipt cannot be taken back;chat unreadonly restores the owner's badge. - Name the account when there is more than one. Pass
-a <alias>so a message never goes out from the wrong identity. - Secrets never go in argv. Use
--password-env,--api-hash-env,--token-envand friends, or their-stdinand-fileforms. - Chats are
@usernameor a numeric id. Display names and phone numbers are not accepted. Put negative ids after--:tlgr message list --json --limit 5 -- -100123456. - Preview before destructive calls with
--dry-run, and confirm with the user before deleting, leaving, blocking or sending to someone new. - Respect rate limits. Exit 7 carries
wait_seconds; wait that long before retrying. Exit 13 means the answer is unknown, never treat it as a "no".
Everyday loop
tlgr catchup --json # every unread chat with recent messages, no read receipts
tlgr message list @alice --json --limit 20 # silent history
tlgr message search @team "invoice" --json # search one chat
tlgr message send @alice "On my way" --json # send
tlgr message send @alice "Yes" --reply-to 4211 --json
tlgr message edit @alice 4212 "Yes, 5pm" --json
tlgr message forward @news 88 90 --to @archive --json
tlgr chat open @alice --json # history plus a visible read receipt
Long text over 4096 UTF-16 units is refused unless you add --split.
--typing-auto shows "typing..." for a length-based duration before sending.
--schedule TS schedules instead of sending now.
Lists return {items, has_more, next_cursor}. Pass --cursor <next_cursor>
until has_more is false, or use --all.
Beyond messages
Each group has --help and a generated page in docs/reference/:
| Group | Examples |
|---|---|
chat |
list --unread, get --full, posters, members, archive, mute, leave |
contact, user, resolve |
find, add and inspect people; turn a link or username into a peer |
reaction, poll, todo, location |
react, vote, create polls and checklists, share places |
media, sticker, gif, emoji |
upload, download, export |
story, folder, profile, privacy |
post stories, organise folders, change settings |
account |
list, check, session list --unconfirmed |
Before planning something unusual, run tlgr agent capabilities --json. It
separates what this build cannot do, what this account may not do (Premium,
bot-only, admin-only) and what tlgr refuses on purpose, each with a reason.
Logging in
Login is two ordinary commands, so only reading the code needs a person:
tlgr auth send-code +15551234567 --alias main --api-id 12345 --api-hash-env TLGR_API_HASH --json
tlgr auth verify-code 12345 --alias main --json
Ask the user for the code Telegram sends them. Exit 4 with
AUTH_PASSWORD_REQUIRED means two-step verification is on: rerun
verify-code with --password-env TLGR_2FA_PASSWORD after the user sets
that variable. Never ask the user to paste a password into the chat.
Reacting to events
To be woken by Telegram instead of polling, the daemon can push events to an HTTP endpoint, signed with HMAC:
tlgr webhook set --url https://example.com/hooks/agent \
--events message_new,message_edited --secret-env TLGR_WEBHOOK_SECRET --enabled
tlgr webhook test
tlgr events list --json lists all event types. Deterministic auto-replies and
forwards that need no model can run in the daemon as jobs in
~/.tlgr/jobs.yaml.
Limiting what you can do
--enable-commands message.list,message.send,chat.list (or
TLGR_ENABLE_COMMANDS) allows only those operations; anything else exits 6.
Use it when the user wants you read-only or restricted to a few actions. It is
a guard rail, not a security boundary.
Exit codes
| Code | Meaning | What to do |
|---|---|---|
| 0 | success | meta.already: true means it was already done |
| 2 | bad arguments | fix the call; check tlgr schema <command> --json |
| 3 | empty | nothing matched |
| 4 | auth needed | log in again |
| 5 | not found | wrong chat or id |
| 6 | permission denied or blocked by --enable-commands |
do not retry |
| 7 | rate limited | wait wait_seconds |
| 8 | transient | retry shortly |
| 11, 12 | daemon or IPC problem | tlgr daemon status --json, then tlgr daemon restart |
| 13 | indeterminate | report as unknown |
Files in this skill
1tlgr skill questions
How do I install the tlgr skill in Claude Code?
Run npx degit tlgrcli/tlgr/plugin/skills/tlgr ~/.claude/skills/tlgr. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the tlgr skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How can I read messages without sending a read receipt?
Use the chat catchup, message list, or chat open --no-read commands to view history silently.
How do I handle Telegram rate limits?
If you receive exit code 7, it indicates you are rate limited; the response will include wait_seconds, which is how long you should wait before retrying.
Can I automate replies to new messages?
Yes, you can set up a webhook to push events to an HTTP endpoint or use deterministic auto-replies defined in ~/.tlgr/jobs.yaml.
How do I restrict the agent to only certain actions?
You can use the --enable-commands flag to whitelist specific operations, such as message.list or message.send.