tacticremote 1.6.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 ADDED
@@ -0,0 +1,55 @@
1
+ # tactic-remote-server
2
+
3
+ Server component for [Tactic Remote](https://tacticremote.com) — control Claude Code from your iPhone or iPad.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ npx tacticremote
9
+ ```
10
+
11
+ That's it. Scan the QR code with the Tactic Remote iOS app to connect.
12
+
13
+ ## Prerequisites
14
+
15
+ - **Node.js** 16+
16
+ - **tmux** — install with `brew install tmux` (macOS) or `sudo apt install tmux` (Linux)
17
+ - **Claude Code CLI** — install from [claude.ai/code](https://claude.ai/code)
18
+
19
+ ## Options
20
+
21
+ ```
22
+ npx tacticremote [options]
23
+
24
+ -p, --port <n> Port to listen on (default: 8765)
25
+ --path <dir> Allowed base directory (default: $HOME)
26
+ --api-key <key> Require authentication key
27
+ --no-bonjour Disable mDNS discovery
28
+ --no-qr Don't show QR code
29
+ -v, --version Show version
30
+ -h, --help Show this help
31
+ ```
32
+
33
+ ## Environment Variables
34
+
35
+ | Variable | Description |
36
+ |----------|-------------|
37
+ | `PORT` | Server port (default: 8765) |
38
+ | `CLAUDE_REMOTE_API_KEY` | Authentication key |
39
+ | `CLAUDE_REMOTE_ALLOWED_PATH` | Base directory for file operations |
40
+
41
+ ## How It Works
42
+
43
+ ```
44
+ iPhone (Tactic Remote app) <-- WebSocket --> This server <-- tmux --> Claude Code CLI
45
+ ```
46
+
47
+ The server manages tmux sessions running Claude Code and bridges them to the iOS app over WebSocket. All data stays on your local network.
48
+
49
+ ## iOS App
50
+
51
+ Download Tactic Remote from the [App Store](https://apps.apple.com/app/tactic-remote/id6743597533).
52
+
53
+ ## License
54
+
55
+ MIT
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ const os = require('os');
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+ const https = require('https');
9
+ const http = require('http');
10
+ const zlib = require('zlib');
11
+ const { spawn } = require('child_process');
12
+
13
+ const VERSION = require('../package.json').version;
14
+ const REPO = 'TacticSpaceTech/TacticRemote';
15
+ const CACHE_DIR = path.join(os.homedir(), '.tacticremote', 'bin');
16
+
17
+ function getPlatformKey() {
18
+ const platform = process.platform; // darwin, linux
19
+ const arch = process.arch; // arm64, x64
20
+ if (platform !== 'darwin' && platform !== 'linux') {
21
+ console.error(` Unsupported platform: ${platform}`);
22
+ console.error(' Supported: macOS (darwin), Linux');
23
+ process.exit(1);
24
+ }
25
+ if (arch !== 'arm64' && arch !== 'x64') {
26
+ console.error(` Unsupported architecture: ${arch}`);
27
+ console.error(' Supported: arm64, x64');
28
+ process.exit(1);
29
+ }
30
+ return `${platform}-${arch}`;
31
+ }
32
+
33
+ function getBinaryName() {
34
+ return `tacticremote-${getPlatformKey()}`;
35
+ }
36
+
37
+ function getBinaryPath() {
38
+ return path.join(CACHE_DIR, `${getBinaryName()}-${VERSION}`);
39
+ }
40
+
41
+ function download(url) {
42
+ return new Promise((resolve, reject) => {
43
+ const client = url.startsWith('https') ? https : http;
44
+ client.get(url, { headers: { 'User-Agent': `tacticremote/${VERSION}` } }, (res) => {
45
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
46
+ download(res.headers.location).then(resolve).catch(reject);
47
+ return;
48
+ }
49
+ if (res.statusCode !== 200) {
50
+ reject(new Error(`Download failed: HTTP ${res.statusCode}`));
51
+ return;
52
+ }
53
+ const chunks = [];
54
+ res.on('data', (chunk) => chunks.push(chunk));
55
+ res.on('end', () => resolve(Buffer.concat(chunks)));
56
+ res.on('error', reject);
57
+ }).on('error', reject);
58
+ });
59
+ }
60
+
61
+ async function ensureBinary() {
62
+ const binaryPath = getBinaryPath();
63
+
64
+ if (fs.existsSync(binaryPath)) {
65
+ return binaryPath;
66
+ }
67
+
68
+ const binaryName = getBinaryName();
69
+ const url = `https://github.com/${REPO}/releases/download/cli-v${VERSION}/${binaryName}.gz`;
70
+
71
+ console.log('');
72
+ console.log(` Downloading tacticremote v${VERSION} for ${getPlatformKey()}...`);
73
+ console.log(` ${url}`);
74
+ console.log('');
75
+
76
+ try {
77
+ const gzData = await download(url);
78
+ const binary = zlib.gunzipSync(gzData);
79
+
80
+ fs.mkdirSync(CACHE_DIR, { recursive: true });
81
+ fs.writeFileSync(binaryPath, binary, { mode: 0o755 });
82
+
83
+ console.log(` Cached at ${binaryPath}`);
84
+ console.log('');
85
+
86
+ return binaryPath;
87
+ } catch (err) {
88
+ console.error(` Failed to download binary: ${err.message}`);
89
+ console.error('');
90
+ console.error(' You can download manually from:');
91
+ console.error(` https://github.com/${REPO}/releases`);
92
+ console.error('');
93
+ process.exit(1);
94
+ }
95
+ }
96
+
97
+ async function main() {
98
+ // Pass-through flags that don't need the binary
99
+ const args = process.argv.slice(2);
100
+ if (args.includes('--version') || args.includes('-v')) {
101
+ console.log(VERSION);
102
+ process.exit(0);
103
+ }
104
+
105
+ const binaryPath = await ensureBinary();
106
+
107
+ const child = spawn(binaryPath, args, {
108
+ stdio: 'inherit',
109
+ env: process.env
110
+ });
111
+
112
+ child.on('exit', (code) => process.exit(code || 0));
113
+ child.on('error', (err) => {
114
+ console.error(` Failed to execute binary: ${err.message}`);
115
+ process.exit(1);
116
+ });
117
+
118
+ // Forward signals
119
+ for (const sig of ['SIGINT', 'SIGTERM']) {
120
+ process.on(sig, () => child.kill(sig));
121
+ }
122
+ }
123
+
124
+ main();
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "tacticremote",
3
+ "version": "1.6.0",
4
+ "description": "Control Claude Code from your iPhone/iPad — Tactic Remote server",
5
+ "bin": {
6
+ "tacticremote": "./bin/tacticremote.js"
7
+ },
8
+ "files": [
9
+ "bin/tacticremote.js"
10
+ ],
11
+ "engines": {
12
+ "node": ">=16.0.0"
13
+ },
14
+ "keywords": [
15
+ "claude-code",
16
+ "claude",
17
+ "remote",
18
+ "terminal",
19
+ "tmux",
20
+ "ios",
21
+ "tactic-remote",
22
+ "websocket",
23
+ "mobile"
24
+ ],
25
+ "author": "TacticSpace Tech <support@tacticremote.com>",
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/TacticSpaceTech/TacticRemote"
30
+ },
31
+ "homepage": "https://tacticremote.com",
32
+ "bugs": {
33
+ "url": "https://github.com/TacticSpaceTech/TacticRemote/issues"
34
+ }
35
+ }