@terminal-code/cli 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 +36 -0
- package/bin/install-binary.js +24 -0
- package/bin/terminal-code.js +52 -0
- package/binaries/terminal-code-linux-x86_64 +0 -0
- package/binaries/terminal-code-macos-arm64 +0 -0
- package/binaries/terminal-code-macos-x86_64 +0 -0
- package/binaries/terminal-code-windows-x86_64.exe +0 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Terminal Code
|
|
2
|
+
|
|
3
|
+
Single binary distribution for CloudIDE Pro - like `claude-code` but for terminal IDEs.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @your-org/terminal-code
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Start with auto-detection
|
|
15
|
+
terminal-code
|
|
16
|
+
|
|
17
|
+
# Use custom config
|
|
18
|
+
terminal-code --config config/dev.yaml
|
|
19
|
+
|
|
20
|
+
# Show help
|
|
21
|
+
terminal-code --help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- ✅ Single binary (no complex setup)
|
|
27
|
+
- ✅ Bundled Python backend
|
|
28
|
+
- ✅ VS Code server integration
|
|
29
|
+
- ✅ Cross-platform (Linux, macOS, Windows)
|
|
30
|
+
- ✅ Auto-detects project structure
|
|
31
|
+
- ✅ Supports ngrok tunneling and direct domains
|
|
32
|
+
|
|
33
|
+
## Requirements
|
|
34
|
+
|
|
35
|
+
- Caddy web server (auto-installs on some systems)
|
|
36
|
+
- Optional: ngrok for tunneling
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const https = require('https');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
console.log('📦 Setting up Terminal Code binary...');
|
|
8
|
+
|
|
9
|
+
// Make binary executable on Unix systems
|
|
10
|
+
if (process.platform !== 'win32') {
|
|
11
|
+
const binaryPath = path.join(__dirname, 'terminal-code.js');
|
|
12
|
+
try {
|
|
13
|
+
fs.chmodSync(binaryPath, '755');
|
|
14
|
+
console.log('✅ Binary permissions set');
|
|
15
|
+
} catch (err) {
|
|
16
|
+
console.warn('⚠️ Could not set binary permissions:', err.message);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
console.log('✅ Terminal Code setup complete!');
|
|
21
|
+
console.log('');
|
|
22
|
+
console.log('Usage:');
|
|
23
|
+
console.log(' npx terminal-code --help');
|
|
24
|
+
console.log(' npx terminal-code --config my.yaml');
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn } = require('child_process');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
// Determine platform and architecture
|
|
7
|
+
const platform = process.platform;
|
|
8
|
+
const arch = process.arch;
|
|
9
|
+
|
|
10
|
+
let binaryName = 'terminal-code';
|
|
11
|
+
let platformName, archName;
|
|
12
|
+
|
|
13
|
+
switch (platform) {
|
|
14
|
+
case 'linux':
|
|
15
|
+
platformName = 'linux';
|
|
16
|
+
break;
|
|
17
|
+
case 'darwin':
|
|
18
|
+
platformName = 'macos';
|
|
19
|
+
break;
|
|
20
|
+
case 'win32':
|
|
21
|
+
platformName = 'windows';
|
|
22
|
+
binaryName += '.exe';
|
|
23
|
+
break;
|
|
24
|
+
default:
|
|
25
|
+
console.error(`❌ Unsupported platform: ${platform}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
switch (arch) {
|
|
30
|
+
case 'x64':
|
|
31
|
+
archName = 'x86_64';
|
|
32
|
+
break;
|
|
33
|
+
case 'arm64':
|
|
34
|
+
archName = 'arm64';
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
console.error(`❌ Unsupported architecture: ${arch}`);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const binaryFileName = `terminal-code-${platformName}-${archName}${platformName === 'windows' ? '.exe' : ''}`;
|
|
42
|
+
const binaryPath = path.join(__dirname, '..', 'binaries', binaryFileName);
|
|
43
|
+
|
|
44
|
+
// Spawn the binary with all arguments
|
|
45
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
cwd: process.cwd()
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
child.on('exit', (code) => {
|
|
51
|
+
process.exit(code || 0);
|
|
52
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@terminal-code/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Single binary distribution for CloudIDE Pro - like claude-code but for terminal IDEs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ide",
|
|
7
|
+
"vscode",
|
|
8
|
+
"development",
|
|
9
|
+
"terminal",
|
|
10
|
+
"cloud",
|
|
11
|
+
"binary"
|
|
12
|
+
],
|
|
13
|
+
"author": "Shubham Gupta <gshubham55@gmail.com>",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://www.npmjs.com/package/@terminal-code/cli",
|
|
16
|
+
"bin": {
|
|
17
|
+
"terminal-code": "./bin/terminal-code.js"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18.0.0"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin/",
|
|
24
|
+
"binaries/",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"postinstall": "node bin/install-binary.js"
|
|
29
|
+
},
|
|
30
|
+
"os": [
|
|
31
|
+
"linux",
|
|
32
|
+
"darwin",
|
|
33
|
+
"win32"
|
|
34
|
+
],
|
|
35
|
+
"preferGlobal": true
|
|
36
|
+
}
|