remote-term 0.1.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 +33 -0
- package/bin/remote-term +3 -0
- package/bin/remote-term.cmd +2 -0
- package/install.js +87 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# remote-term
|
|
2
|
+
|
|
3
|
+
Remote terminal access via **Telegram** or **browser WebUI**. Full PTY support for interactive programs like Claude Code, Python REPL, vim, and more.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g remote-term
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Telegram bot mode
|
|
15
|
+
remote-term
|
|
16
|
+
|
|
17
|
+
# WebUI mode (browser-based terminal)
|
|
18
|
+
remote-term --web 8080
|
|
19
|
+
|
|
20
|
+
# Check version
|
|
21
|
+
remote-term --version
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Supported Platforms
|
|
25
|
+
|
|
26
|
+
- Linux x64
|
|
27
|
+
- macOS x64 (Intel)
|
|
28
|
+
- macOS arm64 (Apple Silicon)
|
|
29
|
+
- Windows x64
|
|
30
|
+
|
|
31
|
+
## Documentation
|
|
32
|
+
|
|
33
|
+
See the full docs at [GitHub](https://github.com/jazztong/remote-terminal).
|
package/bin/remote-term
ADDED
package/install.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const https = require("https");
|
|
4
|
+
const http = require("http");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
|
|
8
|
+
const VERSION = require("./package.json").version;
|
|
9
|
+
const REPO = "jazztong/remote-terminal";
|
|
10
|
+
|
|
11
|
+
const PLATFORM_MAP = {
|
|
12
|
+
"linux-x64": "remote-term-linux-amd64",
|
|
13
|
+
"darwin-x64": "remote-term-darwin-amd64",
|
|
14
|
+
"darwin-arm64": "remote-term-darwin-arm64",
|
|
15
|
+
"win32-x64": "remote-term-windows-amd64.exe",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function getBinaryName() {
|
|
19
|
+
const key = `${process.platform}-${process.arch}`;
|
|
20
|
+
const name = PLATFORM_MAP[key];
|
|
21
|
+
if (!name) {
|
|
22
|
+
console.error(
|
|
23
|
+
`Unsupported platform: ${key}\n` +
|
|
24
|
+
`Supported: ${Object.keys(PLATFORM_MAP).join(", ")}\n` +
|
|
25
|
+
`Please build from source: https://github.com/${REPO}`
|
|
26
|
+
);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
return name;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getDownloadUrl(binaryName) {
|
|
33
|
+
return `https://github.com/${REPO}/releases/download/v${VERSION}/${binaryName}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function download(url) {
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
const get = url.startsWith("https") ? https.get : http.get;
|
|
39
|
+
get(url, (res) => {
|
|
40
|
+
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
41
|
+
download(res.headers.location).then(resolve).catch(reject);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (res.statusCode !== 200) {
|
|
46
|
+
reject(new Error(`Download failed: HTTP ${res.statusCode} from ${url}`));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const chunks = [];
|
|
51
|
+
res.on("data", (chunk) => chunks.push(chunk));
|
|
52
|
+
res.on("end", () => resolve(Buffer.concat(chunks)));
|
|
53
|
+
res.on("error", reject);
|
|
54
|
+
}).on("error", reject);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function main() {
|
|
59
|
+
const binaryName = getBinaryName();
|
|
60
|
+
const url = getDownloadUrl(binaryName);
|
|
61
|
+
const binDir = path.join(__dirname, "bin");
|
|
62
|
+
const isWindows = process.platform === "win32";
|
|
63
|
+
const outputName = isWindows ? "remote-term.exe" : "remote-term";
|
|
64
|
+
const outputPath = path.join(binDir, outputName);
|
|
65
|
+
|
|
66
|
+
console.log(`Downloading remote-term v${VERSION} for ${process.platform}-${process.arch}...`);
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
const data = await download(url);
|
|
70
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
71
|
+
fs.writeFileSync(outputPath, data);
|
|
72
|
+
|
|
73
|
+
if (!isWindows) {
|
|
74
|
+
fs.chmodSync(outputPath, 0o755);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
console.log(`Installed remote-term v${VERSION} to ${outputPath}`);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
console.error(`Failed to download remote-term: ${err.message}`);
|
|
80
|
+
console.error(`\nManual install:`);
|
|
81
|
+
console.error(` Download: ${url}`);
|
|
82
|
+
console.error(` Place in: ${binDir}`);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "remote-term",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Remote terminal access via Telegram or browser WebUI. Full PTY support for interactive programs like Claude Code, Python REPL, vim.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/jazztong/remote-terminal.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/jazztong/remote-terminal#readme",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"terminal",
|
|
13
|
+
"remote",
|
|
14
|
+
"telegram",
|
|
15
|
+
"webui",
|
|
16
|
+
"pty",
|
|
17
|
+
"shell",
|
|
18
|
+
"claude"
|
|
19
|
+
],
|
|
20
|
+
"bin": {
|
|
21
|
+
"remote-term": "bin/remote-term"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"postinstall": "node install.js"
|
|
25
|
+
},
|
|
26
|
+
"os": [
|
|
27
|
+
"linux",
|
|
28
|
+
"darwin",
|
|
29
|
+
"win32"
|
|
30
|
+
],
|
|
31
|
+
"cpu": [
|
|
32
|
+
"x64",
|
|
33
|
+
"arm64"
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"bin/",
|
|
37
|
+
"install.js",
|
|
38
|
+
"README.md"
|
|
39
|
+
]
|
|
40
|
+
}
|