@rivocode-cli/cli 3.0.4 → 3.0.5
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/bin/rivo.cjs +48 -2
- package/package.json +6 -8
- package/bin/postinstall.cjs +0 -64
package/bin/rivo.cjs
CHANGED
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
const os = require('os');
|
|
4
4
|
const { spawnSync } = require('child_process');
|
|
5
5
|
const path = require('path');
|
|
6
|
+
const fs = require('fs');
|
|
6
7
|
|
|
7
8
|
const platform = os.platform();
|
|
8
9
|
const architecture = os.arch();
|
|
9
10
|
|
|
10
11
|
const platformPackage = `@rivocode-cli/cli-${platform}-${architecture}`;
|
|
11
12
|
|
|
13
|
+
const platformNames = { darwin: 'macOS', linux: 'Linux', win32: 'Windows' };
|
|
14
|
+
const archNames = { x64: 'x86_64', arm64: 'ARM64' };
|
|
15
|
+
const platformEmoji = { darwin: '🍎', linux: '🐧', win32: '🪟' };
|
|
16
|
+
|
|
12
17
|
let binaryPath;
|
|
13
18
|
try {
|
|
14
19
|
const packageJsonPath = require.resolve(`${platformPackage}/package.json`);
|
|
@@ -16,11 +21,52 @@ try {
|
|
|
16
21
|
const binaryName = platform === 'win32' ? 'rivo.exe' : 'rivo';
|
|
17
22
|
binaryPath = path.join(packageDir, 'bin', binaryName);
|
|
18
23
|
} catch (error) {
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
const osName = platformNames[platform] || platform;
|
|
25
|
+
const archName = archNames[architecture] || architecture;
|
|
26
|
+
const emoji = platformEmoji[platform] || '💻';
|
|
27
|
+
|
|
28
|
+
console.error('');
|
|
29
|
+
console.error(` ${emoji} Platform: ${osName} (${archName})`);
|
|
30
|
+
console.error(` ❌ No binary found for ${platform}-${architecture}`);
|
|
31
|
+
console.error(` 📦 Missing package: ${platformPackage}`);
|
|
32
|
+
console.error('');
|
|
33
|
+
console.error(' Your platform may not be supported.');
|
|
34
|
+
console.error(' Supported: macOS (x64/ARM64), Linux (x64/ARM64), Windows (x64)');
|
|
35
|
+
console.error('');
|
|
21
36
|
process.exit(1);
|
|
22
37
|
}
|
|
23
38
|
|
|
39
|
+
// Show welcome message on first run
|
|
40
|
+
const markerDir = path.join(os.homedir(), '.rivocode');
|
|
41
|
+
const markerFile = path.join(markerDir, '.first-run-done');
|
|
42
|
+
|
|
43
|
+
if (!fs.existsSync(markerFile)) {
|
|
44
|
+
const osName = platformNames[platform] || platform;
|
|
45
|
+
const archName = archNames[architecture] || architecture;
|
|
46
|
+
const emoji = platformEmoji[platform] || '💻';
|
|
47
|
+
|
|
48
|
+
const G = '\x1b[32m';
|
|
49
|
+
const C = '\x1b[36m';
|
|
50
|
+
const B = '\x1b[1m';
|
|
51
|
+
const D = '\x1b[2m';
|
|
52
|
+
const R = '\x1b[0m';
|
|
53
|
+
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log(`${B}${G} ╔══════════════════════════════════════════╗${R}`);
|
|
56
|
+
console.log(`${B}${G} ║ RivoCode CLI installed! ║${R}`);
|
|
57
|
+
console.log(`${B}${G} ╚══════════════════════════════════════════╝${R}`);
|
|
58
|
+
console.log('');
|
|
59
|
+
console.log(` ${emoji} ${B}Platform:${R} ${osName} (${archName})`);
|
|
60
|
+
console.log(` 📦 ${B}Binary:${R} ${G}✔ ${platformPackage}${R}`);
|
|
61
|
+
console.log(` 📍 ${B}Node:${R} ${process.version}`);
|
|
62
|
+
console.log('');
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
if (!fs.existsSync(markerDir)) fs.mkdirSync(markerDir, { recursive: true });
|
|
66
|
+
fs.writeFileSync(markerFile, new Date().toISOString());
|
|
67
|
+
} catch {}
|
|
68
|
+
}
|
|
69
|
+
|
|
24
70
|
const args = process.argv.slice(2);
|
|
25
71
|
const result = spawnSync(binaryPath, args, { stdio: 'inherit' });
|
|
26
72
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivocode-cli/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "RivoCode — AI-powered terminal coding assistant",
|
|
5
5
|
"author": "Sanket Padhyal <mrsanketpadhyal@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,16 +11,15 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"bin/rivo.cjs",
|
|
14
|
-
"bin/postinstall.cjs",
|
|
15
14
|
"README.md",
|
|
16
15
|
"LICENSE"
|
|
17
16
|
],
|
|
18
17
|
"optionalDependencies": {
|
|
19
|
-
"@rivocode-cli/cli-linux-x64": "3.0.
|
|
20
|
-
"@rivocode-cli/cli-linux-arm64": "3.0.
|
|
21
|
-
"@rivocode-cli/cli-darwin-x64": "3.0.
|
|
22
|
-
"@rivocode-cli/cli-darwin-arm64": "3.0.
|
|
23
|
-
"@rivocode-cli/cli-win32-x64": "3.0.
|
|
18
|
+
"@rivocode-cli/cli-linux-x64": "3.0.5",
|
|
19
|
+
"@rivocode-cli/cli-linux-arm64": "3.0.5",
|
|
20
|
+
"@rivocode-cli/cli-darwin-x64": "3.0.5",
|
|
21
|
+
"@rivocode-cli/cli-darwin-arm64": "3.0.5",
|
|
22
|
+
"@rivocode-cli/cli-win32-x64": "3.0.5"
|
|
24
23
|
},
|
|
25
24
|
"repository": {
|
|
26
25
|
"type": "git",
|
|
@@ -43,7 +42,6 @@
|
|
|
43
42
|
"sdk"
|
|
44
43
|
],
|
|
45
44
|
"scripts": {
|
|
46
|
-
"postinstall": "node bin/postinstall.cjs",
|
|
47
45
|
"rivo": "bun --cwd cli dev",
|
|
48
46
|
"start": "bun run rivo",
|
|
49
47
|
"start-cli": "bun run rivo",
|
package/bin/postinstall.cjs
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const os = require('os');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
const platform = os.platform();
|
|
7
|
-
const arch = os.arch();
|
|
8
|
-
|
|
9
|
-
const platformNames = {
|
|
10
|
-
darwin: 'macOS',
|
|
11
|
-
linux: 'Linux',
|
|
12
|
-
win32: 'Windows',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const archNames = {
|
|
16
|
-
x64: 'x86_64',
|
|
17
|
-
arm64: 'ARM64',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const platformEmoji = {
|
|
21
|
-
darwin: '🍎',
|
|
22
|
-
linux: '🐧',
|
|
23
|
-
win32: '🪟',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const osName = platformNames[platform] || platform;
|
|
27
|
-
const archName = archNames[arch] || arch;
|
|
28
|
-
const emoji = platformEmoji[platform] || '💻';
|
|
29
|
-
|
|
30
|
-
const packageName = `@rivocode-cli/cli-${platform}-${arch}`;
|
|
31
|
-
|
|
32
|
-
let binaryFound = false;
|
|
33
|
-
try {
|
|
34
|
-
require.resolve(`${packageName}/package.json`);
|
|
35
|
-
binaryFound = true;
|
|
36
|
-
} catch {}
|
|
37
|
-
|
|
38
|
-
const RESET = '\x1b[0m';
|
|
39
|
-
const BOLD = '\x1b[1m';
|
|
40
|
-
const GREEN = '\x1b[32m';
|
|
41
|
-
const CYAN = '\x1b[36m';
|
|
42
|
-
const YELLOW = '\x1b[33m';
|
|
43
|
-
const DIM = '\x1b[2m';
|
|
44
|
-
|
|
45
|
-
console.log('');
|
|
46
|
-
console.log(`${BOLD}${GREEN} ╔══════════════════════════════════════════╗${RESET}`);
|
|
47
|
-
console.log(`${BOLD}${GREEN} ║ RivoCode CLI installed! ║${RESET}`);
|
|
48
|
-
console.log(`${BOLD}${GREEN} ╚══════════════════════════════════════════╝${RESET}`);
|
|
49
|
-
console.log('');
|
|
50
|
-
console.log(` ${emoji} ${BOLD}Platform:${RESET} ${osName} (${archName})`);
|
|
51
|
-
console.log(` 📦 ${BOLD}Binary:${RESET} ${binaryFound ? `${GREEN}✔ ${packageName}${RESET}` : `${YELLOW}✘ Not found${RESET}`}`);
|
|
52
|
-
console.log(` 📍 ${BOLD}Node:${RESET} ${process.version}`);
|
|
53
|
-
console.log('');
|
|
54
|
-
|
|
55
|
-
if (binaryFound) {
|
|
56
|
-
console.log(` ${DIM}Get started by running:${RESET}`);
|
|
57
|
-
console.log('');
|
|
58
|
-
console.log(` ${BOLD}${CYAN}$ rivo${RESET}`);
|
|
59
|
-
console.log('');
|
|
60
|
-
} else {
|
|
61
|
-
console.log(` ${YELLOW}⚠ No binary found for ${platform}-${arch}.${RESET}`);
|
|
62
|
-
console.log(` ${YELLOW} Your platform may not be supported.${RESET}`);
|
|
63
|
-
console.log('');
|
|
64
|
-
}
|