claude-code-remote-pilot 0.1.0 → 0.1.2

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 CHANGED
@@ -104,16 +104,46 @@ Planned:
104
104
  - python3 recommended for better reset-time parsing
105
105
  - Claude Code CLI installed and authenticated
106
106
 
107
- macOS:
107
+ ---
108
+
109
+ ## Installing tmux
110
+
111
+ **macOS (Homebrew):**
108
112
 
109
113
  ```bash
110
114
  brew install tmux
111
115
  ```
112
116
 
113
- Ubuntu/Debian:
117
+ **Ubuntu / Debian:**
118
+
119
+ ```bash
120
+ sudo apt update && sudo apt install tmux curl python3
121
+ ```
122
+
123
+ **Fedora / RHEL / CentOS:**
124
+
125
+ ```bash
126
+ sudo dnf install tmux curl python3
127
+ ```
128
+
129
+ **Arch Linux:**
130
+
131
+ ```bash
132
+ sudo pacman -S tmux curl python3
133
+ ```
134
+
135
+ **Windows (WSL):**
136
+
137
+ Run inside your WSL terminal (Ubuntu recommended):
138
+
139
+ ```bash
140
+ sudo apt update && sudo apt install tmux curl python3
141
+ ```
142
+
143
+ Verify tmux is working:
114
144
 
115
145
  ```bash
116
- sudo apt install tmux curl python3
146
+ tmux -V
117
147
  ```
118
148
 
119
149
  ---
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { spawn } = require('child_process');
3
+ const { spawn, execSync } = require('child_process');
4
4
  const path = require('path');
5
5
  const fs = require('fs');
6
6
 
@@ -11,6 +11,72 @@ if (!fs.existsSync(scriptPath)) {
11
11
  process.exit(1);
12
12
  }
13
13
 
14
+ const readline = require('readline');
15
+
16
+ function checkDep(cmd) {
17
+ try { execSync(`command -v ${cmd}`, { stdio: 'ignore' }); return true; }
18
+ catch { return false; }
19
+ }
20
+
21
+ function detectPlatform() {
22
+ const platform = process.platform;
23
+ if (platform === 'darwin') return 'macos';
24
+ if (platform === 'win32') return 'windows';
25
+ try {
26
+ const release = fs.readFileSync('/etc/os-release', 'utf8');
27
+ if (/ID=arch/i.test(release)) return 'arch';
28
+ if (/ID=(fedora|rhel|centos)/i.test(release)) return 'fedora';
29
+ } catch {}
30
+ return 'debian';
31
+ }
32
+
33
+ function tmuxInstallCmd() {
34
+ const p = detectPlatform();
35
+ if (p === 'macos') return 'brew install tmux';
36
+ if (p === 'arch') return 'sudo pacman -S --noconfirm tmux';
37
+ if (p === 'fedora') return 'sudo dnf install -y tmux';
38
+ return 'sudo apt-get install -y tmux';
39
+ }
40
+
41
+ function prompt(question) {
42
+ return new Promise((resolve) => {
43
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
44
+ rl.question(question, (answer) => { rl.close(); resolve(answer.trim().toLowerCase()); });
45
+ });
46
+ }
47
+
48
+ async function ensureDep(cmd, label, installCmd) {
49
+ if (checkDep(cmd)) return;
50
+ console.log(`\n${label} is not installed.`);
51
+ const answer = await prompt(`Install it now? (y/n) `);
52
+ if (answer !== 'y' && answer !== 'yes') {
53
+ console.log(`Skipping. Run manually: ${installCmd}`);
54
+ process.exit(1);
55
+ }
56
+ console.log(`Running: ${installCmd}\n`);
57
+ try {
58
+ execSync(installCmd, { stdio: 'inherit' });
59
+ console.log(`\n${label} installed successfully.\n`);
60
+ } catch {
61
+ console.error(`\nInstall failed. Try running manually: ${installCmd}`);
62
+ process.exit(1);
63
+ }
64
+ }
65
+
66
+ async function main() {
67
+ await ensureDep('tmux', 'tmux', tmuxInstallCmd());
68
+ await ensureDep('claude', 'Claude Code CLI', 'npm install -g @anthropic-ai/claude-code');
69
+
70
+ const child = spawn('bash', [scriptPath], {
71
+ stdio: 'inherit',
72
+ env: process.env,
73
+ });
74
+
75
+ child.on('exit', (code) => {
76
+ process.exit(code || 0);
77
+ });
78
+ }
79
+
14
80
  if (process.argv.includes('--help') || process.argv.includes('-h')) {
15
81
  console.log(`
16
82
  Claude Code Remote Pilot
@@ -33,11 +99,4 @@ Attach to tmux:
33
99
  process.exit(0);
34
100
  }
35
101
 
36
- const child = spawn('bash', [scriptPath], {
37
- stdio: 'inherit',
38
- env: process.env,
39
- });
40
-
41
- child.on('exit', (code) => {
42
- process.exit(code || 0);
43
- });
102
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-remote-pilot",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Interactive Claude Code supervisor with tmux, Telegram notifications, and auto-resume after usage limits.",
5
5
  "type": "commonjs",
6
6
  "bin": {