better-tg-cli 0.20.0 → 0.21.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 +27 -2
- package/SKILL.md +1 -1
- package/dist/telegram.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +25 -0
package/README.md
CHANGED
|
@@ -73,8 +73,11 @@ invite service (`broker/`) hands out the app's keys once, for this login only. T
|
|
|
73
73
|
kept on your machine. Invites are personal, allow a limited number of logins, and can be revoked.
|
|
74
74
|
|
|
75
75
|
The session is stored in the macOS Keychain (service `tg-cli`), or in 1Password with
|
|
76
|
-
`--op-vault <vault>`. `telegram logout` removes it. On Linux
|
|
77
|
-
|
|
76
|
+
`--op-vault <vault>`. `telegram logout` removes it. On Linux it goes to the Secret Service (GNOME
|
|
77
|
+
Keyring, KWallet, KeePassXC) through `secret-tool`, which needs the `libsecret-tools` package. A
|
|
78
|
+
session already saved in the config file moves there automatically. Without any secret store, the
|
|
79
|
+
session is kept in `~/.config/tg/config.json5` (mode 0600) and write commands stay disabled.
|
|
80
|
+
On Linux, `write-access on` is confirmed at a terminal prompt.
|
|
78
81
|
|
|
79
82
|
## Usage
|
|
80
83
|
|
|
@@ -97,6 +100,28 @@ Read commands take `--json`, and some also take `--markdown`. See all commands w
|
|
|
97
100
|
`telegram help-all`. [reference.md](reference.md) covers the behaviour that the flag list can't
|
|
98
101
|
explain: output shapes, threads, bot buttons, admin commands and troubleshooting.
|
|
99
102
|
|
|
103
|
+
## MCP server
|
|
104
|
+
|
|
105
|
+
For clients without a shell (Claude Desktop, Cursor, other MCP hosts), `telegram mcp` serves three
|
|
106
|
+
tools over stdio:
|
|
107
|
+
- `telegram_help`: a searchable flag reference;
|
|
108
|
+
- `telegram_read`: read-only, so clients may auto-approve it;
|
|
109
|
+
- `telegram_write`: marked destructive, and still needs `write-access on` from you.
|
|
110
|
+
|
|
111
|
+
Log in with `telegram auth` in a terminal first.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
claude mcp add telegram -- telegram mcp # Claude Code
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{ "mcpServers": { "telegram": { "command": "/opt/homebrew/bin/telegram", "args": ["mcp"] } } }
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Use the second form for Claude Desktop (`claude_desktop_config.json`) or Cursor (`.cursor/mcp.json`).
|
|
122
|
+
GUI apps may not see your shell PATH, so give the full path from `which telegram`. To keep the MCP
|
|
123
|
+
client off your main session, add `"env": {"TG_PROFILE": "work"}`.
|
|
124
|
+
|
|
100
125
|
## Development
|
|
101
126
|
|
|
102
127
|
[DEVELOPMENT.md](DEVELOPMENT.md) covers:
|
package/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Full-featured Telegram CLI on the user's own account — read, sear
|
|
|
7
7
|
|
|
8
8
|
`telegram <command>` runs on the user's own account (MTProto, not a bot).
|
|
9
9
|
|
|
10
|
-
**Before using an unfamiliar flag, run `telegram help-all -g <word>`.** It lists every command and flag, generated from the code, so it is always current. For behaviour details (threads, bot buttons, sync, JSON shapes, errors), read `reference.md` next to this file.
|
|
10
|
+
**Before using an unfamiliar flag, run `telegram help-all -g <word>`.** It lists every command and flag, generated from the code, so it is always current. For behaviour details (threads, bot buttons, sync, JSON shapes, errors), read `reference.md` next to this file. If the `telegram_read` and `telegram_write` MCP tools are available (`telegram mcp`), they take the same argv as the CLI.
|
|
11
11
|
|
|
12
12
|
## Rules
|
|
13
13
|
|