sessioncast-cli 1.1.0 → 1.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sessioncast-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "SessionCast CLI - Control your agents from anywhere",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -10,7 +10,8 @@
10
10
  "build": "tsc",
11
11
  "dev": "ts-node src/index.ts",
12
12
  "start": "node dist/index.js",
13
- "prepublishOnly": "npm run build"
13
+ "prepublishOnly": "npm run build",
14
+ "postinstall": "node scripts/postinstall.js || true"
14
15
  },
15
16
  "keywords": [
16
17
  "sessioncast",
@@ -23,7 +24,8 @@
23
24
  "license": "MIT",
24
25
  "type": "commonjs",
25
26
  "files": [
26
- "dist"
27
+ "dist",
28
+ "scripts"
27
29
  ],
28
30
  "dependencies": {
29
31
  "chalk": "^4.1.2",
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const os = require('os');
5
+
6
+ const GREEN = '\x1b[32m';
7
+ const YELLOW = '\x1b[33m';
8
+ const CYAN = '\x1b[36m';
9
+ const RESET = '\x1b[0m';
10
+ const BOLD = '\x1b[1m';
11
+ const DIM = '\x1b[2m';
12
+
13
+ function checkTmux() {
14
+ try {
15
+ execSync('which tmux', { stdio: 'pipe' });
16
+ return true;
17
+ } catch {
18
+ return false;
19
+ }
20
+ }
21
+
22
+ function checkItmux() {
23
+ const possiblePaths = [
24
+ process.env.ITMUX_HOME,
25
+ `${os.homedir()}/itmux`,
26
+ 'C:\\itmux',
27
+ `${os.homedir()}\\itmux`,
28
+ 'C:\\Program Files\\itmux',
29
+ ].filter(Boolean);
30
+
31
+ for (const path of possiblePaths) {
32
+ try {
33
+ require('fs').accessSync(path);
34
+ return true;
35
+ } catch {
36
+ continue;
37
+ }
38
+ }
39
+ return false;
40
+ }
41
+
42
+ function main() {
43
+ const isWindows = os.platform() === 'win32';
44
+ const isMac = os.platform() === 'darwin';
45
+
46
+ console.log('');
47
+ console.log(`${GREEN}${BOLD}✓ SessionCast CLI installed${RESET}`);
48
+ console.log('');
49
+
50
+ // Check tmux/itmux
51
+ const hasTmux = isWindows ? checkItmux() : checkTmux();
52
+
53
+ if (!hasTmux) {
54
+ console.log(`${YELLOW}⚠ tmux not found${RESET}`);
55
+ if (isWindows) {
56
+ console.log(` Install itmux: ${CYAN}https://github.com/phayte/itmux${RESET}`);
57
+ console.log(` Or: ${DIM}choco install itmux${RESET}`);
58
+ } else if (isMac) {
59
+ console.log(` Install: ${DIM}brew install tmux${RESET}`);
60
+ } else {
61
+ console.log(` Install: ${DIM}sudo apt install tmux${RESET} or ${DIM}sudo yum install tmux${RESET}`);
62
+ }
63
+ console.log('');
64
+ }
65
+
66
+ // Quick start guide
67
+ console.log(`${BOLD}Quick Start:${RESET}`);
68
+ console.log(` ${CYAN}sessioncast login${RESET} ${DIM}# Login via browser${RESET}`);
69
+ console.log(` ${CYAN}sessioncast agent${RESET} ${DIM}# Start streaming${RESET}`);
70
+ console.log('');
71
+ console.log(`${DIM}Web Console: https://app.sessioncast.io${RESET}`);
72
+ console.log('');
73
+ }
74
+
75
+ main();