WireCat Telegram

dev.wirecat由 wirecat.dev 發布v0.117.0更新於 Nov 7, 2026

Your Telegram account for agents: read, search and send messages. Sign in with the tg CLI first.

發布方自己的服務:Wire Cash: bank wire fees and transfer costs

概覽

AI 產生的概覽

透過本機 tg CLI 把代理接上你自己的 Telegram 帳號,讓它在你能設定的限制內讀取、搜尋和傳送訊息。

可以做什麼
  • 讀取聊天、歷史紀錄、單一訊息及其前後內容、各聊天的未讀訊息,以及上次回顧以來的全部內容
  • 在本機和 Telegram 上依關鍵字、人物、日期、檔案、連結和標籤搜尋訊息與筆記
  • 傳送、回覆、編輯、轉寄、置頂、加入表情回應、刪除,並傳送檔案、相片、語音訊息和排程訊息
  • 管理群組:無人回答的問題、加入與退出事件、成員、話題、邀請連結和審核規則
  • 管理聯絡人和設定檔,並透過 Bot API 及其權杖操作機器人
  • 轉錄語音訊息、下載附件,以及匯出或備份本機存放區
適用情境
適合讓助理掌握 Telegram 動態、查出何時與誰談定了什麼、追蹤承諾與未解決的問題,或以你的名義起草並傳送回覆。也適合需要存取整個帳號、而不只是機器人聊天的代理。
執行需求
需在本機安裝 tg CLI(npm 套件,需要 Node 22.19+ 或 24+,或 Bun),支援 macOS、Linux 和 Windows。需在 my.telegram.org 自行註冊 Telegram 應用程式,並以 QR 碼或手機號碼加兩步驗證登入;應用程式金鑰存入系統鑰匙圈。MCP 伺服器以 tg personal mcp serve 指令啟動。
安裝前請注意
它以你的身分運作,等同你帳號上的另一台裝置,能看到你的全部聊天、群組、頻道和聯絡人。傳送是真實動作:受設定檔權限、收件者名單和每小時傳送上限(預設 30 則)約束,mcp add 在允許寫入前會中止。本機存放區以未加密形式保存所讀內容的全文,登出後仍會保留。預設情況下搜尋詞也會送到 Telegram 的伺服器搜尋,使用離線模式可讓查詢只留在本機。工作階段檔案等同你的密碼。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 WireCat Telegram,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Telegram CLI for AI agents]

tg — Telegram CLI for AI agents

Your whole Telegram account in the terminal, searchable on your computer, and ready for Claude Code, Codex, Cursor or any agent — within limits you set.

Docs · Examples · WireCat

[npm] [CI] [Node] [Bun] [npm downloads] [License: Apache 2.0]

An example conversation (invented people, illustrative output):

text
You:    Use tg CLI. What did I promise anyone in the last three days?Agent:  (runs tg personal review 'date>3d': 12 chats)        I owe        · Alice Example — the invoice by Friday. "Alice Example", 24.09        Waiting on others        · Bob Sample — the mock-up by 25.09. Not in "Design" yetYou:    Remind Bob about the mock-up.Agent:  Draft: "Hi Bob, how is the mock-up going?" Send it?You:    Yes.

Quick start

sh
npm install -g @wirecat/tg-cli    # or: bun add -g @wirecat/tg-cli; pnpm: see docs/installation.mdtg skill install --for all        # the agent skill, for Claude Code, Codex and Gemini CLItg personal setup                 # app registration and logintg personal inbox                 # other people's unread messages, in every chat; nothing is marked read

A global install does not install the agent skill: tg personal setup offers it, or run tg skill install --for all. npm may warn that install scripts are blocked or "not yet covered by allowScripts" (@wirecat/tg-cli, better-sqlite3); that is harmless, and you need not allow them — why. On Windows, if tg is not found, open a new terminal, or use the PowerShell installer in the installation guide.

Allow about five minutes. tg personal setup registers your own Telegram app at my.telegram.org, logs in by QR code, checks your first chats and installs the agent skill. Downloading older history is a separate step.

It needs Node 22.19+ or 24+, or Bun, on macOS, Linux or Windows. Try it without installing: npx @wirecat/tg-cli --help.

More: installation guide · on wirecat.dev

What can you do?

Catch up. "Use tg CLI. What came in since this morning, and who is waiting for my answer?"

sh
tg personal inboxtg personal review 'date>1d'

Find anything. "Use tg CLI. When did we agree on the venue with Alice?" — an answer with the date and the message itself.

sh
tg personal search all "venue"                # messages and notes on this computer, and Telegram's own search

By default the words also go to Telegram's server search; add --offline to keep the query on this computer.

Keep your promises. "Use tg CLI. What did I promise, and what am I still waiting on?" tg personal review hands over everything said since the last review in one call, your own messages too.

sh
tg personal review --new                      # what changed since the last review --new

Run your groups. "Use tg CLI. Which questions in Hiking has nobody answered?"

sh
tg personal review chat:Hiking --unansweredtg personal chats events "Hiking" "time>=7d"  # who joined, left, was added or removed

More: recipes, with a schedule and limits for each · on wirecat.dev

Built for AI agents

Your agent. Your Telegram. Your rules.

  • Agents with a terminal (for example Claude Code, Codex, Gemini CLI) run tg commands themselves. The bundled skill tells them how: tg personal setup --agent … or tg skill install puts it in place, and tg skill show prints it before login.
  • Apps without a terminal (for example Claude Desktop, Cursor and other MCP clients) connect to tg personal mcp serve. It comes with ready prompts: /catch-up, /review, /reply, /find, /open-tasks and /link-conversations.
sh
tg personal mcp add claude-code  # or: tg personal mcp add codextg personal mcp config      # the entry for Claude Desktop, Cursor and others

The profile can send by default, so mcp add stops first. Check the profile's permissions, then run it again with --allow-writes.

More: the MCP server · on wirecat.dev

Why tg?

  • Your whole account, not only bots. Every chat, group, channel and contact, with its history — tg is one more of your devices.
  • Local-first search. Everything read is kept on your computer. Search reads that copy and, by default, asks Telegram's own search too; --offline keeps the query on your computer.
  • Made for agents. One operation per call, the same JSON shape every time with --json, a fixed exit code for each kind of failure, an MCP server and a skill.
  • Safe by default. Reading marks nothing read. A profile decides which actions an agent may take, which chats it may send to, and how many messages an hour (30 by default). When a send's outcome is unknown, tg says so and gives a repeat command that Telegram does not deliver twice.
  • The full Bot API too. All 185 methods, next to the convenient bot commands.

More: compared with other tools · on wirecat.dev

Your account

tg works in your name, as one more of your devices. It is not a bot: it talks to Telegram over MTProto, Telegram's own API for client apps, with an app you register yourself. It sees your chats, their history, groups, channels and contacts.

sh
tg personal chats list --limit 5tg personal messages list "Book club" --limit 20tg personal messages send "Book club" "Call at 3?" --reply-to <id>tg personal reactions add "Book club" <id> 👍tg personal messages send me "Call mum" --at-time 2h  # a reminder in Saved Messages in two hourstg personal messages send "Book club" "The minutes" --file minutes.pdftg personal messages download "Book club" <id> --output-dir ~/Downloadstg personal messages transcribe "Book club" <id>  # a voice message as text
  • Read. Chats, history, one message with its neighbours, other people's unread messages in every chat (tg personal inbox), everything since the last review (tg personal review), new messages as they arrive (tg personal watch), a message's files, voice messages as text.
  • Write. Markdown, replies, files, photos, videos and voice messages, silent and scheduled messages (they go out even with this computer off), edits, forwards, pins, reactions, polls, deletion — for you or for everyone.
  • Voice on your computer. Telegram transcribes for Premium accounts; tg can also run a speech model on this machine, downloaded only when you ask.
  • Contacts and the account. Add, rename, block and import contacts; your own aliases and notes for people; who you are logged in as, and every device logged in to the account.
  • One person. Their profile, when they were last seen, their messages per shared chat, and whether the account looks like a bot or a spammer.

More: using tg · on wirecat.dev · one person · on wirecat.dev

Log in and profiles

Every user registers their own Telegram app; tg personal setup or tg personal session start does it for you. The app keys go to the system keyring, and the session is a file only your user can read.

sh
tg personal session start               # a QR code: Settings → Devices → Link Desktop Devicetg personal session start phone         # or a phone number, the code and your 2FA passwordtg personal session start qr            # without a terminal (an agent): the QR code as text to paste into the chattg personal account show                # who you are logged in astg account list                         # every profile here, and who each is logged in as

Several accounts are several profiles, and the profile is the first word, not an option:

sh
tg personal chats list     # profile "personal"tg work chats list         # profile "work"export TG_PROFILE=work     # or for the whole shell session

tg never picks a profile for you, not even the only one: a command that uses an account and has no profile named stops and lists the profiles on this computer. Name one, or set TG_PROFILE for a whole shell session.

More: login and sessions · on wirecat.dev · profiles · on wirecat.dev

The local store and search

Everything tg reads is kept in a local store on your computer. Search runs over it and over Telegram by default; --offline answers from the store without connecting.

sh
tg personal search messages 'contract chat:"Project Alpha"'tg personal search messages "contract" --backend archive  # local onlytg personal messages sync "Project Alpha" --last 5000 --backgroundtg personal store export "Project Alpha" --format markdown --output alpha.mdtg personal messages evidence "Project Alpha" --json  # bounded evidence for a chat brieftg personal server install                         # keep the store current as a systemd or launchd servicetg personal store backup ~/tg-backup.db            # a copy, safe while the store is in use

Search by words, people, dates, files, links and tags; save searches; find discussions by topic.

More: search · on wirecat.dev · the local store · on wirecat.dev

Groups you run

sh
tg personal review chat:Hiking --unanswered   # questions nobody answered in 24 hourstg personal chats events "Hiking" "time>=7d"  # who joined, left, was added or removed, and by whomtg personal chats members list "Hiking" --all     # everyone, with their role and when they were last seentg personal topics list "Hiking"                  # a forum group's topics, newest activity firsttg personal chats inspect https://t.me/+AbCdEf    # where an invite link leads, without joiningtg personal chats create "Hiking 2027" @alice_example  # a new group, with the people you nametg personal stats chats show "Hiking"             # group activity

Renaming a group, adding and removing members and admins, join requests, invite links, forum topics and moderation rules for links, forwards and floods are commands too.

More: groups you run · on wirecat.dev

A bot

tg personal bot works with a bot through Telegram's official Bot API and its token from @BotFather. You can keep several bots; each has a name you choose, and that name is the first word of the command.

sh
tg sales bot auth set                    # the token, at a hidden prompt; Telegram checks it firsttg sales bot auth show                   # which bot it istg sales bot recipients add user:<id>    # the bot may write only heretg sales bot messages send "Team" "Build is ready" --file report.pdftg sales bot api --help                  # every Bot API method, each with its fieldstg personal bot list --check             # every bot on this computer
  • Every Bot API method. tg <bot> bot api <method> takes native field flags or a JSON body.
  • One token per name, in the keyring, apart from your own login; TG_BOT_TOKEN for CI. The token is never printed — not in an error, not with --trace, not in a run record.
  • Recipients and a journal. Each bot has its own list of chats it may write to, and a journal of what it did, without the text.
  • Messages, admins, members, buttons, the menu, webhooks — send, edit, delete and pin; bot chats admins, bot callbacks answer, bot commands, bot webhooks.
  • History. bot watch prints and keeps what happens in the bot's chats; bot messages sync imports older channel and supergroup messages.

More: a Telegram bot · on wirecat.dev

Agent setup in detail

The skill. Claude Code reads ~/.claude/skills/tg-cli/; Codex, Gemini CLI and local Cursor read ~/.agents/skills/tg-cli/. Start a new agent session if it does not see the skill.

sh
tg skill install --for all        # both folders, without logging intg skill show                     # the complete instructions, without installing them

The MCP server. Commands stay discoverable with their arguments and current availability. The profile's permissions decide which may run. readonly stops writes; at ask the server shows no form, so set up approval in your agent app.

sh
claude mcp add tg -- tg personal mcp serve  # Claude Code, by handclaude mcp add tg -- tg mcp serve --profiles all  # one server for every profiletg personal mcp check            # check the local MCP server

From the browser. ChatGPT or Claude in the browser reach tg personal mcp serve --http --public-url <url> behind your tunnel, after a login with a one-time access code from your terminal.

More: the MCP server · on wirecat.dev · remote access · on wirecat.dev

Output for scripts and agents

With --json a command prints only data, as one JSON value — no tables, colour or hints; it does the same when another program reads its output. --jsonl prints one object per line. Every list has one shape:

json
{ "items": [ … ], "page": { "limit": 20, "has_more": true }, "meta": { … } }

An error goes to stderr as one line, with stdout empty, and the command exits with a fixed code: 4 log in, 5 the profile may not do this, 6 chat or message not found, 8 a limit, 9 Telegram did not answer in time, 14 unknown whether a message went. tg commands --json is the whole command tree. A partial read or download can exit 0: check complete in the JSON.

More: CLI contract · on wirecat.dev · every command and exit code · on wirecat.dev

Settings and permissions

sh
tg personal config set permissions.messages readonly  # no change to messages from this profiletg personal config set permissions.messages.send ask  # a question in the terminal before each sendtg personal config set sends_per_hour 10              # at most 10 sends an hour (30 by default)tg personal recipients add "Book club"                # the first add turns the recipient list ontg personal sends list                                # every attempt: sent, refused, failed or not knowntg personal config show                               # what is set, and where it came from

More: permissions · on wirecat.dev · configuration · on wirecat.dev

Limits

Each profile has one request pace, shared by every command, background job and server at once, so bulk work stays under Telegram's limits. Short waits from Telegram are waited out; a long wait stops the run instead of being repeated.

More: limits and waits · on wirecat.dev

Security

  • The session file is as good as your password, readable only by your user; the app keys are in the system keyring. No command takes a password, a login code or a phone number as an argument.
  • The local store holds the full text of what was read, unencrypted and readable only by your user. It stays after logout; only whole-disk encryption protects it from a stolen disk.
  • Every send, from a command or over MCP, passes the profile's limits and is written to a journal — without its text. --file refuses credential files, CLI folders and the local store.
  • Control characters in names, titles and messages are shown as text, so other people's text cannot control your terminal.
  • The limits stop an agent talked into sending by a message it read, not one that sets out to get round them: for that, run the agent in a sandbox or as a separate user.

To report a vulnerability: SECURITY.md.

More: security · on wirecat.dev

When something goes wrong

sh
tg personal doctor         # where the files are and whether a session is saved, without connectingtg personal doctor --online  # check that the login workstg personal chats list --trace  # each request to Telegram, with no text, names, phone numbers or keystg personal runs list      # recorded runs

More: troubleshooting by symptom · on wirecat.dev · diagnostics · on wirecat.dev

How it differs

Telegram's own apps are made for a person; tg is made for a script and an agent. A Telegram bot sees only the chats it was added to and speaks as the bot; tg is you, in your chats. Other open tools connect a Telegram account to an agent too: tgcli, telegram-mcp and tdl.

More: compared with other tools · on wirecat.dev

Part of WireCat

WireCat is an open-source, local-first context layer for AI agents. tg is where it starts; max-cli brings the MAX messenger into the same local store. Start with Telegram. Add more context when you need it. Your context. Any agent.

Questions and setup help: join the WireCat Discord. Bugs go to this repository's issues.

Technical docs

Every page is on wirecat.dev/en/docs/tg and in docs/:

PageAnswers
index · webThe docs site's start page: what tg is, the first minute, where to go next
installation · webHow do I install it, what does it need, where do its files go, how do I upgrade or remove it?
usage · webHow do I log in, read, page, send, and use it from a script — in that order?
sessions · webHow does login work: QR or phone, the app from my.telegram.org, the keyring, profiles, logout?
archive · webWhat does the local store keep, how do I fill it, search it, export it, keep it current and back it up?
search · webHow do I find a message by its words, sender, chat, date, file, link or tag, save a search and count?
attachments · webSending, downloading and reading files; text from documents and images, and searching it
rankings · webMessage and author rankings: metrics, scores, saved queries and evidence
topic-search · webHow do I find a discussion by what it was about, keep that current, and what leaves my computer?
query-language · webEvery search field, operator, preset, limit and the JSON answer
groups · webHow do I keep up with a group I run — open questions, newcomers, a weekly report?
people · webOne person: profile, what they said in each chat, does the account look like a bot
bot · webA bot through the Bot API: token, recipients, messages, admins and every Bot API method
replies · webAnswer messages by your rules, to everyone or only the people you choose
mcp · webHow do I connect Claude Desktop, Cursor or another client without a terminal?
remote · webChatGPT or Claude in the browser, through a login proxy and a tunnel
recipes · webWhat can an agent do for me every day, and how do I run it on a schedule?
compare · webHow does tg compare with tgcli, telegram-mcp and tdl, and when does another tool fit better?
commands · webEvery command, option and exit code — generated from the program
configuration · webHow do I configure common behavior?
permissions · webWhat a profile may read, what asks first, and what may go ahead
profiles · webSeveral accounts and bots on one computer, and how a command picks one
configuration-reference · webEvery key, type, default, scope and variable
cli-contract · webInvocation, output, errors, headless runs, bounds and previews
limits · webLimits, waits and background jobs
diagnostics · webWhat did a command do, and what is never recorded?
troubleshooting · webSomething does not work: what the screen says, and what to do
security · webWhat reaches the disk, what never does, and what stops a send going to the wrong place?
roadmap · webWhat is coming next?

What each version changed: CHANGELOG.md.

Development

sh
pnpm installpnpm lint && pnpm typecheck && pnpm testpnpm build && pnpm smoke:node # the built command, the bundle a user installspnpm build && pnpm smoke:bun  # the same under Bunpnpm generate                 # rewrites docs/commands.md from the command treebin/tg session start          # everything under .tg/ in this checkout, never the real profile

Everything that is not specific to Telegram — the commands, the store, the send guard, the MCP server — lives in cli-core, shared with max-cli. Telegram-specific code lives only in src/telegram/.

More: ARCHITECTURE · TESTING

Contributing

Pull requests, bug reports and ideas are welcome in issues.

Custom automation with Telegram, other messengers and AI agents: [email protected].

License

Apache License 2.0 — see LICENSE.

來源:README.md,提交 517ef8e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

9
  1. v0.117.0最新Nov 7, 2026
  2. v0.116.0Nov 5, 2026
  3. v0.115.0Nov 3, 2026
  4. v0.111.0Nov 1, 2026
  5. v0.110.0Nov 1, 2026
  6. v0.109.0Oct 31, 2026
  7. v0.108.0Oct 31, 2026
  8. v0.107.0Oct 30, 2026
  9. v0.106.0Oct 29, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Wire 整合