@branchmore/cli 0.0.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.
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { execFileSync } = require('child_process');
5
+ const path = require('path');
6
+
7
+ const PLATFORMS = {
8
+ 'darwin-arm64': '@branchmore/cli-darwin-arm64',
9
+ 'darwin-x64': '@branchmore/cli-darwin-x64',
10
+ 'linux-arm64': '@branchmore/cli-linux-arm64',
11
+ 'linux-x64': '@branchmore/cli-linux-x64',
12
+ 'win32-x64': '@branchmore/cli-win32-x64',
13
+ };
14
+
15
+ const key = `${process.platform}-${process.arch}`;
16
+ const pkgName = PLATFORMS[key];
17
+
18
+ if (!pkgName) {
19
+ console.error(`vibe-collector: unsupported platform: ${key}`);
20
+ process.exit(1);
21
+ }
22
+
23
+ let pkgJsonPath;
24
+ try {
25
+ pkgJsonPath = require.resolve(`${pkgName}/package.json`);
26
+ } catch {
27
+ console.error(`vibe-collector: platform package ${pkgName} is not installed`);
28
+ process.exit(1);
29
+ }
30
+
31
+ const binary = path.join(
32
+ path.dirname(pkgJsonPath),
33
+ 'bin',
34
+ process.platform === 'win32' ? 'vibe-collector.exe' : 'vibe-collector'
35
+ );
36
+
37
+ try {
38
+ execFileSync(binary, process.argv.slice(2), { stdio: 'inherit' });
39
+ } catch (e) {
40
+ process.exit(e.status ?? 1);
41
+ }
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@branchmore/cli",
3
+ "version": "0.0.0",
4
+ "description": "AI coding assistant usage collector for Opsmore",
5
+ "bin": {
6
+ "vibe-collector": "bin/vibe-collector.js"
7
+ },
8
+ "optionalDependencies": {
9
+ "@branchmore/cli-darwin-arm64": "0.0.0",
10
+ "@branchmore/cli-darwin-x64": "0.0.0",
11
+ "@branchmore/cli-linux-x64": "0.0.0",
12
+ "@branchmore/cli-linux-arm64": "0.0.0",
13
+ "@branchmore/cli-win32-x64": "0.0.0"
14
+ },
15
+ "engines": {
16
+ "node": ">=14"
17
+ },
18
+ "files": [
19
+ "bin/"
20
+ ],
21
+ "homepage": "https://github.com/branchmore/cli",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/branchmore/cli.git"
25
+ },
26
+ "license": "MIT"
27
+ }