@wirecat/tg-cli 0.132.0 → 0.134.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.
- package/README.md +139 -319
- package/contracts/wirecat.json +82 -2
- package/dist/bin/tg.js +2 -2
- package/dist/bot/generated/types.d.ts +188 -0
- package/dist/bot/generated/types.d.ts.map +1 -1
- package/dist/bundle/{adapter-OXVMOWVE.js → adapter-Y4IXTXAG.js} +104 -68
- package/dist/bundle/agent-G7VHOJMS.js +37 -0
- package/dist/bundle/{all-profiles-6OQC7PBL.js → all-profiles-SUGID6CX.js} +62 -20
- package/dist/bundle/{anthropic-YFMIHFW5.js → anthropic-4QKTXT4B.js} +5 -5
- package/dist/bundle/{app-server-S7CJPJXN.js → app-server-TPOD6LIJ.js} +75 -65
- package/dist/bundle/{bot-api-KJ6EZ4R6.js → bot-api-KBESP422.js} +73 -91
- package/dist/bundle/{bot-history-JYCXDFW4.js → bot-history-3EORA23G.js} +23 -22
- package/dist/bundle/{bun-FVTOBYZ2.js → bun-FL76M4M2.js} +2 -2
- package/dist/bundle/{bun-sqlite-KDGWBNOR.js → bun-sqlite-H37OSTAJ.js} +6 -6
- package/dist/bundle/{chunk-JZJV3DYK.js → chunk-2GT563YH.js} +2 -2
- package/dist/bundle/{chunk-EPR67IRV.js → chunk-2JWY7CXJ.js} +4 -4
- package/dist/bundle/{chunk-UGD4SCUI.js → chunk-3O25FAPA.js} +3 -4
- package/dist/bundle/{chunk-AERP2QR6.js → chunk-3PG6QVQZ.js} +11 -25
- package/dist/bundle/{chunk-DXPGMUOR.js → chunk-3QQWTP77.js} +2 -2
- package/dist/bundle/{chunk-FIUH52FE.js → chunk-3ZNO27UE.js} +1 -1
- package/dist/bundle/{chunk-Y57EKZZK.js → chunk-4R2ZJGFF.js} +3274 -1674
- package/dist/bundle/{chunk-6LPUK62N.js → chunk-4S2DHHJM.js} +2 -100
- package/dist/bundle/{chunk-LF6FACSW.js → chunk-4X6BX3XP.js} +144 -10
- package/dist/bundle/{chunk-LZ3HFDYL.js → chunk-6DGVK5KS.js} +2 -2
- package/dist/bundle/chunk-6DJJVFSG.js +388 -0
- package/dist/bundle/{chunk-BSXS7VAC.js → chunk-6MEHKUN6.js} +1 -1
- package/dist/bundle/{chunk-44A2XRDE.js → chunk-6UNLEQA5.js} +31 -20
- package/dist/bundle/{chunk-M2TV6BDB.js → chunk-77E7Q4EQ.js} +7 -7
- package/dist/bundle/chunk-7GGDCQJ5.js +353 -0
- package/dist/bundle/{chunk-OGZZUDJJ.js → chunk-AHVWZDXO.js} +79 -64
- package/dist/bundle/{chunk-YVI5SQPY.js → chunk-ANBI3OXK.js} +1 -1
- package/dist/bundle/{chunk-PR4F3TYK.js → chunk-AYWST6NA.js} +60 -51
- package/dist/bundle/{chunk-7SEVVE3X.js → chunk-CA7DY2YU.js} +3 -3
- package/dist/bundle/{chunk-O43PARFS.js → chunk-CDKXZLMP.js} +273 -176
- package/dist/bundle/{chunk-YAPO7QNO.js → chunk-CNGNR4CY.js} +6 -6
- package/dist/bundle/{chunk-2UGSIHLV.js → chunk-CSXCCK6J.js} +2 -2
- package/dist/bundle/{chunk-N5LZ6L4D.js → chunk-DG35TQ6P.js} +3 -3
- package/dist/bundle/{chunk-LMGVPDXN.js → chunk-EXMAWEHC.js} +2 -2
- package/dist/bundle/{chunk-A5D3J7XZ.js → chunk-FR3ATU5I.js} +4 -4
- package/dist/bundle/{chunk-JDNDWZYS.js → chunk-FR4Y5CGW.js} +4 -4
- package/dist/bundle/{chunk-YSNQGOUI.js → chunk-GIGZTI74.js} +2115 -1975
- package/dist/bundle/{chunk-3QHKZLBU.js → chunk-H3TLAYGY.js} +4 -4
- package/dist/bundle/{chunk-KJICORS4.js → chunk-HD7DV5B2.js} +65 -43
- package/dist/bundle/{chunk-NLRGMP7M.js → chunk-HETHFOHC.js} +3 -3
- package/dist/bundle/{chunk-4YB7JU2W.js → chunk-HEZK4W3U.js} +6 -6
- package/dist/bundle/{chunk-2LZD2VFV.js → chunk-IJ7R2WMK.js} +4 -4
- package/dist/bundle/{chunk-4ZTVJHWU.js → chunk-ITJ7DGNA.js} +4 -4
- package/dist/bundle/{chunk-5UPEEMEF.js → chunk-J5RB4ASI.js} +142 -372
- package/dist/bundle/{chunk-IY7CTAOQ.js → chunk-JAL443BH.js} +9 -9
- package/dist/bundle/{chunk-U7PHJSTX.js → chunk-JCDD5T3A.js} +2 -2
- package/dist/bundle/{chunk-BLZEQVP4.js → chunk-JHZJBNDO.js} +2 -2
- package/dist/bundle/chunk-JWLODUN3.js +555 -0
- package/dist/bundle/{chunk-4CKYANQH.js → chunk-JWNSG5GI.js} +1 -1
- package/dist/bundle/{chunk-YRXSNH3R.js → chunk-JXEO5EIN.js} +2 -2
- package/dist/bundle/{chunk-DSJNZXTP.js → chunk-K5FK6WWN.js} +1 -1
- package/dist/bundle/{chunk-LG3K5NHX.js → chunk-L47PFECD.js} +7 -7
- package/dist/bundle/{chunk-OIRNHSAH.js → chunk-L4PNDW4S.js} +6 -6
- package/dist/bundle/{chunk-WAVRUADL.js → chunk-M323L5SG.js} +30 -15
- package/dist/bundle/{chunk-AUZWIBHJ.js → chunk-MMDFPBFZ.js} +43 -64
- package/dist/bundle/{chunk-FKGYXIN7.js → chunk-MUV73B5A.js} +7 -7
- package/dist/bundle/chunk-MXA3FU2R.js +116 -0
- package/dist/bundle/{chunk-42MXCMW6.js → chunk-NUD4CBHK.js} +3 -3
- package/dist/bundle/{chunk-PG37E63A.js → chunk-NYEVPAF2.js} +511 -472
- package/dist/bundle/{chunk-QS46C5SW.js → chunk-O3QBO6NW.js} +17 -17
- package/dist/bundle/{chunk-CFWFESBO.js → chunk-O4ZOQJ6W.js} +9 -9
- package/dist/bundle/{chunk-74UPKW7H.js → chunk-OJSPB4LA.js} +2 -2
- package/dist/bundle/{chunk-JNWKV3QV.js → chunk-PCBVSHKD.js} +4 -4
- package/dist/bundle/{chunk-5RDNBG7D.js → chunk-PK5WEGPJ.js} +2 -2
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-BMI2NWFI.js → chunk-PRI2XTM7.js} +35 -12
- package/dist/bundle/chunk-PRM7GKBV.js +340 -0
- package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-PZ2ZFPGO.js} +1 -1
- package/dist/bundle/chunk-QYRK4XXH.js +727 -0
- package/dist/bundle/{chunk-QNEAPLOP.js → chunk-RVA3CRSY.js} +12 -12
- package/dist/bundle/{chunk-4EDJJQJI.js → chunk-SPXNI53Z.js} +38 -9
- package/dist/bundle/{chunk-ZRW3DF25.js → chunk-TI5U6AUT.js} +34 -28
- package/dist/bundle/{chunk-SMQ45RZX.js → chunk-TKWYXM7L.js} +9 -60
- package/dist/bundle/{chunk-ZJIGVT6Z.js → chunk-TZCFJJEU.js} +6 -6
- package/dist/bundle/chunk-UTTEAOJ3.js +7 -0
- package/dist/bundle/chunk-V6G4LTXU.js +50 -0
- package/dist/bundle/{chunk-JMJOWT4N.js → chunk-VH4J7IIS.js} +1 -1
- package/dist/bundle/{chunk-UAFSDTID.js → chunk-VNJRWFHP.js} +1 -1
- package/dist/bundle/chunk-W2QSDPG6.js +80 -0
- package/dist/bundle/{chunk-ESOFH7PA.js → chunk-WGGUKQE7.js} +134 -558
- package/dist/bundle/{chunk-NWDADTPE.js → chunk-WPXVJGSL.js} +3 -3
- package/dist/bundle/{chunk-NWCFO37P.js → chunk-XLNV3U6N.js} +3 -3
- package/dist/bundle/{chunk-JPSRC732.js → chunk-XS4EE7MO.js} +17 -15
- package/dist/bundle/{chunk-FPSRT2TX.js → chunk-XVRLD3LN.js} +2 -2
- package/dist/bundle/{chunk-O3AM32YN.js → chunk-XZ6XEAJP.js} +18 -18
- package/dist/bundle/{chunk-B4LGDOG5.js → chunk-YHTSJMZ5.js} +3734 -3380
- package/dist/bundle/chunk-YPJCURT6.js +108 -0
- package/dist/bundle/{chunk-HBSKP7OV.js → chunk-Z77R76S2.js} +1 -1
- package/dist/bundle/{chunk-PYECFCPD.js → chunk-ZC7OEYDX.js} +1 -1
- package/dist/bundle/{chunk-IYJ4B632.js → chunk-ZW2N2GI2.js} +12 -12
- package/dist/bundle/command-contract-LEFXJAA3.js +37 -0
- package/dist/bundle/{command-server-entry-TM264M2J.js → command-server-entry-WQAE5UGU.js} +27 -27
- package/dist/bundle/{decode-RJFOSHCE.js → decode-2J2DOVGV.js} +5 -5
- package/dist/bundle/{dispatch-7OZP3X4O.js → dispatch-IZ2TP5GW.js} +8 -8
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-PYKF4D7B.js → echarts-GFIIHZ4U.js} +2 -2
- package/dist/bundle/{embed-JFN6Z5TG.js → embed-AGOXADHW.js} +6 -6
- package/dist/bundle/{embedder-WN54JIMY.js → embedder-PCIXGM2Y.js} +9 -9
- package/dist/bundle/{entry-Z6LO6N6S.js → entry-HUQXUV52.js} +9 -9
- package/dist/bundle/{failure-UONA2IA5.js → failure-JSRHZ2S6.js} +2 -2
- package/dist/bundle/{first-run-WQAKES7G.js → first-run-2LXN7B33.js} +12 -12
- package/dist/bundle/first-screen-VUE6RCSF.js +37 -0
- package/dist/bundle/{instructions-PR4BBBTM.js → instructions-RSLTJVFJ.js} +1 -1
- package/dist/bundle/{mcp-O6ACR2DX.js → mcp-MMENCB7I.js} +2 -2
- package/dist/bundle/meeting-combined-PBNPHOM3.js +23 -0
- package/dist/bundle/{meeting-model-YVTUOM4H.js → meeting-model-SI77WMMK.js} +11 -11
- package/dist/bundle/{meeting-semantic-X4KG6RNV.js → meeting-semantic-WRXWUR4M.js} +6 -6
- package/dist/bundle/{node-OVS5LTVZ.js → node-5XGMCUGQ.js} +2 -2
- package/dist/bundle/{node-sqlite-LC44SM4Z.js → node-sqlite-ES7SQSIC.js} +7 -7
- package/dist/bundle/{oauth-NSVUFQCW.js → oauth-QFM4Y6N7.js} +8 -8
- package/dist/bundle/{open-XN5SJFVY.js → open-2MD2DKGQ.js} +5 -5
- package/dist/bundle/{openai-WOYZHJNL.js → openai-6TMKJKYO.js} +15 -15
- package/dist/bundle/{process-UFBRGTQC.js → process-VA2DP7MY.js} +1 -1
- package/dist/bundle/{program-RAGBRRQH.js → program-K3SLEA42.js} +70 -63
- package/dist/bundle/{prompt-6HAKBUQN.js → prompt-VZSPCE6E.js} +5 -5
- package/dist/bundle/{proxy-transport-5EJVFUTC.js → proxy-transport-OJU2EOOC.js} +5 -5
- package/dist/bundle/{recognize-CN5COBVJ.js → recognize-LH3ZZEIL.js} +4 -4
- package/dist/bundle/{remote-STX5AMGE.js → remote-JNW5HN2I.js} +9 -9
- package/dist/bundle/{rerank-ZCOWTXIJ.js → rerank-P23UJMII.js} +7 -7
- package/dist/bundle/{serve-XMQEOIG2.js → serve-VSLLMILH.js} +15 -15
- package/dist/bundle/{server-PGGUD3DM.js → server-FBRRRKCS.js} +68 -57
- package/dist/bundle/server-TA4QP7PG.js +78 -0
- package/dist/bundle/{sqlite-runtime-PS4DSOIU.js → sqlite-runtime-LWATDAAU.js} +6 -6
- package/dist/bundle/{state-GL4ZC57O.js → state-3AFJL2EL.js} +6 -6
- package/dist/bundle/{store-VISFXSHL.js → store-6TLYL2VU.js} +30 -17
- package/dist/bundle/{store-HJ76TLWD.js → store-PEXV5DNA.js} +24 -19
- package/dist/bundle/store-maintenance-command-IYJLUQ5X.js +65 -0
- package/dist/bundle/surface-L4VY4WFG.js +64 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/telegram/adapter.d.ts +9 -2
- package/dist/telegram/adapter.d.ts.map +1 -1
- package/dist/telegram/adapter.js +5 -6
- package/dist/telegram/adapter.js.map +1 -1
- package/dist/telegram/messages.d.ts +12 -0
- package/dist/telegram/messages.d.ts.map +1 -1
- package/dist/telegram/messages.js +40 -0
- package/dist/telegram/messages.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +80 -576
- package/skills/tg-cli/references/files.md +64 -0
- package/skills/tg-cli/references/history.md +22 -0
- package/skills/tg-cli/references/mcp-and-bots.md +54 -0
- package/skills/tg-cli/references/messages.md +115 -0
- package/skills/tg-cli/references/people.md +85 -0
- package/skills/tg-cli/references/search.md +132 -0
- package/skills/tg-cli/references/setup.md +91 -0
- package/skills/tg-cli/references/stats.md +45 -0
- package/skills/tg-cli/references/tasks.md +54 -0
- package/dist/bundle/chunk-VKE77B3F.js +0 -2
- package/dist/bundle/command-contract-FRH7LBGE.js +0 -37
- package/dist/bundle/first-screen-4RFG22SA.js +0 -35
- package/dist/bundle/meeting-combined-MHWTZOF2.js +0 -23
- package/dist/bundle/server-WTNYWCZ4.js +0 -69
- package/dist/bundle/store-maintenance-command-SMARMN5C.js +0 -60
package/README.md
CHANGED
|
@@ -2,429 +2,249 @@
|
|
|
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
|
|
5
|
+
# tg: Telegram CLI for AI agents
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
|
|
9
|
-
Codex, Cursor or any agent
|
|
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
|
-
<a href="https://github.com/WireCatLabs/tg-cli/blob/main/docs/
|
|
15
|
-
<a href="https://
|
|
14
|
+
<a href="https://github.com/WireCatLabs/tg-cli/blob/main/docs/installation.md">Install</a> ·
|
|
15
|
+
<a href="https://github.com/WireCatLabs/tg-cli/blob/main/docs/usage.md">Usage</a> ·
|
|
16
|
+
<a href="https://discord.gg/DebENqbRrJ">Discord</a>
|
|
16
17
|
</p>
|
|
17
18
|
|
|
18
19
|
<p align="center">
|
|
19
20
|
<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
21
|
<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
22
|
<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
23
|
<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
24
|
</p>
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
- **Full control.** Connect your personal account and write as yourself, or connect any bot. Chats, groups, channels,
|
|
27
|
+
contacts, files and the whole Bot API, all from one tool.
|
|
28
|
+
- **Deep search that finds what others miss.** Every message you ever had, searched on your computer. It forgives
|
|
29
|
+
typos, finds synonyms and matches by meaning. Voice messages and files are searched too.
|
|
30
|
+
- **Groups that run themselves.** Auto-replies, moderation by your rules, unanswered questions, who joined and left,
|
|
31
|
+
activity analytics.
|
|
32
|
+
|
|
33
|
+
## What you get
|
|
34
|
+
|
|
35
|
+
- **Never miss what matters.** One command shows who is waiting for your answer in every chat. Nothing gets marked
|
|
36
|
+
as read.
|
|
37
|
+
- **Find any message in seconds.** "When did we agree on the venue with Alice?" gives you the date and the message,
|
|
38
|
+
even with no internet.
|
|
39
|
+
- **Answer when you can't.** Auto-replies by your own rules, to the people you choose, while you sleep or travel.
|
|
40
|
+
- **Keep order in your groups.** Spam, floods and foreign links removed by your rules. Questions nobody answered,
|
|
41
|
+
new members, a weekly summary.
|
|
42
|
+
- **Understand any media.** Voice messages become text on your computer, with no Premium. Text is pulled from files
|
|
43
|
+
and scans. All of it is searchable.
|
|
44
|
+
- **Know who owes what.** "What did I promise this week, and what am I waiting for?" One answer across every chat.
|
|
45
|
+
- **See the whole picture.** Link a person's Telegram and MAX accounts, add WhatsApp, Google Calendar and Meet, and ask
|
|
46
|
+
about a person or a project across all of them.
|
|
28
47
|
|
|
29
48
|
```text
|
|
30
|
-
You:
|
|
49
|
+
You: What did I promise anyone in the last three days?
|
|
31
50
|
Agent: (runs tg personal review 'date>3d': 12 chats)
|
|
32
51
|
I owe
|
|
33
|
-
· Alice Example
|
|
52
|
+
· Alice Example: the invoice by Friday. "Alice Example", 24.09
|
|
34
53
|
Waiting on others
|
|
35
|
-
· Bob Sample
|
|
54
|
+
· Bob Sample: the mock-up by 25.09. Not in "Design" yet
|
|
36
55
|
You: Remind Bob about the mock-up.
|
|
37
56
|
Agent: Draft: "Hi Bob, how is the mock-up going?" Send it?
|
|
38
57
|
You: Yes.
|
|
39
58
|
```
|
|
40
59
|
|
|
41
|
-
##
|
|
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
|
-
```
|
|
49
|
-
|
|
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).
|
|
54
|
-
|
|
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.
|
|
58
|
-
|
|
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`.
|
|
60
|
+
## Why tg
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
- **Your data never leaves your computer.** `tg` talks only to Telegram. There is no WireCat server and no account
|
|
63
|
+
with us. Your history is kept in a local database that only your user can read.
|
|
64
|
+
- **The official Telegram API, with your own app.** `tg` logs in like the Telegram desktop app does, as one more of
|
|
65
|
+
your devices. It keeps its pace under Telegram's limits, so bulk work stays within them.
|
|
66
|
+
- **Search that goes all the way back.** Download a chat's full history once, then search it with no network. It finds a
|
|
67
|
+
word with a typo, its other forms and its synonyms, a question you half remember, whole discussions by meaning, and
|
|
68
|
+
asks Telegram's own server search at the same time.
|
|
69
|
+
- **Safe to give to an agent.** You decide what an agent may do: read only, write only to the chats you list, at most
|
|
70
|
+
so many messages an hour (30 by default). Text from other people is marked as untrusted, so an agent never takes a
|
|
71
|
+
message it read as an instruction. Every send is logged.
|
|
72
|
+
- **Ready for any agent.** A skill for agents with a terminal, an MCP server with ready prompts for Claude Desktop and
|
|
73
|
+
Cursor, and a secure link for ChatGPT and Claude in the browser.
|
|
74
|
+
- **Free and open source.** Apache 2.0, on macOS, Linux and Windows.
|
|
63
75
|
|
|
64
|
-
|
|
76
|
+
How it compares with other Telegram tools: [the comparison](https://wirecat.dev/en/docs/tg/compare).
|
|
65
77
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```sh
|
|
69
|
-
tg personal inbox
|
|
70
|
-
tg personal review 'date>1d'
|
|
71
|
-
```
|
|
72
|
-
|
|
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.
|
|
78
|
+
## Quick start
|
|
75
79
|
|
|
76
80
|
```sh
|
|
77
|
-
|
|
81
|
+
npm install -g @wirecat/tg-cli # or: bun add -g @wirecat/tg-cli
|
|
82
|
+
tg personal setup # register your Telegram app, log in by QR code, install the agent skill
|
|
83
|
+
tg personal inbox # other people's unread messages, in every chat
|
|
78
84
|
```
|
|
79
85
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
hands over everything said since the last review in one call, your own messages too.
|
|
84
|
-
|
|
85
|
-
```sh
|
|
86
|
-
tg personal review --new # what changed since the last review --new
|
|
87
|
-
```
|
|
86
|
+
It takes about five minutes. `personal` is a name you choose for this account. You can add `work` or any other later.
|
|
87
|
+
`tg personal setup` registers your own Telegram app at [my.telegram.org](https://my.telegram.org/apps), logs in by QR
|
|
88
|
+
code and installs the skill for Claude Code, Codex and Gemini CLI.
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
You need Node.js 22.19+ or 24+, or Bun. Try it without installing: `npx @wirecat/tg-cli --help`.
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
tg personal review chat:Hiking --unanswered
|
|
93
|
-
tg personal chats events "Hiking" "time>=7d" # who joined, left, was added or removed
|
|
94
|
-
```
|
|
92
|
+
More: [installation](https://wirecat.dev/en/docs/tg/installation), with Windows and pnpm.
|
|
95
93
|
|
|
96
|
-
|
|
94
|
+
## Use it with your agent
|
|
97
95
|
|
|
98
|
-
|
|
96
|
+
Ask in plain words. The agent picks the commands.
|
|
99
97
|
|
|
100
|
-
|
|
98
|
+
> *"Use tg. What came in since this morning, and who is waiting for my answer?"*
|
|
99
|
+
> *"Use tg. Which questions in Hiking has nobody answered?"*
|
|
100
|
+
> *"Use tg. Find the PDF Alice sent about the lease."*
|
|
101
101
|
|
|
102
|
-
- **
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- **
|
|
107
|
-
`tg personal mcp serve`. It comes with ready prompts: `/catch-up`, `/review`, `/reply`, `/find`, `/open-tasks` and `/link-conversations`.
|
|
102
|
+
- **Claude Code, Codex, Gemini CLI** and other agents with a terminal run `tg` themselves. `tg skill install --for all`
|
|
103
|
+
teaches them how.
|
|
104
|
+
- **Claude Desktop, Cursor** and other MCP apps connect to `tg personal mcp serve`. It comes with ready prompts:
|
|
105
|
+
`/catch-up`, `/review`, `/reply`, `/find`, `/open-tasks`.
|
|
106
|
+
- **ChatGPT or Claude in the browser** reach it through your own tunnel, after a login with a one-time code.
|
|
108
107
|
|
|
109
108
|
```sh
|
|
110
|
-
tg personal mcp add claude-code
|
|
111
|
-
tg personal mcp config
|
|
109
|
+
tg personal mcp add claude-code --allow-writes # or: codex
|
|
110
|
+
tg personal mcp config # the entry for Claude Desktop, Cursor and others
|
|
112
111
|
```
|
|
113
112
|
|
|
114
|
-
|
|
115
|
-
|
|
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)
|
|
118
|
-
|
|
119
|
-
## Why tg?
|
|
120
|
-
|
|
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.
|
|
113
|
+
More: [agents and MCP](https://wirecat.dev/en/docs/tg/mcp) · [from the browser](https://wirecat.dev/en/docs/tg/remote) ·
|
|
114
|
+
[recipes](https://wirecat.dev/en/docs/tg/recipes)
|
|
131
115
|
|
|
132
|
-
|
|
116
|
+
## What it can do
|
|
133
117
|
|
|
134
|
-
|
|
118
|
+
### Your account
|
|
135
119
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
their history, groups, channels and contacts.
|
|
120
|
+
Everything you do in the Telegram app: read and send, reply, forward, edit, pin, react, polls, scheduled and silent
|
|
121
|
+
messages, files, photos, videos and voice messages, contacts, devices.
|
|
139
122
|
|
|
140
123
|
```sh
|
|
141
|
-
tg personal chats list --limit 5
|
|
142
124
|
tg personal messages list "Book club" --limit 20
|
|
143
125
|
tg personal messages send "Book club" "Call at 3?" --reply-to <id>
|
|
144
|
-
tg personal
|
|
145
|
-
tg personal
|
|
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
|
|
126
|
+
tg personal messages send me "Call mum" --at-time 2h # a reminder in Saved Messages
|
|
127
|
+
tg personal review --new # everything new since the last review
|
|
149
128
|
```
|
|
150
129
|
|
|
151
|
-
|
|
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.
|
|
130
|
+
More: [using tg](https://wirecat.dev/en/docs/tg/usage) · [one person](https://wirecat.dev/en/docs/tg/people)
|
|
163
131
|
|
|
164
|
-
|
|
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.
|
|
132
|
+
### Search
|
|
170
133
|
|
|
171
134
|
```sh
|
|
172
|
-
tg personal
|
|
173
|
-
tg personal
|
|
174
|
-
tg personal
|
|
175
|
-
tg personal
|
|
176
|
-
tg
|
|
135
|
+
tg personal search all "lease agreement" # messages and notes, best match first
|
|
136
|
+
tg personal search messages 'from:"Alice Example" invoice date>30d'
|
|
137
|
+
tg personal search messages 'What time does the export run?' --discover # a question you half remember
|
|
138
|
+
tg personal search conversations 'moving to the country' # discussions close in meaning
|
|
139
|
+
tg personal search messages "contract" --offline # never leaves your computer
|
|
177
140
|
```
|
|
178
141
|
|
|
179
|
-
|
|
180
|
-
|
|
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)
|
|
142
|
+
Filter by person, chat, date, file, link and tag. Save a search and run it again. Count matches by chat, person or day.
|
|
192
143
|
|
|
193
|
-
|
|
144
|
+
More: [search](https://wirecat.dev/en/docs/tg/search) · [the query language](https://wirecat.dev/en/docs/tg/query-language) ·
|
|
145
|
+
[the local store](https://wirecat.dev/en/docs/tg/archive)
|
|
194
146
|
|
|
195
|
-
|
|
196
|
-
Telegram by default; `--offline` answers from the store without connecting.
|
|
147
|
+
### Groups you run
|
|
197
148
|
|
|
198
149
|
```sh
|
|
199
|
-
tg personal
|
|
200
|
-
tg personal
|
|
201
|
-
tg personal
|
|
202
|
-
tg personal
|
|
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
|
|
150
|
+
tg personal review chat:Hiking --unanswered # questions nobody answered in 24 hours
|
|
151
|
+
tg personal chats events "Hiking" "time>=7d" # who joined, left, was added or removed, and by whom
|
|
152
|
+
tg personal chats rules set "Hiking" links report # your moderation rules: links, forwards, floods
|
|
153
|
+
tg personal stats chats show "Hiking" # activity
|
|
206
154
|
```
|
|
207
155
|
|
|
208
|
-
|
|
156
|
+
Members, admins, join requests, invite links, forum topics and a daily member snapshot are commands too.
|
|
209
157
|
|
|
210
|
-
More: [
|
|
158
|
+
More: [groups you run](https://wirecat.dev/en/docs/tg/groups) · [auto-replies](https://wirecat.dev/en/docs/tg/replies)
|
|
211
159
|
|
|
212
|
-
|
|
160
|
+
### Voice, files and scans
|
|
213
161
|
|
|
214
162
|
```sh
|
|
215
|
-
tg personal
|
|
216
|
-
tg personal
|
|
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
|
|
163
|
+
tg personal messages transcribe "Book club" <id> # a voice message as text, on your computer
|
|
164
|
+
tg personal attachments extract # text from saved files
|
|
222
165
|
```
|
|
223
166
|
|
|
224
|
-
|
|
225
|
-
and moderation rules for links, forwards and floods are commands too.
|
|
167
|
+
More: [files and media](https://wirecat.dev/en/docs/tg/attachments)
|
|
226
168
|
|
|
227
|
-
|
|
169
|
+
### A bot
|
|
228
170
|
|
|
229
|
-
|
|
171
|
+
`tg <profile> bot` works with any bot through the official Bot API: all 185 methods, next to ready commands for
|
|
172
|
+
sending, replies and updates.
|
|
230
173
|
|
|
231
|
-
|
|
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.
|
|
174
|
+
More: [bots](https://wirecat.dev/en/docs/tg/bot)
|
|
234
175
|
|
|
235
|
-
|
|
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
|
|
242
|
-
```
|
|
243
|
-
|
|
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.
|
|
253
|
-
|
|
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)
|
|
255
|
-
|
|
256
|
-
## Agent setup in detail
|
|
257
|
-
|
|
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.
|
|
260
|
-
|
|
261
|
-
```sh
|
|
262
|
-
tg skill install --for all # both folders, without logging in
|
|
263
|
-
tg skill show # the complete instructions, without installing them
|
|
264
|
-
```
|
|
176
|
+
### With your other sources
|
|
265
177
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
178
|
+
`tg` keeps what it reads in the same local database as the other WireCat tools, such as WhatsApp, MAX and Google
|
|
179
|
+
Calendar. `tg personal search all` finds a word in messages, notes, calendar events and meeting transcripts at once.
|
|
180
|
+
Mail has its own search in memo. `tg personal contacts link` records that two accounts are one person.
|
|
269
181
|
|
|
270
|
-
|
|
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
|
-
```
|
|
182
|
+
More: [WireCat](https://wirecat.dev)
|
|
275
183
|
|
|
276
|
-
|
|
277
|
-
your tunnel, after a login with a one-time access code from your terminal.
|
|
184
|
+
## How it works
|
|
278
185
|
|
|
279
|
-
|
|
186
|
+
- **One more device.** `tg` speaks MTProto, the protocol of Telegram's own apps, through an app you register. The
|
|
187
|
+
login is kept in your system keyring, never in a file or a command line.
|
|
188
|
+
- **A local copy.** Every message `tg` reads is saved on your computer. History downloads in the background, page by
|
|
189
|
+
page. A stop loses nothing, and the next run goes on from there. `tg` knows which stretches of a chat it holds in
|
|
190
|
+
full, so "not found" never hides a gap.
|
|
191
|
+
- **Staying current.** `tg personal server install` keeps the copy up to date as a system service.
|
|
192
|
+
- **Polite to Telegram.** One request pace per account, shared by every command, agent and background job. Short
|
|
193
|
+
waits from Telegram are waited out, long ones stop the run instead of retrying.
|
|
194
|
+
- **No double sends.** When the connection drops during a send, `tg` says the outcome is unknown and gives a repeat
|
|
195
|
+
that Telegram does not deliver twice.
|
|
196
|
+
- **Made for scripts.** `--json` gives the same shape for every command, and each kind of failure has its own exit
|
|
197
|
+
code.
|
|
280
198
|
|
|
281
|
-
|
|
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)
|
|
199
|
+
More: [limits and waits](https://wirecat.dev/en/docs/tg/limits) · [output for scripts](https://wirecat.dev/en/docs/tg/cli-contract)
|
|
297
200
|
|
|
298
201
|
## Settings and permissions
|
|
299
202
|
|
|
203
|
+
Each account (profile) has its own settings: what an agent may do, which chats it may write to, how many messages an
|
|
204
|
+
hour.
|
|
205
|
+
|
|
300
206
|
```sh
|
|
301
|
-
tg personal config set permissions.messages readonly
|
|
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
|
|
207
|
+
tg personal config set permissions.messages readonly # this profile changes no messages
|
|
307
208
|
```
|
|
308
209
|
|
|
309
|
-
More: [permissions](https://
|
|
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)
|
|
210
|
+
More: [permissions](https://wirecat.dev/en/docs/tg/permissions) · [profiles](https://wirecat.dev/en/docs/tg/profiles)
|
|
318
211
|
|
|
319
212
|
## Security
|
|
320
213
|
|
|
321
|
-
|
|
322
|
-
|
|
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).
|
|
214
|
+
Your login is in the system keyring, and no command takes a password, code or phone number as an argument. The local
|
|
215
|
+
copy is readable only by your user. Text from other people cannot control your terminal or your agent.
|
|
333
216
|
|
|
334
|
-
More: [security](https://
|
|
217
|
+
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
218
|
|
|
336
219
|
## When something goes wrong
|
|
337
220
|
|
|
338
221
|
```sh
|
|
339
|
-
tg personal doctor
|
|
340
|
-
tg personal doctor --online
|
|
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
|
|
222
|
+
tg personal doctor # what is set up, without connecting
|
|
223
|
+
tg personal doctor --online # check that the login works
|
|
343
224
|
```
|
|
344
225
|
|
|
345
|
-
More: [troubleshooting
|
|
226
|
+
More: [troubleshooting](https://wirecat.dev/en/docs/tg/troubleshooting) · Ask on [Discord](https://discord.gg/DebENqbRrJ) ·
|
|
227
|
+
Bugs go to this repository's issues.
|
|
346
228
|
|
|
347
|
-
##
|
|
229
|
+
## Documentation
|
|
348
230
|
|
|
349
|
-
|
|
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).
|
|
231
|
+
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
232
|
|
|
403
233
|
## Development
|
|
404
234
|
|
|
405
235
|
```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
|
|
236
|
+
pnpm install && pnpm test
|
|
412
237
|
```
|
|
413
238
|
|
|
414
|
-
|
|
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)
|
|
239
|
+
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
240
|
|
|
421
|
-
|
|
241
|
+
Pull requests, bug reports and ideas go to [issues](https://github.com/WireCatLabs/tg-cli/issues).
|
|
422
242
|
|
|
423
|
-
|
|
424
|
-
[issues](https://github.com/WireCatLabs/tg-cli/issues).
|
|
243
|
+
## Part of WireCat
|
|
425
244
|
|
|
426
|
-
|
|
245
|
+
`tg` is one of the [WireCat](https://wirecat.dev) tools: open-source, local-first command-line tools that give AI
|
|
246
|
+
agents your context from messengers, mail, calendars and documents. Each one works on its own.
|
|
427
247
|
|
|
428
248
|
## License
|
|
429
249
|
|
|
430
|
-
Apache
|
|
250
|
+
[Apache 2.0](https://github.com/WireCatLabs/tg-cli/blob/main/LICENSE)
|