@lucashca/tgcc 1.2.1 โ 1.4.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 +201 -67
- package/dist/src/claude/session.d.ts.map +1 -1
- package/dist/src/claude/session.js +11 -2
- package/dist/src/claude/session.js.map +1 -1
- package/dist/src/cli/start.d.ts.map +1 -1
- package/dist/src/cli/start.js +6 -0
- package/dist/src/cli/start.js.map +1 -1
- package/dist/src/utils/healthcheck.d.ts +12 -0
- package/dist/src/utils/healthcheck.d.ts.map +1 -0
- package/dist/src/utils/healthcheck.js +136 -0
- package/dist/src/utils/healthcheck.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,96 +1,168 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.shields.io/npm/v/@lucashca/tgcc?color=%2300C853&label=npm&style=for-the-badge" alt="npm version" />
|
|
3
|
+
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen?style=for-the-badge&logo=node.js" alt="node version" />
|
|
4
|
+
<img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge" alt="license" />
|
|
5
|
+
<img src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey?style=for-the-badge" alt="platform" />
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
<h1 align="center">๐ค tgcc</h1>
|
|
9
|
+
<h3 align="center">Telegram + Claude Code</h3>
|
|
4
10
|
|
|
5
|
-
|
|
11
|
+
<p align="center">
|
|
12
|
+
<strong>Control Claude Code from anywhere using Telegram.</strong><br/>
|
|
13
|
+
Edit files, run commands, manage projects โ all from your phone. ๐ฑ
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<code>npm install -g @lucashca/tgcc</code>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://lucashcaraujo.github.io/cloude-telegram/">๐ Documentation & Website</a> ยท
|
|
22
|
+
<a href="https://www.npmjs.com/package/@lucashca/tgcc">๐ฆ npm</a> ยท
|
|
23
|
+
<a href="https://github.com/lucashcaraujo/cloude-telegram/issues">๐ Issues</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## โก How it works
|
|
6
29
|
|
|
7
30
|
```
|
|
8
|
-
You (Telegram)
|
|
31
|
+
๐ฑ You (Telegram) โ ๐ tgcc (thin proxy) โ ๐ง Claude Code โ ๐ป Your machine
|
|
9
32
|
```
|
|
10
33
|
|
|
11
|
-
|
|
34
|
+
**tgcc** is a lightweight bridge between Telegram and the [Claude Agent SDK](https://docs.anthropic.com/en/docs/claude-code). The bot handles zero logic โ Claude Code does all the thinking, coding, and file management. You just chat.
|
|
12
35
|
|
|
13
|
-
|
|
36
|
+
---
|
|
14
37
|
|
|
15
|
-
|
|
16
|
-
- **Session persistence** โ conversations are maintained between messages and survive bot restarts
|
|
17
|
-
- **File sharing** โ files created or edited by Claude Code are sent as Telegram documents
|
|
18
|
-
- **Whitelist auth** โ only authorized Telegram users can interact with the bot
|
|
19
|
-
- **Cross-platform** โ works on Linux, macOS, and Windows
|
|
20
|
-
- **Simple CLI** โ interactive setup wizard, one command to start
|
|
38
|
+
## ๐ฅ Why tgcc?
|
|
21
39
|
|
|
22
|
-
|
|
40
|
+
| | Feature | Description |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| ๐ | **Code from anywhere** | Review PRs from the couch. Fix bugs from the bus. Deploy from the beach. |
|
|
43
|
+
| ๐ง | **Full Claude Code power** | File editing, terminal commands, codebase navigation, multi-turn conversations. |
|
|
44
|
+
| ๐ | **Zero config AI** | No API keys to manage. If Claude Code works on your machine, tgcc works too. |
|
|
45
|
+
| ๐ | **Secure by default** | Whitelist-based auth. Only verified users can interact with the bot. |
|
|
46
|
+
| โก | **Dead simple setup** | One command. Paste a token. Send a code. Done. |
|
|
23
47
|
|
|
24
|
-
|
|
25
|
-
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated (`ANTHROPIC_API_KEY` set)
|
|
26
|
-
- A Telegram bot token (create one via [@BotFather](https://t.me/BotFather))
|
|
27
|
-
- Your Telegram chat ID (get it from [@userinfobot](https://t.me/userinfobot))
|
|
48
|
+
---
|
|
28
49
|
|
|
29
|
-
##
|
|
50
|
+
## ๐ฌ Demo
|
|
30
51
|
|
|
31
|
-
```bash
|
|
32
|
-
npm install -g tgcc
|
|
33
52
|
```
|
|
53
|
+
๐ค You: List all TODO comments in the project
|
|
34
54
|
|
|
35
|
-
|
|
55
|
+
๐ค Bot: โณ Processing...
|
|
36
56
|
|
|
37
|
-
|
|
38
|
-
|
|
57
|
+
๐ค Bot: Found 3 TODOs across 2 files:
|
|
58
|
+
๐ src/api.ts:42 โ TODO: add rate limiting
|
|
59
|
+
๐ src/api.ts:89 โ TODO: handle timeout errors
|
|
60
|
+
๐ src/db.ts:15 โ TODO: add connection pooling
|
|
61
|
+
|
|
62
|
+
๐ค You: Fix the rate limiting one
|
|
63
|
+
|
|
64
|
+
๐ค Bot: โณ Processing...
|
|
65
|
+
|
|
66
|
+
๐ค Bot: โ
Done. Added rate limiting middleware using express-rate-limit.
|
|
67
|
+
Modified: src/api.ts, package.json
|
|
68
|
+
๐ค Bot: ๐ src/api.ts
|
|
39
69
|
```
|
|
40
70
|
|
|
41
|
-
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## ๐ Quick Start
|
|
42
74
|
|
|
43
|
-
### 1
|
|
75
|
+
### 1๏ธโฃ Install
|
|
44
76
|
|
|
45
77
|
```bash
|
|
46
|
-
tgcc
|
|
78
|
+
npm install -g @lucashca/tgcc
|
|
47
79
|
```
|
|
48
80
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
81
|
+
### 2๏ธโฃ Create a Telegram Bot
|
|
82
|
+
|
|
83
|
+
1. Open Telegram and search for [@BotFather](https://t.me/BotFather)
|
|
84
|
+
2. Send `/newbot` and follow the prompts
|
|
85
|
+
3. Copy the bot token ๐
|
|
53
86
|
|
|
54
|
-
###
|
|
87
|
+
### 3๏ธโฃ Setup
|
|
55
88
|
|
|
56
89
|
```bash
|
|
57
|
-
tgcc
|
|
90
|
+
tgcc init
|
|
58
91
|
```
|
|
59
92
|
|
|
60
|
-
|
|
93
|
+
The wizard will:
|
|
94
|
+
- ๐ Ask for your **bot token**
|
|
95
|
+
- ๐ Ask for your **working directory**
|
|
96
|
+
- ๐ข Generate a **verification code** โ send it to your bot on Telegram
|
|
97
|
+
- ๐ **Start the bot** automatically
|
|
61
98
|
|
|
62
|
-
|
|
99
|
+
**That's it.** Start chatting with Claude Code on Telegram! ๐
|
|
63
100
|
|
|
64
|
-
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## ๐ฌ Telegram Commands
|
|
65
104
|
|
|
66
105
|
| Command | Description |
|
|
67
106
|
|---------|-------------|
|
|
68
|
-
| `/start` | Show welcome message
|
|
69
|
-
| `/new` | Start a
|
|
70
|
-
| `/cwd
|
|
107
|
+
| `/start` | ๐ Show welcome message |
|
|
108
|
+
| `/new` | ๐ Start a fresh conversation |
|
|
109
|
+
| `/cwd /path` | ๐ Change working directory |
|
|
71
110
|
|
|
72
|
-
Any other
|
|
111
|
+
Any other message goes straight to Claude Code ๐ง
|
|
73
112
|
|
|
74
|
-
|
|
113
|
+
---
|
|
75
114
|
|
|
76
|
-
|
|
77
|
-
# Interactive setup
|
|
78
|
-
tgcc init
|
|
115
|
+
## ๐ ๏ธ CLI Commands
|
|
79
116
|
|
|
80
|
-
|
|
81
|
-
tgcc
|
|
117
|
+
```bash
|
|
118
|
+
tgcc init # ๐ง Setup wizard
|
|
119
|
+
tgcc start # ๐ Start the bot
|
|
120
|
+
tgcc start --debug # ๐ Start with verbose logging
|
|
121
|
+
tgcc reset # ๐๏ธ Delete config and re-run setup
|
|
122
|
+
tgcc config show # ๐ Show current config
|
|
123
|
+
tgcc config set <k> <v> # โ๏ธ Update a config value
|
|
124
|
+
```
|
|
82
125
|
|
|
83
|
-
|
|
84
|
-
tgcc config show
|
|
126
|
+
### Examples
|
|
85
127
|
|
|
86
|
-
|
|
128
|
+
```bash
|
|
129
|
+
# ๐ฅ Add another user to the whitelist
|
|
87
130
|
tgcc config set telegram.whitelist 123456789,987654321
|
|
88
|
-
|
|
131
|
+
|
|
132
|
+
# ๐ Change working directory
|
|
133
|
+
tgcc config set claude.workingDirectory /home/user/my-project
|
|
134
|
+
|
|
135
|
+
# ๐ Change permission mode
|
|
136
|
+
tgcc config set claude.permissionMode bypassPermissions
|
|
89
137
|
```
|
|
90
138
|
|
|
91
|
-
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## โจ Features
|
|
142
|
+
|
|
143
|
+
### ๐พ Session Persistence
|
|
144
|
+
Each chat gets its own Claude Code session. Context is preserved between messages โ ask follow-up questions, iterate on code, debug across multiple turns. Sessions survive bot restarts.
|
|
145
|
+
|
|
146
|
+
### ๐ File Sharing
|
|
147
|
+
When Claude Code creates or edits files, tgcc sends them as Telegram documents. Review diffs, download generated code, all without leaving the chat.
|
|
148
|
+
|
|
149
|
+
### โณ Processing Indicator
|
|
150
|
+
A visible "โณ Processing..." message appears while Claude Code works. It disappears when the response arrives โ you always know what's happening.
|
|
151
|
+
|
|
152
|
+
### โฑ๏ธ Long-Running Tasks
|
|
153
|
+
tgcc supports requests that take up to **10 minutes** โ enough for complex refactors, test runs, or full codebase analysis.
|
|
92
154
|
|
|
93
|
-
|
|
155
|
+
### ๐ SNI Bypass
|
|
156
|
+
Some networks block Telegram at the TLS/SNI level. tgcc automatically detects this and falls back to an IP-based connection. **No VPN needed.**
|
|
157
|
+
|
|
158
|
+
### ๐ก๏ธ Error Recovery
|
|
159
|
+
The bot catches errors gracefully and keeps running. No more crashes from timeouts or unexpected responses.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## โ๏ธ Configuration
|
|
164
|
+
|
|
165
|
+
Config lives at `~/.claude-telegram/config.json`:
|
|
94
166
|
|
|
95
167
|
```json
|
|
96
168
|
{
|
|
@@ -106,29 +178,91 @@ Config is stored at `~/.tgcc/config.json`:
|
|
|
106
178
|
}
|
|
107
179
|
```
|
|
108
180
|
|
|
109
|
-
### Options
|
|
110
|
-
|
|
111
181
|
| Key | Description | Default |
|
|
112
182
|
|-----|-------------|---------|
|
|
113
|
-
| `telegram.token` |
|
|
114
|
-
| `telegram.whitelist` |
|
|
115
|
-
| `claude.workingDirectory` |
|
|
116
|
-
| `claude.permissionMode` |
|
|
117
|
-
| `claude.allowedTools` | Tools Claude Code can use |
|
|
183
|
+
| ๐ `telegram.token` | Bot token from BotFather | โ |
|
|
184
|
+
| ๐ฅ `telegram.whitelist` | Allowed Telegram chat IDs | Set during init |
|
|
185
|
+
| ๐ `claude.workingDirectory` | Where Claude Code operates | Set during init |
|
|
186
|
+
| ๐ `claude.permissionMode` | `default` ยท `acceptEdits` ยท `bypassPermissions` | `acceptEdits` |
|
|
187
|
+
| ๐ง `claude.allowedTools` | Tools Claude Code can use | All standard tools |
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## ๐ Security
|
|
192
|
+
|
|
193
|
+
| | |
|
|
194
|
+
|---|---|
|
|
195
|
+
| โ
| **Whitelist auth** โ Only verified chat IDs can use the bot |
|
|
196
|
+
| โ
| **Verification flow** โ New users must enter a code shown in the terminal |
|
|
197
|
+
| โ
| **Local only** โ The bot runs on your machine. No third-party servers |
|
|
198
|
+
| โ
| **Config protection** โ Config file created with `600` permissions |
|
|
199
|
+
| โ
| **No data storage** โ tgcc stores nothing. Conversations live in Claude Code's session system |
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## ๐ Architecture
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
|
|
207
|
+
โ ๐ฑ Telegram โโโโโโถโ ๐ tgcc โโโโโโถโ ๐ง Claude Code โ
|
|
208
|
+
โ (phone) โโโโโโโ (thin proxy)โโโโโโโ (full agent) โ
|
|
209
|
+
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
|
|
210
|
+
โ
|
|
211
|
+
๐ ~/.claude-telegram/
|
|
212
|
+
config.json
|
|
213
|
+
sessions.json
|
|
214
|
+
```
|
|
118
215
|
|
|
119
|
-
|
|
216
|
+
tgcc is intentionally minimal. It does three things:
|
|
217
|
+
1. ๐จ Receives messages from Telegram
|
|
218
|
+
2. ๐ Forwards them to the Claude Agent SDK
|
|
219
|
+
3. ๐ค Sends responses back
|
|
120
220
|
|
|
121
|
-
|
|
122
|
-
- Only whitelisted chat IDs can interact with the bot
|
|
123
|
-
- Messages from unauthorized users are silently ignored
|
|
124
|
-
- The bot runs locally on your machine โ no data is sent to third-party servers (only Telegram API and Anthropic API)
|
|
221
|
+
All intelligence, context management, file editing, and code execution is handled by Claude Code.
|
|
125
222
|
|
|
126
|
-
|
|
223
|
+
---
|
|
127
224
|
|
|
128
|
-
|
|
225
|
+
## ๐ Requirements
|
|
129
226
|
|
|
130
|
-
|
|
227
|
+
| | |
|
|
228
|
+
|---|---|
|
|
229
|
+
| ๐ | [Node.js](https://nodejs.org/) >= 18 |
|
|
230
|
+
| ๐ง | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated |
|
|
231
|
+
| ๐ค | A Telegram bot token โ [create one here](https://t.me/BotFather) |
|
|
131
232
|
|
|
132
|
-
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## ๐ง Troubleshooting
|
|
236
|
+
|
|
237
|
+
| Problem | Solution |
|
|
238
|
+
|---------|----------|
|
|
239
|
+
| ๐ค Bot not responding? | Run `tgcc start --debug` to see detailed logs |
|
|
240
|
+
| โฑ๏ธ Connection timeout? | tgcc auto-detects SNI blocks โ check your firewall if issues persist |
|
|
241
|
+
| ๐ซ Permission denied? | `tgcc config set claude.permissionMode bypassPermissions` |
|
|
242
|
+
| ๐ Want a fresh start? | `tgcc reset` |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## ๐ค Contributing
|
|
247
|
+
|
|
248
|
+
This is an **open-source** project. PRs and issues are welcome! ๐
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
git clone https://github.com/lucashcaraujo/cloude-telegram.git
|
|
252
|
+
cd cloude-telegram
|
|
253
|
+
npm install
|
|
254
|
+
npm run build
|
|
255
|
+
npm run local -- start --debug
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## ๐ License
|
|
133
261
|
|
|
134
262
|
MIT
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
<p align="center">
|
|
267
|
+
Built with ๐ง <a href="https://docs.anthropic.com/en/docs/claude-code">Claude Code</a> and ๐ <a href="https://telegraf.js.org/">Telegraf</a>
|
|
268
|
+
</p>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/claude/session.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/claude/session.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGpF,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,wBAAgB,YAAY,IAAI,IAAI,CAKnC;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAGjD;AAUD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,cAAc,CAAC,CA6EzB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { query } from "@anthropic-ai/claude-
|
|
1
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
2
2
|
import { loadSessions, saveSessions } from "../config/config.js";
|
|
3
|
+
import { log } from "../utils/logger.js";
|
|
3
4
|
const sessionMap = new Map();
|
|
4
5
|
export function initSessions() {
|
|
5
6
|
const saved = loadSessions();
|
|
@@ -33,8 +34,10 @@ export async function sendMessage(chatId, message, config) {
|
|
|
33
34
|
let sessionId = existingSession ?? "";
|
|
34
35
|
let cost = 0;
|
|
35
36
|
try {
|
|
37
|
+
log("debug", `[chat:${chatId}] Starting query (cwd: ${config.workingDirectory}, session: ${existingSession ?? "new"})`);
|
|
36
38
|
const conversation = query({ prompt: message, options });
|
|
37
39
|
for await (const msg of conversation) {
|
|
40
|
+
log("debug", `[chat:${chatId}] SDK message: type=${msg.type}${"subtype" in msg ? ` subtype=${msg.subtype}` : ""}`);
|
|
38
41
|
if (msg.type === "system" && "session_id" in msg) {
|
|
39
42
|
sessionId = msg.session_id;
|
|
40
43
|
}
|
|
@@ -59,7 +62,9 @@ export async function sendMessage(chatId, message, config) {
|
|
|
59
62
|
cost = result.total_cost_usd;
|
|
60
63
|
}
|
|
61
64
|
else {
|
|
65
|
+
const errors = "errors" in result ? result.errors : [];
|
|
62
66
|
resultText = `Error: ${result.subtype}`;
|
|
67
|
+
log("error", `[chat:${chatId}] SDK error: ${result.subtype} โ ${Array.isArray(errors) ? errors.join(", ") : errors}`);
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
}
|
|
@@ -69,8 +74,12 @@ export async function sendMessage(chatId, message, config) {
|
|
|
69
74
|
}
|
|
70
75
|
catch (err) {
|
|
71
76
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
77
|
+
const hint = errorMsg.includes("exited with code 1")
|
|
78
|
+
? "\n\nPossible causes:\nโข Claude Code CLI not installed (npm install -g @anthropic-ai/claude-agent-sdk)\nโข Not authenticated (run: claude login)\nโข ANTHROPIC_API_KEY not set in environment"
|
|
79
|
+
: "";
|
|
80
|
+
log("error", `[chat:${chatId}] Exception: ${errorMsg}`);
|
|
72
81
|
return {
|
|
73
|
-
text: `Error: ${errorMsg}`,
|
|
82
|
+
text: `Error: ${errorMsg}${hint}`,
|
|
74
83
|
sessionId,
|
|
75
84
|
files: [],
|
|
76
85
|
cost: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/claude/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/claude/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAUzC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE7C,MAAM,UAAU,YAAY;IAC1B,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACpC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1B,eAAe,EAAE,CAAC;AACpB,CAAC;AAED,SAAS,eAAe;IACtB,MAAM,GAAG,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OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;gBACxH,CAAC;YACH,CAAC;QACH,CAAC;QAED,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAClC,eAAe,EAAE,CAAC;QAElB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAC3E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClE,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC;YAClD,CAAC,CAAC,4LAA4L;YAC9L,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,EAAE,SAAS,MAAM,gBAAgB,QAAQ,EAAE,CAAC,CAAC;QACxD,OAAO;YACL,IAAI,EAAE,UAAU,QAAQ,GAAG,IAAI,EAAE;YACjC,SAAS;YACT,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,QAAQ;SAChB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/cli/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/cli/start.ts"],"names":[],"mappings":"AAIA,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAW9C"}
|
package/dist/src/cli/start.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { loadConfig } from "../config/config.js";
|
|
2
2
|
import { startBot } from "../bot/bot.js";
|
|
3
|
+
import { runHealthCheck, printHealthCheck } from "../utils/healthcheck.js";
|
|
3
4
|
export async function runStart() {
|
|
4
5
|
const config = loadConfig();
|
|
6
|
+
const health = runHealthCheck(config.claude.workingDirectory);
|
|
7
|
+
printHealthCheck(health);
|
|
8
|
+
if (!health.ok) {
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
5
11
|
await startBot(config);
|
|
6
12
|
}
|
|
7
13
|
//# sourceMappingURL=start.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/cli/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/cli/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3E,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAE5B,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAC9D,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEzB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface HealthCheckResult {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
checks: {
|
|
4
|
+
name: string;
|
|
5
|
+
status: "pass" | "fail" | "warn";
|
|
6
|
+
message: string;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
export declare function runHealthCheck(workingDirectory: string): HealthCheckResult;
|
|
10
|
+
export declare function printHealthCheck(result: HealthCheckResult): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=healthcheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healthcheck.d.ts","sourceRoot":"","sources":["../../../src/utils/healthcheck.ts"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;CACL;AAyHD,wBAAgB,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,iBAAiB,CAU1E;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAgBhE"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
function checkClaudeCLI() {
|
|
6
|
+
try {
|
|
7
|
+
const version = execSync("claude --version", {
|
|
8
|
+
encoding: "utf-8",
|
|
9
|
+
timeout: 10000,
|
|
10
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
11
|
+
}).trim();
|
|
12
|
+
return { status: "pass", message: `Claude Code CLI found (${version})` };
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
// Check common install locations
|
|
16
|
+
const commonPaths = [
|
|
17
|
+
"/usr/local/bin/claude",
|
|
18
|
+
"/opt/homebrew/bin/claude",
|
|
19
|
+
path.join(os.homedir(), ".npm-global/bin/claude"),
|
|
20
|
+
path.join(os.homedir(), ".nvm/versions/node"),
|
|
21
|
+
];
|
|
22
|
+
const found = commonPaths.find((p) => {
|
|
23
|
+
try {
|
|
24
|
+
return fs.existsSync(p);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
if (found) {
|
|
31
|
+
return {
|
|
32
|
+
status: "fail",
|
|
33
|
+
message: `Claude Code CLI found at ${found} but not in PATH.\n` +
|
|
34
|
+
` Add it to your PATH or run: export PATH="${path.dirname(found)}:$PATH"`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
status: "fail",
|
|
39
|
+
message: "Claude Code CLI not found.\n" +
|
|
40
|
+
" Install it with: npm install -g @anthropic-ai/claude-code",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function checkAuth() {
|
|
45
|
+
// Check if ANTHROPIC_API_KEY is set
|
|
46
|
+
if (process.env.ANTHROPIC_API_KEY) {
|
|
47
|
+
return { status: "pass", message: "ANTHROPIC_API_KEY is set" };
|
|
48
|
+
}
|
|
49
|
+
// Check if logged in via `claude login` โ credentials stored in ~/.claude/
|
|
50
|
+
const credentialsPath = path.join(os.homedir(), ".claude", ".credentials.json");
|
|
51
|
+
if (fs.existsSync(credentialsPath)) {
|
|
52
|
+
try {
|
|
53
|
+
const content = fs.readFileSync(credentialsPath, "utf-8");
|
|
54
|
+
const creds = JSON.parse(content);
|
|
55
|
+
if (creds && (creds.oauthAccount || creds.claudeAiOauth)) {
|
|
56
|
+
return { status: "pass", message: "Authenticated via claude login" };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// ignore parse errors
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Check alternative credential locations
|
|
64
|
+
const configDir = path.join(os.homedir(), ".claude");
|
|
65
|
+
if (fs.existsSync(configDir)) {
|
|
66
|
+
try {
|
|
67
|
+
const files = fs.readdirSync(configDir);
|
|
68
|
+
const hasAuth = files.some((f) => f.includes("credentials") || f.includes("auth") || f.includes("oauth"));
|
|
69
|
+
if (hasAuth) {
|
|
70
|
+
return { status: "warn", message: "Auth files found in ~/.claude/ but could not verify. Try running: claude login" };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// ignore
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
status: "fail",
|
|
79
|
+
message: "No authentication found.\n" +
|
|
80
|
+
" Option 1: Run 'claude login' to authenticate with your Anthropic account\n" +
|
|
81
|
+
" Option 2: Set ANTHROPIC_API_KEY environment variable",
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function checkWorkingDirectory(dir) {
|
|
85
|
+
if (!fs.existsSync(dir)) {
|
|
86
|
+
return {
|
|
87
|
+
status: "fail",
|
|
88
|
+
message: `Working directory does not exist: ${dir}\n Run: tgcc config set claude.workingDirectory /valid/path`,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
fs.accessSync(dir, fs.constants.R_OK | fs.constants.W_OK);
|
|
93
|
+
return { status: "pass", message: `Working directory OK (${dir})` };
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return {
|
|
97
|
+
status: "fail",
|
|
98
|
+
message: `No read/write permission on: ${dir}`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function checkNodeVersion() {
|
|
103
|
+
const version = process.versions.node;
|
|
104
|
+
const major = parseInt(version.split(".")[0], 10);
|
|
105
|
+
if (major < 18) {
|
|
106
|
+
return {
|
|
107
|
+
status: "warn",
|
|
108
|
+
message: `Node.js ${version} detected. Version 18+ is recommended.`,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return { status: "pass", message: `Node.js ${version}` };
|
|
112
|
+
}
|
|
113
|
+
export function runHealthCheck(workingDirectory) {
|
|
114
|
+
const checks = [
|
|
115
|
+
{ name: "Node.js", ...checkNodeVersion() },
|
|
116
|
+
{ name: "Claude Code CLI", ...checkClaudeCLI() },
|
|
117
|
+
{ name: "Authentication", ...checkAuth() },
|
|
118
|
+
{ name: "Working Directory", ...checkWorkingDirectory(workingDirectory) },
|
|
119
|
+
];
|
|
120
|
+
const ok = checks.every((c) => c.status !== "fail");
|
|
121
|
+
return { ok, checks };
|
|
122
|
+
}
|
|
123
|
+
export function printHealthCheck(result) {
|
|
124
|
+
console.log("\n Health Check\n");
|
|
125
|
+
for (const check of result.checks) {
|
|
126
|
+
const icon = check.status === "pass" ? " โ
" :
|
|
127
|
+
check.status === "warn" ? " โ ๏ธ " :
|
|
128
|
+
" โ";
|
|
129
|
+
console.log(`${icon} ${check.name}: ${check.message}`);
|
|
130
|
+
}
|
|
131
|
+
console.log("");
|
|
132
|
+
if (!result.ok) {
|
|
133
|
+
console.log(" โ Some checks failed. Fix the issues above before starting the bot.\n");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=healthcheck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healthcheck.js","sourceRoot":"","sources":["../../../src/utils/healthcheck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAW7B,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,QAAQ,CAAC,kBAAkB,EAAE;YAC3C,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,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F,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;IACpD,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAyB;IACxD,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAElC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,IAAI,GACR,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBACnC,KAAK,CAAC;QACR,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACzF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucashca/tgcc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Control Claude Code remotely via Telegram",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"node": ">=18.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@anthropic-ai/claude-
|
|
41
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.0",
|
|
42
42
|
"@inquirer/input": "^5.0.10",
|
|
43
43
|
"commander": "^13.0.0",
|
|
44
44
|
"inquirer": "^12.0.0",
|