@koi-cli/koi-cli 1.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.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/package.json +25 -0
  3. package/shim.js +39 -0
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # @koi-cli/koi-cli
2
+
3
+ Install:
4
+ ```
5
+ npm install -g @koi-cli/koi-cli
6
+ ```
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@koi-cli/koi-cli",
3
+ "version": "1.0.0",
4
+ "description": "koi-cli — interactive terminal assistant built on the Koi agent language",
5
+ "bin": {
6
+ "koi": "./shim.js"
7
+ },
8
+ "optionalDependencies": {
9
+ "@koi-cli/koi-cli-darwin-arm64": "1.0.0",
10
+ "@koi-cli/koi-cli-darwin-x64": "1.0.0",
11
+ "@koi-cli/koi-cli-linux-x64": "1.0.0",
12
+ "@koi-cli/koi-cli-win32-x64": "1.0.0"
13
+ },
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
17
+ "license": "MIT",
18
+ "keywords": [
19
+ "koi",
20
+ "cli",
21
+ "agent",
22
+ "assistant",
23
+ "llm"
24
+ ]
25
+ }
package/shim.js ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * shim.js — Entry point for the @koi-language/koi-cli npm package.
4
+ *
5
+ * Detects the current platform/arch and delegates to the matching
6
+ * optional platform package (@koi-language/koi-cli-darwin-arm64, etc.)
7
+ * which ships the actual pre-built binary.
8
+ *
9
+ * Installed via: npm install -g @koi-language/koi-cli
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ const { execFileSync } = require('child_process');
15
+ const path = require('path');
16
+
17
+ const platform = process.platform; // darwin | linux | win32
18
+ const arch = process.arch; // arm64 | x64
19
+
20
+ const pkgName = `@koi-language/koi-cli-${platform}-${arch}`;
21
+
22
+ let pkgDir;
23
+ try {
24
+ pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
25
+ } catch {
26
+ console.error(`\x1b[31mError:\x1b[0m koi-cli is not supported on ${platform}/${arch}.`);
27
+ console.error(` Expected optional package: ${pkgName}`);
28
+ console.error(` Try reinstalling: npm install -g @koi-language/koi-cli`);
29
+ process.exit(1);
30
+ }
31
+
32
+ const binName = platform === 'win32' ? 'koi.exe' : 'koi';
33
+ const binPath = path.join(pkgDir, binName);
34
+
35
+ try {
36
+ execFileSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
37
+ } catch (err) {
38
+ process.exit(err.status ?? 1);
39
+ }