tg-claude 0.2.0 → 0.2.1

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 (3) hide show
  1. package/README.md +42 -32
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -15,54 +15,49 @@ Control Claude Code from your phone via Telegram. Get notifications when Claude
15
15
 
16
16
  ### Prerequisites
17
17
 
18
- - Node.js 20 or higher
19
- - Claude Code CLI installed and authenticated (`npm install -g @anthropic-ai/claude-code`)
18
+ - Node.js 20+
19
+ - [Claude Code CLI](https://github.com/anthropics/claude-code) installed and authenticated
20
20
  - A Telegram account
21
21
 
22
- ### 1. Create a Telegram Bot
23
-
24
- 1. Open Telegram and message [@BotFather](https://t.me/BotFather)
25
- 2. Send `/newbot`
26
- 3. Follow the prompts to name your bot
27
- 4. Copy the bot token you receive (looks like `123456789:ABCdefGHI...`)
28
-
29
- ### 2. Get Your Telegram User ID
30
-
31
- 1. Message [@userinfobot](https://t.me/userinfobot) on Telegram
32
- 2. Copy your numeric user ID (just a number like `123456789`)
33
-
34
- ### 3. Install and Configure
35
-
36
- **Option A: Global Install (recommended)**
22
+ ### Installation
37
23
 
38
24
  ```bash
39
25
  npm install -g tg-claude
40
26
  ```
41
27
 
42
- **Option B: npx (no install)**
28
+ ### Setup (Interactive Wizard)
29
+
30
+ Just run the command — the setup wizard guides you through everything:
43
31
 
44
32
  ```bash
45
- npx tg-claude "Your prompt"
33
+ tg-claude
46
34
  ```
47
35
 
48
- Set your environment variables:
36
+ The wizard will:
37
+ 1. **Walk you through creating a Telegram bot** via @BotFather
38
+ 2. **Help you get your user ID** from @userinfobot
39
+ 3. **Save credentials** to `.env` automatically
40
+
41
+ That's it! Now run with a prompt:
49
42
 
50
43
  ```bash
51
- export TELEGRAM_BOT_TOKEN="your_bot_token"
52
- export TELEGRAM_USER_ID="your_user_id"
44
+ tg-claude "Fix the bug in app.js"
53
45
  ```
54
46
 
55
- Or create a `.env` file in your working directory:
47
+ ### Alternative: npx (no install)
56
48
 
57
49
  ```bash
58
- cp .env.example .env
59
- # Edit .env with your values
50
+ npx tg-claude
60
51
  ```
61
52
 
62
- ### 4. Run
53
+ > **Note:** With npx, the `.env` file is created in your current directory. Run from your project folder.
54
+
55
+ ### Re-run Setup
56
+
57
+ To reconfigure your Telegram credentials anytime:
63
58
 
64
59
  ```bash
65
- tg-claude "Fix the bug in app.js"
60
+ tg-claude --setup
66
61
  ```
67
62
 
68
63
  ## Usage
@@ -75,6 +70,7 @@ tg-claude [options] "Your prompt"
75
70
 
76
71
  | Flag | Description |
77
72
  |------|-------------|
73
+ | `--setup` | Run setup wizard to configure Telegram credentials |
78
74
  | `--help`, `-h` | Show help message |
79
75
  | `--version`, `-v` | Show version number |
80
76
  | `--verbose` | Show additional logging |
@@ -144,17 +140,31 @@ npm install -g @anthropic-ai/claude-code
144
140
  claude auth login
145
141
  ```
146
142
 
147
- ### "Permission denied" on global install
143
+ ### "Permission denied" or EACCES errors
148
144
 
149
- Use sudo or configure npm for global installs without sudo:
145
+ Fix npm permissions (recommended one-time fix):
146
+
147
+ ```bash
148
+ sudo chown -R $(whoami) ~/.npm
149
+ ```
150
+
151
+ Then install normally:
152
+
153
+ ```bash
154
+ npm install -g tg-claude
155
+ ```
156
+
157
+ Or use a custom npm prefix:
150
158
 
151
159
  ```bash
152
- sudo npm install -g tg-claude
153
- # or
154
160
  npm config set prefix ~/.npm-global
155
- export PATH=~/.npm-global/bin:$PATH
161
+ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
162
+ source ~/.zshrc
163
+ npm install -g tg-claude
156
164
  ```
157
165
 
166
+ > **Avoid using sudo with npx** — it creates files with root ownership which causes issues.
167
+
158
168
  ### Bot not responding
159
169
 
160
170
  1. Make sure you messaged your bot at least once to start a conversation
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ function escapeHtml(text) {
18
18
  * Supports multi-turn conversations via Telegram with --resume.
19
19
  */
20
20
  // Package version for --version flag
21
- const VERSION = '0.2.0';
21
+ const VERSION = '0.2.1';
22
22
  // Load and validate environment variables
23
23
  const env = loadEnv();
24
24
  // Parse command line arguments
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tg-claude",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Bridge between Claude Code CLI and Telegram for mobile interaction",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",