@wirecat/tg-cli 0.132.0 → 0.133.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +138 -317
  2. package/dist/bin/tg.js +2 -2
  3. package/dist/bundle/{adapter-OXVMOWVE.js → adapter-GSGX3WBH.js} +61 -60
  4. package/dist/bundle/{all-profiles-6OQC7PBL.js → all-profiles-VOCJ55YH.js} +9 -9
  5. package/dist/bundle/{anthropic-YFMIHFW5.js → anthropic-J6CTLU3W.js} +5 -5
  6. package/dist/bundle/{app-server-S7CJPJXN.js → app-server-GVFGA4TJ.js} +57 -57
  7. package/dist/bundle/{bot-api-KJ6EZ4R6.js → bot-api-LWONPIGK.js} +62 -61
  8. package/dist/bundle/{bot-history-JYCXDFW4.js → bot-history-XOW7Y2GC.js} +22 -22
  9. package/dist/bundle/{bun-FVTOBYZ2.js → bun-436CH6CP.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-KDGWBNOR.js → bun-sqlite-ZLB5RK5Q.js} +6 -6
  11. package/dist/bundle/chunk-2KQDJHF3.js +88 -0
  12. package/dist/bundle/{chunk-4CKYANQH.js → chunk-54WLIPIQ.js} +1 -1
  13. package/dist/bundle/{chunk-IY7CTAOQ.js → chunk-57KJ3TRS.js} +9 -9
  14. package/dist/bundle/{chunk-YAPO7QNO.js → chunk-5HKPQPD4.js} +6 -6
  15. package/dist/bundle/{chunk-EPR67IRV.js → chunk-5L44DSHV.js} +4 -4
  16. package/dist/bundle/{chunk-IYJ4B632.js → chunk-5LRTYBZW.js} +12 -12
  17. package/dist/bundle/{chunk-AUZWIBHJ.js → chunk-6A44ZZFC.js} +6 -6
  18. package/dist/bundle/{chunk-44A2XRDE.js → chunk-6CHIGUCY.js} +19 -19
  19. package/dist/bundle/{chunk-42MXCMW6.js → chunk-6H2NW6HK.js} +3 -3
  20. package/dist/bundle/{chunk-JPSRC732.js → chunk-6S77EKZU.js} +13 -13
  21. package/dist/bundle/{chunk-FPSRT2TX.js → chunk-6VCSOQFL.js} +2 -2
  22. package/dist/bundle/{chunk-4ZTVJHWU.js → chunk-7NF3V5L2.js} +4 -4
  23. package/dist/bundle/{chunk-Y57EKZZK.js → chunk-7NYP4RBO.js} +1617 -963
  24. package/dist/bundle/{chunk-BLZEQVP4.js → chunk-BXVB42KJ.js} +2 -2
  25. package/dist/bundle/{chunk-A5D3J7XZ.js → chunk-CEJYNB3I.js} +4 -4
  26. package/dist/bundle/{chunk-LZ3HFDYL.js → chunk-D2SJLZSH.js} +2 -2
  27. package/dist/bundle/{chunk-LF6FACSW.js → chunk-H7ML7X3G.js} +5 -5
  28. package/dist/bundle/{chunk-O3AM32YN.js → chunk-HB5DP6L5.js} +15 -15
  29. package/dist/bundle/{chunk-NWCFO37P.js → chunk-IBCXEVNY.js} +3 -3
  30. package/dist/bundle/{chunk-U7PHJSTX.js → chunk-IH4Z3KZU.js} +2 -2
  31. package/dist/bundle/{chunk-LMGVPDXN.js → chunk-IPPCQ7IK.js} +2 -2
  32. package/dist/bundle/{chunk-OIRNHSAH.js → chunk-IYAXLLGR.js} +6 -6
  33. package/dist/bundle/{chunk-5UPEEMEF.js → chunk-JGMXBAGH.js} +104 -41
  34. package/dist/bundle/{chunk-4YB7JU2W.js → chunk-JKSD43L7.js} +6 -6
  35. package/dist/bundle/{chunk-YSNQGOUI.js → chunk-JPNVEPS4.js} +439 -394
  36. package/dist/bundle/{chunk-74UPKW7H.js → chunk-KEN4B57V.js} +2 -2
  37. package/dist/bundle/{chunk-PYECFCPD.js → chunk-KHUXDSXN.js} +1 -1
  38. package/dist/bundle/{chunk-2UGSIHLV.js → chunk-KUA24HWG.js} +2 -2
  39. package/dist/bundle/{chunk-JMJOWT4N.js → chunk-KVFUH5IT.js} +1 -1
  40. package/dist/bundle/{chunk-KJICORS4.js → chunk-LBZEZO32.js} +36 -36
  41. package/dist/bundle/{chunk-5RDNBG7D.js → chunk-LIQMUDIZ.js} +2 -2
  42. package/dist/bundle/{chunk-ESOFH7PA.js → chunk-LOS4D6ZB.js} +60 -30
  43. package/dist/bundle/{chunk-PR4F3TYK.js → chunk-LQQSDGQ6.js} +35 -36
  44. package/dist/bundle/{chunk-BSXS7VAC.js → chunk-M6QOM6SL.js} +1 -1
  45. package/dist/bundle/{chunk-B4LGDOG5.js → chunk-N3JUHGKM.js} +302 -282
  46. package/dist/bundle/{chunk-CFWFESBO.js → chunk-N7QREPZW.js} +8 -8
  47. package/dist/bundle/{chunk-7SEVVE3X.js → chunk-NAXOT35J.js} +3 -3
  48. package/dist/bundle/{chunk-YVI5SQPY.js → chunk-NO2LIHWA.js} +1 -1
  49. package/dist/bundle/{chunk-DXPGMUOR.js → chunk-NTWXL2QV.js} +2 -2
  50. package/dist/bundle/{chunk-BMI2NWFI.js → chunk-O6JUVATT.js} +8 -8
  51. package/dist/bundle/{chunk-FKGYXIN7.js → chunk-OWY52JBO.js} +7 -7
  52. package/dist/bundle/{chunk-UGD4SCUI.js → chunk-OX73ERZW.js} +1 -1
  53. package/dist/bundle/{chunk-ZRW3DF25.js → chunk-QGWISM4W.js} +24 -24
  54. package/dist/bundle/{chunk-4EDJJQJI.js → chunk-QVGEL66U.js} +8 -8
  55. package/dist/bundle/{chunk-LG3K5NHX.js → chunk-QWO7L4UH.js} +7 -7
  56. package/dist/bundle/{chunk-DSJNZXTP.js → chunk-QYLZD4DS.js} +1 -1
  57. package/dist/bundle/{chunk-PG37E63A.js → chunk-RABUG4KA.js} +60 -60
  58. package/dist/bundle/{chunk-HBSKP7OV.js → chunk-SMI2EUH4.js} +1 -1
  59. package/dist/bundle/{chunk-2LZD2VFV.js → chunk-SMU6NA7F.js} +4 -4
  60. package/dist/bundle/{chunk-AERP2QR6.js → chunk-TCI7I6YF.js} +10 -10
  61. package/dist/bundle/{chunk-SMQ45RZX.js → chunk-THYGLTRB.js} +9 -60
  62. package/dist/bundle/{chunk-NLRGMP7M.js → chunk-TPD37ECC.js} +3 -3
  63. package/dist/bundle/{chunk-FIUH52FE.js → chunk-TTDZVWDU.js} +1 -1
  64. package/dist/bundle/{chunk-YRXSNH3R.js → chunk-UGS57TT5.js} +2 -2
  65. package/dist/bundle/{chunk-OGZZUDJJ.js → chunk-UIAKLELF.js} +54 -54
  66. package/dist/bundle/{chunk-O43PARFS.js → chunk-UKBK2VWZ.js} +208 -161
  67. package/dist/bundle/{chunk-JNWKV3QV.js → chunk-UQYL6TJ7.js} +4 -4
  68. package/dist/bundle/{chunk-3QHKZLBU.js → chunk-UZ63ORMY.js} +4 -4
  69. package/dist/bundle/{chunk-UAFSDTID.js → chunk-VCAOH45X.js} +1 -1
  70. package/dist/bundle/{chunk-6LPUK62N.js → chunk-VGN5YXYI.js} +3 -3
  71. package/dist/bundle/{chunk-N5LZ6L4D.js → chunk-VTQMR3XG.js} +3 -3
  72. package/dist/bundle/{chunk-QS46C5SW.js → chunk-VWJTYAIQ.js} +17 -17
  73. package/dist/bundle/{chunk-M2TV6BDB.js → chunk-WCYKVX3B.js} +7 -7
  74. package/dist/bundle/{chunk-QNEAPLOP.js → chunk-XDQU5HBO.js} +12 -12
  75. package/dist/bundle/{chunk-ZJIGVT6Z.js → chunk-XKOMP3HV.js} +2 -2
  76. package/dist/bundle/{chunk-JDNDWZYS.js → chunk-XOX4BX5A.js} +4 -4
  77. package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-YAPDU3SV.js} +1 -1
  78. package/dist/bundle/{chunk-JZJV3DYK.js → chunk-YY6FGKGD.js} +2 -2
  79. package/dist/bundle/{chunk-WAVRUADL.js → chunk-ZHO3TPHM.js} +13 -13
  80. package/dist/bundle/{chunk-NWDADTPE.js → chunk-ZYAHZKYF.js} +3 -3
  81. package/dist/bundle/command-contract-TQIARAB4.js +37 -0
  82. package/dist/bundle/{command-server-entry-TM264M2J.js → command-server-entry-AE27QXTE.js} +27 -27
  83. package/dist/bundle/{decode-RJFOSHCE.js → decode-RQPPZ72F.js} +5 -5
  84. package/dist/bundle/{dispatch-7OZP3X4O.js → dispatch-KQO2MCSH.js} +8 -8
  85. package/dist/bundle/{echarts-PYKF4D7B.js → echarts-FZRIACN4.js} +2 -2
  86. package/dist/bundle/{embed-JFN6Z5TG.js → embed-TOSWWMDL.js} +6 -6
  87. package/dist/bundle/{embedder-WN54JIMY.js → embedder-JHIQSBGD.js} +9 -9
  88. package/dist/bundle/{entry-Z6LO6N6S.js → entry-DU4KRXTG.js} +9 -9
  89. package/dist/bundle/{failure-UONA2IA5.js → failure-3YC3YGYO.js} +2 -2
  90. package/dist/bundle/{first-run-WQAKES7G.js → first-run-DQQT4FID.js} +12 -12
  91. package/dist/bundle/first-screen-7N4CTZSA.js +37 -0
  92. package/dist/bundle/{instructions-PR4BBBTM.js → instructions-WI64CJQ6.js} +1 -1
  93. package/dist/bundle/{mcp-O6ACR2DX.js → mcp-VMS6PBCU.js} +2 -2
  94. package/dist/bundle/meeting-combined-3RAOFQ7M.js +23 -0
  95. package/dist/bundle/{meeting-model-YVTUOM4H.js → meeting-model-XNRSREIK.js} +11 -11
  96. package/dist/bundle/{meeting-semantic-X4KG6RNV.js → meeting-semantic-OOSCHQMB.js} +6 -6
  97. package/dist/bundle/{node-OVS5LTVZ.js → node-JLKDNVKV.js} +2 -2
  98. package/dist/bundle/{node-sqlite-LC44SM4Z.js → node-sqlite-YOGH26O2.js} +7 -7
  99. package/dist/bundle/{oauth-NSVUFQCW.js → oauth-FOMXM5HP.js} +7 -7
  100. package/dist/bundle/{open-XN5SJFVY.js → open-SM2UXUKM.js} +5 -5
  101. package/dist/bundle/{openai-WOYZHJNL.js → openai-J2H7S6ZF.js} +15 -15
  102. package/dist/bundle/{process-UFBRGTQC.js → process-HI7OZBOI.js} +1 -1
  103. package/dist/bundle/{program-RAGBRRQH.js → program-VY4HFU25.js} +64 -63
  104. package/dist/bundle/{prompt-6HAKBUQN.js → prompt-NUUVFMOF.js} +5 -5
  105. package/dist/bundle/{proxy-transport-5EJVFUTC.js → proxy-transport-AN4VMRRN.js} +5 -5
  106. package/dist/bundle/{recognize-CN5COBVJ.js → recognize-MALJHPDI.js} +4 -4
  107. package/dist/bundle/{remote-STX5AMGE.js → remote-QUDRSTS2.js} +9 -9
  108. package/dist/bundle/{rerank-ZCOWTXIJ.js → rerank-2DSO3D3S.js} +7 -7
  109. package/dist/bundle/{serve-XMQEOIG2.js → serve-NCJ52MY3.js} +9 -9
  110. package/dist/bundle/server-CHGON5I2.js +70 -0
  111. package/dist/bundle/{server-PGGUD3DM.js → server-Y3M544AM.js} +49 -49
  112. package/dist/bundle/{sqlite-runtime-PS4DSOIU.js → sqlite-runtime-NJUSXVKK.js} +6 -6
  113. package/dist/bundle/{state-GL4ZC57O.js → state-AVOWQVET.js} +6 -6
  114. package/dist/bundle/{store-HJ76TLWD.js → store-BZ5ICDRP.js} +23 -19
  115. package/dist/bundle/{store-VISFXSHL.js → store-MMIYOL4H.js} +19 -17
  116. package/dist/bundle/store-maintenance-command-VKZ4WHUB.js +61 -0
  117. package/dist/bundle/tg.js +13 -13
  118. package/dist/version.d.ts +1 -1
  119. package/dist/version.js +1 -1
  120. package/package.json +3 -3
  121. package/skills/tg-cli/SKILL.md +78 -576
  122. package/skills/tg-cli/references/files.md +64 -0
  123. package/skills/tg-cli/references/history.md +22 -0
  124. package/skills/tg-cli/references/mcp-and-bots.md +54 -0
  125. package/skills/tg-cli/references/messages.md +111 -0
  126. package/skills/tg-cli/references/people.md +85 -0
  127. package/skills/tg-cli/references/search.md +130 -0
  128. package/skills/tg-cli/references/setup.md +91 -0
  129. package/skills/tg-cli/references/stats.md +45 -0
  130. package/skills/tg-cli/references/tasks.md +54 -0
  131. package/dist/bundle/command-contract-FRH7LBGE.js +0 -37
  132. package/dist/bundle/first-screen-4RFG22SA.js +0 -35
  133. package/dist/bundle/meeting-combined-MHWTZOF2.js +0 -23
  134. package/dist/bundle/server-WTNYWCZ4.js +0 -69
  135. package/dist/bundle/store-maintenance-command-SMARMN5C.js +0 -60
  136. /package/dist/bundle/{chunk-VKE77B3F.js → chunk-SHTHNBHG.js} +0 -0
package/README.md CHANGED
@@ -2,429 +2,250 @@
2
2
  <img src="https://raw.githubusercontent.com/WireCatLabs/tg-cli/main/docs/images/social-preview.png" alt="Telegram CLI for AI agents" width="100%">
3
3
  </p>
4
4
 
5
- # tg — Telegram CLI for AI agents
5
+ # tg: Telegram CLI for AI agents
6
6
 
7
7
  <p align="center">
8
- Your whole Telegram account in the terminal, searchable on your computer, and ready for Claude Code,
9
- Codex, Cursor or any agent — within limits you set.
8
+ Full control of your Telegram from the terminal. Your own account and your bots, every chat and its whole
9
+ history, for you and for Claude Code, Codex, Cursor or any AI agent.
10
10
  </p>
11
11
 
12
12
  <p align="center">
13
13
  <a href="https://wirecat.dev/en/docs/tg">Docs</a> ·
14
14
  <a href="https://github.com/WireCatLabs/tg-cli/blob/main/docs/recipes.md">Examples</a> ·
15
- <a href="https://wirecat.dev">WireCat</a>
15
+ <a href="https://discord.gg/DebENqbRrJ">Discord</a>
16
16
  </p>
17
17
 
18
18
  <p align="center">
19
19
  <a href="https://www.npmjs.com/package/@wirecat/tg-cli"><img src="https://img.shields.io/npm/v/@wirecat/tg-cli" alt="npm"></a>
20
20
  <a href="https://github.com/WireCatLabs/tg-cli/actions/workflows/ci.yml"><img src="https://github.com/WireCatLabs/tg-cli/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
21
- <a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/@wirecat/tg-cli" alt="Node"></a>
22
- <a href="https://bun.sh/"><img src="https://img.shields.io/badge/bun-tested-f9f1e1" alt="Bun"></a>
23
21
  <a href="https://www.npmjs.com/package/@wirecat/tg-cli"><img src="https://img.shields.io/npm/dm/@wirecat/tg-cli" alt="npm downloads"></a>
24
22
  <a href="https://github.com/WireCatLabs/tg-cli/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License: Apache 2.0"></a>
25
23
  </p>
26
24
 
27
- An example conversation (invented people, illustrative output):
25
+ - **Full control.** Connect your personal account and write as yourself, or connect any bot. Chats, groups, channels,
26
+ contacts, files and the whole Bot API, all from one tool.
27
+ - **Deep search that finds what others miss.** Every message you ever had, searched on your computer. It forgives
28
+ typos, finds synonyms and matches by meaning. Voice messages and files are searched too.
29
+ - **Groups that run themselves.** Auto-replies, moderation by your rules, unanswered questions, who joined and left,
30
+ activity analytics.
31
+
32
+ ## What you get
33
+
34
+ - **Never miss what matters.** One command shows who is waiting for your answer in every chat. Nothing gets marked
35
+ as read.
36
+ - **Find any message in seconds.** "When did we agree on the venue with Alice?" gives you the date and the message,
37
+ even with no internet.
38
+ - **Answer when you can't.** Auto-replies by your own rules, to the people you choose, while you sleep or travel.
39
+ - **Keep order in your groups.** Spam, floods and foreign links removed by your rules. Questions nobody answered,
40
+ new members, a weekly summary.
41
+ - **Understand any media.** Voice messages become text on your computer, with no Premium. Text is pulled from files
42
+ and scans. All of it is searchable.
43
+ - **Know who owes what.** "What did I promise this week, and what am I waiting for?" One answer across every chat.
44
+ - **See the whole picture.** Link a person's Telegram and MAX accounts, add WhatsApp, Google Calendar and Meet, and ask
45
+ about a person or a project across all of them.
28
46
 
29
47
  ```text
30
- You: Use tg CLI. What did I promise anyone in the last three days?
48
+ You: What did I promise anyone in the last three days?
31
49
  Agent: (runs tg personal review 'date>3d': 12 chats)
32
50
  I owe
33
- · Alice Example — the invoice by Friday. "Alice Example", 24.09
51
+ · Alice Example: the invoice by Friday. "Alice Example", 24.09
34
52
  Waiting on others
35
- · Bob Sample — the mock-up by 25.09. Not in "Design" yet
53
+ · Bob Sample: the mock-up by 25.09. Not in "Design" yet
36
54
  You: Remind Bob about the mock-up.
37
55
  Agent: Draft: "Hi Bob, how is the mock-up going?" Send it?
38
56
  You: Yes.
39
57
  ```
40
58
 
41
- ## Quick start
42
-
43
- ```sh
44
- npm install -g @wirecat/tg-cli # or: bun add -g @wirecat/tg-cli; pnpm: see docs/installation.md
45
- tg skill install --for all # the agent skill, for Claude Code, Codex and Gemini CLI
46
- tg personal setup # app registration and login
47
- tg personal inbox # other people's unread messages, in every chat; nothing is marked read
48
- ```
59
+ *Invented people, illustrative output.*
49
60
 
50
- 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`,
51
- `better-sqlite3`); that is harmless, and you need not allow them — [why](https://github.com/WireCatLabs/tg-cli/blob/main/docs/installation.md#install).
52
- On Windows, if `tg` is not found, open a new terminal, or use the PowerShell installer in
53
- [the installation guide](https://github.com/WireCatLabs/tg-cli/blob/main/docs/installation.md#windows-one-install-command).
61
+ ## Why tg
54
62
 
55
- Allow about five minutes. `tg personal setup` registers your own Telegram app at
56
- [my.telegram.org](https://my.telegram.org/apps), logs in by QR code, checks your first chats and installs
57
- the agent skill. Downloading older history is a separate step.
63
+ - **Your data never leaves your computer.** `tg` talks only to Telegram. There is no WireCat server and no account
64
+ with us. Your history is kept in a local database that only your user can read.
65
+ - **The official Telegram API, with your own app.** `tg` logs in like the Telegram desktop app does, as one more of
66
+ your devices. It keeps its pace under Telegram's limits, so bulk work stays within them.
67
+ - **Search that goes all the way back.** Download a chat's full history once, then search it with no network. It finds a
68
+ word with a typo, its other forms and its synonyms, a question you half remember, whole discussions by meaning, and
69
+ asks Telegram's own server search at the same time.
70
+ - **Safe to give to an agent.** You decide what an agent may do: read only, write only to the chats you list, at most
71
+ so many messages an hour (30 by default). Text from other people is marked as untrusted, so an agent never takes a
72
+ message it read as an instruction. Every send is logged.
73
+ - **Ready for any agent.** A skill for agents with a terminal, an MCP server with ready prompts for Claude Desktop and
74
+ Cursor, and a secure link for ChatGPT and Claude in the browser.
75
+ - **Free and open source.** Apache 2.0, on macOS, Linux and Windows.
58
76
 
59
- It needs **Node 22.19+ or 24+**, or **Bun**, on macOS, Linux or Windows. Try it without installing:
60
- `npx @wirecat/tg-cli --help`.
77
+ How it compares with other Telegram tools: [the comparison](https://wirecat.dev/en/docs/tg/compare).
61
78
 
62
- More: [installation guide](https://github.com/WireCatLabs/tg-cli/blob/main/docs/installation.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/installation)
63
-
64
- ## What can you do?
65
-
66
- **Catch up.** *"Use tg CLI. What came in since this morning, and who is waiting for my answer?"*
79
+ ## Quick start
67
80
 
68
81
  ```sh
69
- tg personal inbox
70
- tg personal review 'date>1d'
82
+ npm install -g @wirecat/tg-cli # or: bun add -g @wirecat/tg-cli
83
+ tg personal setup # register your Telegram app, log in by QR code, install the agent skill
84
+ tg personal inbox # other people's unread messages, in every chat
71
85
  ```
72
86
 
73
- **Find anything.** *"Use tg CLI. When did we agree on the venue with Alice?"* — an answer with the date
74
- and the message itself.
87
+ It takes about five minutes. `personal` is a name you choose for this account. You can add `work` or any other later.
88
+ `tg personal setup` registers your own Telegram app at [my.telegram.org](https://my.telegram.org/apps), logs in by QR
89
+ code and installs the skill for Claude Code, Codex and Gemini CLI.
75
90
 
76
- ```sh
77
- tg personal search all "venue" # messages and notes on this computer, and Telegram's own search
78
- ```
91
+ You need Node.js 22.19+ or 24+, or Bun. Try it without installing: `npx @wirecat/tg-cli --help`.
79
92
 
80
- By default the words also go to Telegram's server search; add `--offline` to keep the query on this computer.
93
+ More: [installation](https://wirecat.dev/en/docs/tg/installation), with Windows and pnpm.
81
94
 
82
- **Keep your promises.** *"Use tg CLI. What did I promise, and what am I still waiting on?"* `tg personal review`
83
- hands over everything said since the last review in one call, your own messages too.
95
+ ## Use it with your agent
84
96
 
85
- ```sh
86
- tg personal review --new # what changed since the last review --new
87
- ```
97
+ Ask in plain words. The agent picks the commands.
88
98
 
89
- **Run your groups.** *"Use tg CLI. Which questions in Hiking has nobody answered?"*
90
-
91
- ```sh
92
- tg personal review chat:Hiking --unanswered
93
- tg personal chats events "Hiking" "time>=7d" # who joined, left, was added or removed
94
- ```
99
+ > *"Use tg. What came in since this morning, and who is waiting for my answer?"*
100
+ > *"Use tg. Which questions in Hiking has nobody answered?"*
101
+ > *"Use tg. Find the PDF Alice sent about the lease."*
95
102
 
96
- More: [recipes, with a schedule and limits for each](https://github.com/WireCatLabs/tg-cli/blob/main/docs/recipes.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/recipes)
97
-
98
- ## Built for AI agents
99
-
100
- Your agent. Your Telegram. Your rules.
101
-
102
- - **Agents with a terminal** (for example Claude Code, Codex, Gemini CLI) run `tg` commands
103
- themselves. The bundled [skill](https://github.com/WireCatLabs/tg-cli/blob/main/skills/tg-cli/SKILL.md)
104
- tells them how: `tg personal setup --agent …` or `tg skill install` puts it in place, and `tg skill show`
105
- prints it before login.
106
- - **Apps without a terminal** (for example Claude Desktop, Cursor and other MCP clients) connect to
107
- `tg personal mcp serve`. It comes with ready prompts: `/catch-up`, `/review`, `/reply`, `/find`, `/open-tasks` and `/link-conversations`.
103
+ - **Claude Code, Codex, Gemini CLI** and other agents with a terminal run `tg` themselves. `tg skill install --for all`
104
+ teaches them how.
105
+ - **Claude Desktop, Cursor** and other MCP apps connect to `tg personal mcp serve`. It comes with ready prompts:
106
+ `/catch-up`, `/review`, `/reply`, `/find`, `/open-tasks`.
107
+ - **ChatGPT or Claude in the browser** reach it through your own tunnel, after a login with a one-time code.
108
108
 
109
109
  ```sh
110
- tg personal mcp add claude-code # or: tg personal mcp add codex
111
- tg personal mcp config # the entry for Claude Desktop, Cursor and others
110
+ tg personal mcp add claude-code --allow-writes # or: codex
111
+ tg personal mcp config # the entry for Claude Desktop, Cursor and others
112
112
  ```
113
113
 
114
- The profile can send by default, so `mcp add` stops first. Check the profile's permissions, then run
115
- it again with `--allow-writes`.
116
-
117
- More: [the MCP server](https://github.com/WireCatLabs/tg-cli/blob/main/docs/mcp.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/mcp)
114
+ More: [agents and MCP](https://wirecat.dev/en/docs/tg/mcp) · [from the browser](https://wirecat.dev/en/docs/tg/remote) ·
115
+ [recipes](https://wirecat.dev/en/docs/tg/recipes)
118
116
 
119
- ## Why tg?
117
+ ## What it can do
120
118
 
121
- - **Your whole account, not only bots.** Every chat, group, channel and contact, with its history —
122
- `tg` is one more of your devices.
123
- - **Local-first search.** Everything read is kept on your computer. Search reads that copy and, by default,
124
- asks Telegram's own search too; `--offline` keeps the query on your computer.
125
- - **Made for agents.** One operation per call, the same JSON shape every time with `--json`, a fixed
126
- exit code for each kind of failure, an MCP server and a skill.
127
- - **Safe by default.** Reading marks nothing read. A profile decides which actions an agent may take,
128
- which chats it may send to, and how many messages an hour (30 by default). When a send's outcome is
129
- unknown, `tg` says so and gives a repeat command that Telegram does not deliver twice.
130
- - **The full Bot API too.** All 185 methods, next to the convenient bot commands.
119
+ ### Your account
131
120
 
132
- More: [compared with other tools](https://github.com/WireCatLabs/tg-cli/blob/main/docs/compare.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/compare)
133
-
134
- ## Your account
135
-
136
- `tg` works in your name, as one more of your devices. It is not a bot: it talks to Telegram over
137
- MTProto, Telegram's own API for client apps, with an app you register yourself. It sees your chats,
138
- their history, groups, channels and contacts.
121
+ Everything you do in the Telegram app: read and send, reply, forward, edit, pin, react, polls, scheduled and silent
122
+ messages, files, photos, videos and voice messages, contacts, devices.
139
123
 
140
124
  ```sh
141
- tg personal chats list --limit 5
142
125
  tg personal messages list "Book club" --limit 20
143
126
  tg personal messages send "Book club" "Call at 3?" --reply-to <id>
144
- tg personal reactions add "Book club" <id> 👍
145
- tg personal messages send me "Call mum" --at-time 2h # a reminder in Saved Messages in two hours
146
- tg personal messages send "Book club" "The minutes" --file minutes.pdf
147
- tg personal messages download "Book club" <id> --output-dir ~/Downloads
148
- tg personal messages transcribe "Book club" <id> # a voice message as text
149
- ```
150
-
151
- - **Read.** Chats, history, one message with its neighbours, other people's unread messages in every
152
- chat (`tg personal inbox`), everything since the last review (`tg personal review`), new messages as they arrive
153
- (`tg personal watch`), a message's files, voice messages as text.
154
- - **Write.** Markdown, replies, files, photos, videos and voice messages, silent and scheduled messages
155
- (they go out even with this computer off), edits, forwards, pins, reactions, polls, deletion — for
156
- you or for everyone.
157
- - **Voice on your computer.** Telegram transcribes for Premium accounts; `tg` can also run a speech
158
- model on this machine, downloaded only when you ask.
159
- - **Contacts and the account.** Add, rename, block and import contacts; your own aliases and notes
160
- for people; who you are logged in as, and every device logged in to the account.
161
- - **One person.** Their profile, when they were last seen, their messages per shared chat, and whether
162
- the account looks like a bot or a spammer.
163
-
164
- More: [using tg](https://github.com/WireCatLabs/tg-cli/blob/main/docs/usage.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/usage) · [one person](https://github.com/WireCatLabs/tg-cli/blob/main/docs/people.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/people)
165
-
166
- ## Log in and profiles
167
-
168
- Every user registers their own Telegram app; `tg personal setup` or `tg personal session start` does it for you. The
169
- app keys go to the system keyring, and the session is a file only your user can read.
170
-
171
- ```sh
172
- tg personal session start # a QR code: Settings → Devices → Link Desktop Device
173
- tg personal session start phone # or a phone number, the code and your 2FA password
174
- tg personal session start qr # without a terminal (an agent): the QR code as text to paste into the chat
175
- tg personal account show # who you are logged in as
176
- tg account list # every profile here, and who each is logged in as
127
+ tg personal messages send me "Call mum" --at-time 2h # a reminder in Saved Messages
128
+ tg personal review --new # everything new since the last review
177
129
  ```
178
130
 
179
- Several accounts are several profiles, and the profile is **the first word**, not an option:
131
+ More: [using tg](https://wirecat.dev/en/docs/tg/usage) · [one person](https://wirecat.dev/en/docs/tg/people)
180
132
 
181
- ```sh
182
- tg personal chats list # profile "personal"
183
- tg work chats list # profile "work"
184
- export TG_PROFILE=work # or for the whole shell session
185
- ```
186
-
187
- `tg` never picks a profile for you, not even the only one: a command that uses an account and has no
188
- profile named stops and lists the profiles on this computer. Name one, or set `TG_PROFILE` for a
189
- whole shell session.
190
-
191
- More: [login and sessions](https://github.com/WireCatLabs/tg-cli/blob/main/docs/sessions.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/sessions) · [profiles](https://github.com/WireCatLabs/tg-cli/blob/main/docs/profiles.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/profiles)
192
-
193
- ## The local store and search
194
-
195
- Everything `tg` reads is kept in a local store on your computer. Search runs over it and over
196
- Telegram by default; `--offline` answers from the store without connecting.
133
+ ### Search
197
134
 
198
135
  ```sh
199
- tg personal search messages 'contract chat:"Project Alpha"'
200
- tg personal search messages "contract" --backend archive # local only
201
- tg personal messages sync "Project Alpha" --last 5000 --background
202
- tg personal store export "Project Alpha" --format markdown --output alpha.md
203
- tg personal messages evidence "Project Alpha" --json # bounded evidence for a chat brief
204
- tg personal server install # keep the store current as a systemd or launchd service
205
- tg personal store backup ~/tg-backup.db # a copy, safe while the store is in use
136
+ tg personal search all "lease agreement" # messages and notes, best match first
137
+ tg personal search messages 'from:"Alice Example" invoice date>30d'
138
+ tg personal search messages 'What time does the export run?' --discover # a question you half remember
139
+ tg personal search conversations 'moving to the country' # discussions close in meaning
140
+ tg personal search messages "contract" --offline # never leaves your computer
206
141
  ```
207
142
 
208
- Search by words, people, dates, files, links and tags; save searches; find discussions by topic.
143
+ Filter by person, chat, date, file, link and tag. Save a search and run it again. Count matches by chat, person or day.
209
144
 
210
- More: [search](https://github.com/WireCatLabs/tg-cli/blob/main/docs/search.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/search) · [the local store](https://github.com/WireCatLabs/tg-cli/blob/main/docs/archive.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/archive)
145
+ More: [search](https://wirecat.dev/en/docs/tg/search) · [the query language](https://wirecat.dev/en/docs/tg/query-language) ·
146
+ [the local store](https://wirecat.dev/en/docs/tg/archive)
211
147
 
212
- ## Groups you run
148
+ ### Groups you run
213
149
 
214
150
  ```sh
215
- tg personal review chat:Hiking --unanswered # questions nobody answered in 24 hours
216
- tg personal chats events "Hiking" "time>=7d" # who joined, left, was added or removed, and by whom
217
- tg personal chats members list "Hiking" --all # everyone, with their role and when they were last seen
218
- tg personal topics list "Hiking" # a forum group's topics, newest activity first
219
- tg personal chats inspect https://t.me/+AbCdEf # where an invite link leads, without joining
220
- tg personal chats create "Hiking 2027" @alice_example # a new group, with the people you name
221
- tg personal stats chats show "Hiking" # group activity
151
+ tg personal review chat:Hiking --unanswered # questions nobody answered in 24 hours
152
+ tg personal chats events "Hiking" "time>=7d" # who joined, left, was added or removed, and by whom
153
+ tg personal chats rules set "Hiking" links report # your moderation rules: links, forwards, floods
154
+ tg personal stats chats show "Hiking" # activity
222
155
  ```
223
156
 
224
- Renaming a group, adding and removing members and admins, join requests, invite links, forum topics
225
- and moderation rules for links, forwards and floods are commands too.
226
-
227
- More: [groups you run](https://github.com/WireCatLabs/tg-cli/blob/main/docs/groups.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/groups)
157
+ Members, admins, join requests, invite links, forum topics and a daily member snapshot are commands too.
228
158
 
229
- ## A bot
159
+ More: [groups you run](https://wirecat.dev/en/docs/tg/groups) · [auto-replies](https://wirecat.dev/en/docs/tg/replies)
230
160
 
231
- `tg personal bot` works with a bot through Telegram's official [Bot API](https://core.telegram.org/bots/api) and
232
- its token from [@BotFather](https://t.me/BotFather). You can keep several bots; each has a name you
233
- choose, and that name is the first word of the command.
161
+ ### Voice, files and scans
234
162
 
235
163
  ```sh
236
- tg sales bot auth set # the token, at a hidden prompt; Telegram checks it first
237
- tg sales bot auth show # which bot it is
238
- tg sales bot recipients add user:<id> # the bot may write only here
239
- tg sales bot messages send "Team" "Build is ready" --file report.pdf
240
- tg sales bot api --help # every Bot API method, each with its fields
241
- tg personal bot list --check # every bot on this computer
164
+ tg personal messages transcribe "Book club" <id> # a voice message as text, on your computer
165
+ tg personal attachments extract # text from saved files
242
166
  ```
243
167
 
244
- - **Every Bot API method.** `tg <bot> bot api <method>` takes native field flags or a JSON body.
245
- - **One token per name, in the keyring**, apart from your own login; `TG_BOT_TOKEN` for CI. The token
246
- is never printed — not in an error, not with `--trace`, not in a run record.
247
- - **Recipients and a journal.** Each bot has its own list of chats it may write to, and a journal of
248
- what it did, without the text.
249
- - **Messages, admins, members, buttons, the menu, webhooks** — send, edit, delete and pin; `bot chats
250
- admins`, `bot callbacks answer`, `bot commands`, `bot webhooks`.
251
- - **History.** `bot watch` prints and keeps what happens in the bot's chats; `bot messages sync` imports
252
- older channel and supergroup messages.
168
+ More: [files and media](https://wirecat.dev/en/docs/tg/attachments)
253
169
 
254
- More: [a Telegram bot](https://github.com/WireCatLabs/tg-cli/blob/main/docs/bot.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/bot)
170
+ ### A bot
255
171
 
256
- ## Agent setup in detail
172
+ `tg <profile> bot` works with any bot through the official Bot API: all 185 methods, next to ready commands for
173
+ sending, replies and updates.
257
174
 
258
- **The skill.** Claude Code reads `~/.claude/skills/tg-cli/`; Codex, Gemini CLI and local Cursor read
259
- `~/.agents/skills/tg-cli/`. Start a new agent session if it does not see the skill.
175
+ More: [bots](https://wirecat.dev/en/docs/tg/bot)
260
176
 
261
- ```sh
262
- tg skill install --for all # both folders, without logging in
263
- tg skill show # the complete instructions, without installing them
264
- ```
177
+ ### With your other sources
265
178
 
266
- **The MCP server.** Commands stay discoverable with their arguments and current availability. The
267
- profile's `permissions` decide which may run. `readonly` stops writes; at `ask` the server shows no
268
- form, so set up approval in your agent app.
179
+ `tg` keeps what it reads in the same local database as the other WireCat tools, such as WhatsApp, MAX and Google
180
+ Calendar. `tg personal search all` finds a word in messages, notes, calendar events and meeting transcripts at once.
181
+ Mail has its own search in memo. `tg personal contacts link` records that two accounts are one person.
269
182
 
270
- ```sh
271
- claude mcp add tg -- tg personal mcp serve # Claude Code, by hand
272
- claude mcp add tg -- tg mcp serve --profiles all # one server for every profile
273
- tg personal mcp check # check the local MCP server
274
- ```
183
+ More: [WireCat](https://wirecat.dev)
275
184
 
276
- **From the browser.** ChatGPT or Claude in the browser reach `tg personal mcp serve --http --public-url <url>` behind
277
- your tunnel, after a login with a one-time access code from your terminal.
185
+ ## How it works
278
186
 
279
- More: [the MCP server](https://github.com/WireCatLabs/tg-cli/blob/main/docs/mcp.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/mcp) · [remote access](https://github.com/WireCatLabs/tg-cli/blob/main/docs/remote.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/remote)
187
+ - **One more device.** `tg` speaks MTProto, the protocol of Telegram's own apps, through an app you register. The
188
+ login is kept in your system keyring, never in a file or a command line.
189
+ - **A local copy.** Every message `tg` reads is saved on your computer. History downloads in the background, page by
190
+ page. A stop loses nothing, and the next run goes on from there. `tg` knows which stretches of a chat it holds in
191
+ full, so "not found" never hides a gap.
192
+ - **Staying current.** `tg personal server install` keeps the copy up to date as a system service.
193
+ - **Polite to Telegram.** One request pace per account, shared by every command, agent and background job. Short
194
+ waits from Telegram are waited out, long ones stop the run instead of retrying.
195
+ - **No double sends.** When the connection drops during a send, `tg` says the outcome is unknown and gives a repeat
196
+ that Telegram does not deliver twice.
197
+ - **Made for scripts.** `--json` gives the same shape for every command, and each kind of failure has its own exit
198
+ code.
280
199
 
281
- ## Output for scripts and agents
282
-
283
- With `--json` a command prints only data, as one JSON value — no tables, colour or hints; it does the
284
- same when another program reads its output. `--jsonl` prints one object per line. Every list has one
285
- shape:
286
-
287
- ```json
288
- { "items": [ … ], "page": { "limit": 20, "has_more": true }, "meta": { … } }
289
- ```
290
-
291
- An error goes to stderr as one line, with stdout empty, and the command exits with a fixed code: `4`
292
- log in, `5` the profile may not do this, `6` chat or message not found, `8` a limit, `9` Telegram did
293
- not answer in time, `14` unknown whether a message went. `tg commands --json` is the whole command
294
- tree. A partial read or download can exit `0`: check `complete` in the JSON.
295
-
296
- More: [CLI contract](https://github.com/WireCatLabs/tg-cli/blob/main/docs/cli-contract.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/cli-contract) · [every command and exit code](https://github.com/WireCatLabs/tg-cli/blob/main/docs/commands.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/commands)
200
+ More: [limits and waits](https://wirecat.dev/en/docs/tg/limits) · [output for scripts](https://wirecat.dev/en/docs/tg/cli-contract)
297
201
 
298
202
  ## Settings and permissions
299
203
 
204
+ Each account (profile) has its own settings: what an agent may do, which chats it may write to, how many messages an
205
+ hour.
206
+
300
207
  ```sh
301
- tg personal config set permissions.messages readonly # no change to messages from this profile
302
- tg personal config set permissions.messages.send ask # a question in the terminal before each send
303
- tg personal config set sends_per_hour 10 # at most 10 sends an hour (30 by default)
304
- tg personal recipients add "Book club" # the first add turns the recipient list on
305
- tg personal sends list # every attempt: sent, refused, failed or not known
306
- tg personal config show # what is set, and where it came from
208
+ tg personal config set permissions.messages readonly # this profile changes no messages
307
209
  ```
308
210
 
309
- More: [permissions](https://github.com/WireCatLabs/tg-cli/blob/main/docs/permissions.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/permissions) · [configuration](https://github.com/WireCatLabs/tg-cli/blob/main/docs/configuration.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/configuration)
310
-
311
- ## Limits
312
-
313
- Each profile has one request pace, shared by every command, background job and server at once, so
314
- bulk work stays under Telegram's limits. Short waits from Telegram are waited out; a long wait stops
315
- the run instead of being repeated.
316
-
317
- More: [limits and waits](https://github.com/WireCatLabs/tg-cli/blob/main/docs/limits.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/limits)
211
+ More: [permissions](https://wirecat.dev/en/docs/tg/permissions) · [profiles](https://wirecat.dev/en/docs/tg/profiles)
318
212
 
319
213
  ## Security
320
214
 
321
- - The session file is as good as your password, readable only by your user; the app keys are in the
322
- system keyring. No command takes a password, a login code or a phone number as an argument.
323
- - The local store holds the full text of what was read, unencrypted and readable only by your user.
324
- It stays after logout; only whole-disk encryption protects it from a stolen disk.
325
- - Every send, from a command or over MCP, passes the profile's limits and is written to a journal —
326
- without its text. `--file` refuses credential files, CLI folders and the local store.
327
- - Control characters in names, titles and messages are shown as text, so other people's text cannot
328
- control your terminal.
329
- - The limits stop an agent talked into sending by a message it read, not one that sets out to get
330
- round them: for that, run the agent in a sandbox or as a separate user.
331
-
332
- To report a vulnerability: [SECURITY.md](https://github.com/WireCatLabs/tg-cli/blob/main/SECURITY.md).
215
+ Your login is in the system keyring, and no command takes a password, code or phone number as an argument. The local
216
+ copy is readable only by your user. Text from other people cannot control your terminal or your agent.
333
217
 
334
- More: [security](https://github.com/WireCatLabs/tg-cli/blob/main/docs/security.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/security)
218
+ More: [security](https://wirecat.dev/en/docs/tg/security) · Report a vulnerability: [SECURITY.md](https://github.com/WireCatLabs/tg-cli/blob/main/SECURITY.md)
335
219
 
336
220
  ## When something goes wrong
337
221
 
338
222
  ```sh
339
- tg personal doctor # where the files are and whether a session is saved, without connecting
340
- tg personal doctor --online # check that the login works
341
- tg personal chats list --trace # each request to Telegram, with no text, names, phone numbers or keys
342
- tg personal runs list # recorded runs
223
+ tg personal doctor # what is set up, without connecting
224
+ tg personal doctor --online # check that the login works
343
225
  ```
344
226
 
345
- More: [troubleshooting by symptom](https://github.com/WireCatLabs/tg-cli/blob/main/docs/troubleshooting.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/troubleshooting) · [diagnostics](https://github.com/WireCatLabs/tg-cli/blob/main/docs/diagnostics.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/diagnostics)
227
+ More: [troubleshooting](https://wirecat.dev/en/docs/tg/troubleshooting) · Ask on [Discord](https://discord.gg/DebENqbRrJ) ·
228
+ Bugs go to this repository's issues.
346
229
 
347
- ## How it differs
230
+ ## Documentation
348
231
 
349
- Telegram's own apps are made for a person; `tg` is made for a script and an agent. A Telegram bot sees
350
- only the chats it was added to and speaks as the bot; `tg` is you, in your chats. Other open tools
351
- connect a Telegram account to an agent too: tgcli, telegram-mcp and tdl.
352
-
353
- More: [compared with other tools](https://github.com/WireCatLabs/tg-cli/blob/main/docs/compare.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/compare)
354
-
355
- ## Part of WireCat
356
-
357
- [WireCat](https://wirecat.dev) is an open-source, local-first context layer for AI agents. `tg` is
358
- where it starts; [max-cli](https://github.com/WireCatLabs/max-cli) brings the MAX messenger into the
359
- same local store. Start with Telegram. Add more context when you need it. Your context. Any agent.
360
-
361
- Questions and setup help: join the [WireCat Discord](https://discord.gg/DebENqbRrJ). Bugs go to this
362
- repository's issues.
363
-
364
- ## Technical docs
365
-
366
- Every page is on [wirecat.dev/en/docs/tg](https://wirecat.dev/en/docs/tg) and in
367
- [`docs/`](https://github.com/WireCatLabs/tg-cli/tree/main/docs):
368
-
369
- | Page | Answers |
370
- |---|---|
371
- | [index](https://github.com/WireCatLabs/tg-cli/blob/main/docs/index.md) · [web](https://wirecat.dev/en/docs/tg) | The docs site's start page: what `tg` is, the first minute, where to go next |
372
- | [installation](https://github.com/WireCatLabs/tg-cli/blob/main/docs/installation.md) · [web](https://wirecat.dev/en/docs/tg/installation) | How do I install it, what does it need, where do its files go, how do I upgrade or remove it? |
373
- | [usage](https://github.com/WireCatLabs/tg-cli/blob/main/docs/usage.md) · [web](https://wirecat.dev/en/docs/tg/usage) | How do I log in, read, page, send, and use it from a script — in that order? |
374
- | [sessions](https://github.com/WireCatLabs/tg-cli/blob/main/docs/sessions.md) · [web](https://wirecat.dev/en/docs/tg/sessions) | How does login work: QR or phone, the app from my.telegram.org, the keyring, profiles, logout? |
375
- | [archive](https://github.com/WireCatLabs/tg-cli/blob/main/docs/archive.md) · [web](https://wirecat.dev/en/docs/tg/archive) | What does the local store keep, how do I fill it, search it, export it, keep it current and back it up? |
376
- | [search](https://github.com/WireCatLabs/tg-cli/blob/main/docs/search.md) · [web](https://wirecat.dev/en/docs/tg/search) | How do I find a message by its words, sender, chat, date, file, link or tag, save a search and count? |
377
- | [attachments](https://github.com/WireCatLabs/tg-cli/blob/main/docs/attachments.md) · [web](https://wirecat.dev/en/docs/tg/attachments) | Sending, downloading and reading files; text from documents and images, and searching it |
378
- | [rankings](https://github.com/WireCatLabs/tg-cli/blob/main/docs/rankings.md) · [web](https://wirecat.dev/en/docs/tg/rankings) | Message and author rankings: metrics, scores, saved queries and evidence |
379
- | [topic-search](https://github.com/WireCatLabs/tg-cli/blob/main/docs/topic-search.md) · [web](https://wirecat.dev/en/docs/tg/topic-search) | How do I find a discussion by what it was about, keep that current, and what leaves my computer? |
380
- | [query-language](https://github.com/WireCatLabs/tg-cli/blob/main/docs/query-language.md) · [web](https://wirecat.dev/en/docs/tg/query-language) | Every search field, operator, preset, limit and the JSON answer |
381
- | [groups](https://github.com/WireCatLabs/tg-cli/blob/main/docs/groups.md) · [web](https://wirecat.dev/en/docs/tg/groups) | How do I keep up with a group I run — open questions, newcomers, a weekly report? |
382
- | [people](https://github.com/WireCatLabs/tg-cli/blob/main/docs/people.md) · [web](https://wirecat.dev/en/docs/tg/people) | One person: profile, what they said in each chat, does the account look like a bot |
383
- | [bot](https://github.com/WireCatLabs/tg-cli/blob/main/docs/bot.md) · [web](https://wirecat.dev/en/docs/tg/bot) | A bot through the Bot API: token, recipients, messages, admins and every Bot API method |
384
- | [replies](https://github.com/WireCatLabs/tg-cli/blob/main/docs/replies.md) · [web](https://wirecat.dev/en/docs/tg/replies) | Answer messages by your rules, to everyone or only the people you choose |
385
- | [mcp](https://github.com/WireCatLabs/tg-cli/blob/main/docs/mcp.md) · [web](https://wirecat.dev/en/docs/tg/mcp) | How do I connect Claude Desktop, Cursor or another client without a terminal? |
386
- | [remote](https://github.com/WireCatLabs/tg-cli/blob/main/docs/remote.md) · [web](https://wirecat.dev/en/docs/tg/remote) | ChatGPT or Claude in the browser, through a login proxy and a tunnel |
387
- | [recipes](https://github.com/WireCatLabs/tg-cli/blob/main/docs/recipes.md) · [web](https://wirecat.dev/en/docs/tg/recipes) | What can an agent do for me every day, and how do I run it on a schedule? |
388
- | [compare](https://github.com/WireCatLabs/tg-cli/blob/main/docs/compare.md) · [web](https://wirecat.dev/en/docs/tg/compare) | How does tg compare with tgcli, telegram-mcp and tdl, and when does another tool fit better? |
389
- | [commands](https://github.com/WireCatLabs/tg-cli/blob/main/docs/commands.md) · [web](https://wirecat.dev/en/docs/tg/commands) | Every command, option and exit code — **generated** from the program |
390
- | [configuration](https://github.com/WireCatLabs/tg-cli/blob/main/docs/configuration.md) · [web](https://wirecat.dev/en/docs/tg/configuration) | How do I configure common behavior? |
391
- | [permissions](https://github.com/WireCatLabs/tg-cli/blob/main/docs/permissions.md) · [web](https://wirecat.dev/en/docs/tg/permissions) | What a profile may read, what asks first, and what may go ahead |
392
- | [profiles](https://github.com/WireCatLabs/tg-cli/blob/main/docs/profiles.md) · [web](https://wirecat.dev/en/docs/tg/profiles) | Several accounts and bots on one computer, and how a command picks one |
393
- | [configuration-reference](https://github.com/WireCatLabs/tg-cli/blob/main/docs/configuration-reference.md) · [web](https://wirecat.dev/en/docs/tg/configuration-reference) | Every key, type, default, scope and variable |
394
- | [cli-contract](https://github.com/WireCatLabs/tg-cli/blob/main/docs/cli-contract.md) · [web](https://wirecat.dev/en/docs/tg/cli-contract) | Invocation, output, errors, headless runs, bounds and previews |
395
- | [limits](https://github.com/WireCatLabs/tg-cli/blob/main/docs/limits.md) · [web](https://wirecat.dev/en/docs/tg/limits) | Limits, waits and background jobs |
396
- | [diagnostics](https://github.com/WireCatLabs/tg-cli/blob/main/docs/diagnostics.md) · [web](https://wirecat.dev/en/docs/tg/diagnostics) | What did a command do, and what is never recorded? |
397
- | [troubleshooting](https://github.com/WireCatLabs/tg-cli/blob/main/docs/troubleshooting.md) · [web](https://wirecat.dev/en/docs/tg/troubleshooting) | Something does not work: what the screen says, and what to do |
398
- | [security](https://github.com/WireCatLabs/tg-cli/blob/main/docs/security.md) · [web](https://wirecat.dev/en/docs/tg/security) | What reaches the disk, what never does, and what stops a send going to the wrong place? |
399
- | [roadmap](https://github.com/WireCatLabs/tg-cli/blob/main/docs/roadmap.md) · [web](https://wirecat.dev/en/docs/tg/roadmap) | What is coming next? |
400
-
401
- What each version changed: [CHANGELOG.md](https://github.com/WireCatLabs/tg-cli/blob/main/CHANGELOG.md).
232
+ Everything is on [wirecat.dev/en/docs/tg](https://wirecat.dev/en/docs/tg). The same pages are in [docs/](https://github.com/WireCatLabs/tg-cli/blob/main/docs/index.md).
402
233
 
403
234
  ## Development
404
235
 
405
236
  ```sh
406
- pnpm install
407
- pnpm lint && pnpm typecheck && pnpm test
408
- pnpm build && pnpm smoke:node # the built command, the bundle a user installs
409
- pnpm build && pnpm smoke:bun # the same under Bun
410
- pnpm generate # rewrites docs/commands.md from the command tree
411
- bin/tg session start # everything under .tg/ in this checkout, never the real profile
237
+ pnpm install && pnpm test
412
238
  ```
413
239
 
414
- Everything that is not specific to Telegram — the commands, the store, the send guard, the MCP
415
- server — lives in [cli-core](https://github.com/WireCatLabs/cli-core), shared with
416
- [max-cli](https://github.com/WireCatLabs/max-cli). Telegram-specific code lives only in `src/telegram/`.
417
-
418
- More: [ARCHITECTURE](https://github.com/WireCatLabs/tg-cli/blob/main/docs/dev/ARCHITECTURE.md) ·
419
- [TESTING](https://github.com/WireCatLabs/tg-cli/blob/main/docs/dev/TESTING.md)
240
+ More: [architecture](https://github.com/WireCatLabs/tg-cli/blob/main/docs/dev/ARCHITECTURE.md) · [testing](https://github.com/WireCatLabs/tg-cli/blob/main/docs/dev/TESTING.md)
420
241
 
421
- ## Contributing
242
+ Pull requests, bug reports and ideas go to [issues](https://github.com/WireCatLabs/tg-cli/issues).
422
243
 
423
- Pull requests, bug reports and ideas are welcome in
424
- [issues](https://github.com/WireCatLabs/tg-cli/issues).
244
+ ## Part of WireCat
425
245
 
426
- Custom automation with Telegram, other messengers and AI agents: [info@neirox.ai](mailto:info@neirox.ai).
246
+ `tg` is one of the [WireCat](https://wirecat.dev) tools: open-source, local-first command-line tools that give AI
247
+ agents your context from messengers, mail, calendars and documents. Each one works on its own.
427
248
 
428
249
  ## License
429
250
 
430
- Apache License 2.0 — see [LICENSE](https://github.com/WireCatLabs/tg-cli/blob/main/LICENSE).
251
+ [Apache 2.0](https://github.com/WireCatLabs/tg-cli/blob/main/LICENSE)
package/dist/bin/tg.js CHANGED
@@ -9,7 +9,7 @@ if (
9
9
  (words[0] === "--version" || words[0] === "-V") &&
10
10
  !Object.keys(process.env).some((key) => key.endsWith("_TEST_ARGV_LOG"))
11
11
  ) {
12
- process.stdout.write("0.132.0\n")
12
+ process.stdout.write("0.133.0\n")
13
13
  } else {
14
14
  // Before the bundle compiles: the bundle's own call comes after its chunks.
15
15
  module.enableCompileCache()
@@ -28,7 +28,7 @@ if (
28
28
  : next(specifier, context),
29
29
  })
30
30
  }
31
- const chunks = ["../bundle/adapter-OXVMOWVE.js","../bundle/all-profiles-6OQC7PBL.js","../bundle/anthropic-YFMIHFW5.js","../bundle/app-server-S7CJPJXN.js","../bundle/bot-api-KJ6EZ4R6.js","../bundle/bot-history-JYCXDFW4.js","../bundle/bun-FVTOBYZ2.js","../bundle/bun-sqlite-KDGWBNOR.js","../bundle/command-contract-FRH7LBGE.js","../bundle/command-server-entry-TM264M2J.js","../bundle/decode-RJFOSHCE.js","../bundle/dispatch-7OZP3X4O.js","../bundle/dist-I7OZPHAZ.js","../bundle/echarts-PYKF4D7B.js","../bundle/embed-JFN6Z5TG.js","../bundle/embedder-WN54JIMY.js","../bundle/entry-Z6LO6N6S.js","../bundle/failure-UONA2IA5.js","../bundle/first-run-WQAKES7G.js","../bundle/first-screen-4RFG22SA.js","../bundle/instructions-PR4BBBTM.js","../bundle/mcp-O6ACR2DX.js","../bundle/node-OVS5LTVZ.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-LC44SM4Z.js","../bundle/oauth-NSVUFQCW.js","../bundle/open-XN5SJFVY.js","../bundle/openai-WOYZHJNL.js","../bundle/process-UFBRGTQC.js","../bundle/program-RAGBRRQH.js","../bundle/prompt-6HAKBUQN.js","../bundle/proxy-transport-5EJVFUTC.js","../bundle/recognize-CN5COBVJ.js","../bundle/remote-STX5AMGE.js","../bundle/rerank-ZCOWTXIJ.js","../bundle/serve-XMQEOIG2.js","../bundle/server-PGGUD3DM.js","../bundle/server-WTNYWCZ4.js","../bundle/state-GL4ZC57O.js","../bundle/store-VISFXSHL.js","../bundle/store-maintenance-command-SMARMN5C.js"]
31
+ const chunks = ["../bundle/adapter-GSGX3WBH.js","../bundle/all-profiles-VOCJ55YH.js","../bundle/anthropic-J6CTLU3W.js","../bundle/app-server-GVFGA4TJ.js","../bundle/bot-api-LWONPIGK.js","../bundle/bot-history-XOW7Y2GC.js","../bundle/bun-436CH6CP.js","../bundle/bun-sqlite-ZLB5RK5Q.js","../bundle/command-contract-TQIARAB4.js","../bundle/command-server-entry-AE27QXTE.js","../bundle/decode-RQPPZ72F.js","../bundle/dispatch-KQO2MCSH.js","../bundle/dist-I7OZPHAZ.js","../bundle/echarts-FZRIACN4.js","../bundle/embed-TOSWWMDL.js","../bundle/embedder-JHIQSBGD.js","../bundle/entry-DU4KRXTG.js","../bundle/failure-3YC3YGYO.js","../bundle/first-run-DQQT4FID.js","../bundle/first-screen-7N4CTZSA.js","../bundle/instructions-WI64CJQ6.js","../bundle/mcp-VMS6PBCU.js","../bundle/node-JLKDNVKV.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-YOGH26O2.js","../bundle/oauth-FOMXM5HP.js","../bundle/open-SM2UXUKM.js","../bundle/openai-J2H7S6ZF.js","../bundle/process-HI7OZBOI.js","../bundle/program-VY4HFU25.js","../bundle/prompt-NUUVFMOF.js","../bundle/proxy-transport-AN4VMRRN.js","../bundle/recognize-MALJHPDI.js","../bundle/remote-QUDRSTS2.js","../bundle/rerank-2DSO3D3S.js","../bundle/serve-NCJ52MY3.js","../bundle/server-CHGON5I2.js","../bundle/server-Y3M544AM.js","../bundle/state-AVOWQVET.js","../bundle/store-MMIYOL4H.js","../bundle/store-maintenance-command-VKZ4WHUB.js"]
32
32
  if (((words) => words
33
33
  .filter((word) => !word.startsWith("-"))
34
34
  .slice(0, 2)