@chill-institute/cli 0.0.0-bootstrap

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 +8 -0
  2. package/bin/chilly.js +47 -0
  3. package/package.json +36 -0
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # @chill-institute/cli
2
+
3
+ npm distribution for the `chilly` command-line client.
4
+
5
+ ```sh
6
+ npm install -g @chill-institute/cli
7
+ chilly version
8
+ ```
package/bin/chilly.js ADDED
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawn } = require("node:child_process");
5
+ const { dirname, join } = require("node:path");
6
+
7
+ const targets = {
8
+ "darwin arm64": { packageName: "@chill-institute/cli-darwin-arm64", binaryName: "chilly" },
9
+ "darwin x64": { packageName: "@chill-institute/cli-darwin-x64", binaryName: "chilly" },
10
+ "linux arm64": { packageName: "@chill-institute/cli-linux-arm64", binaryName: "chilly" },
11
+ "linux x64": { packageName: "@chill-institute/cli-linux-x64", binaryName: "chilly" },
12
+ "win32 arm64": { packageName: "@chill-institute/cli-win32-arm64", binaryName: "chilly.exe" },
13
+ "win32 x64": { packageName: "@chill-institute/cli-win32-x64", binaryName: "chilly.exe" }
14
+ };
15
+
16
+ const targetKey = process.platform + " " + process.arch;
17
+ const target = targets[targetKey];
18
+ if (!target) {
19
+ console.error("chilly is not available for " + process.platform + "-" + process.arch);
20
+ process.exit(1);
21
+ }
22
+
23
+ let packageRoot;
24
+ try {
25
+ packageRoot = dirname(require.resolve(target.packageName + "/package.json"));
26
+ } catch (error) {
27
+ console.error("Missing optional dependency " + target.packageName + "; reinstall @chill-institute/cli with optional dependencies enabled.");
28
+ process.exit(1);
29
+ }
30
+
31
+ const child = spawn(join(packageRoot, "bin", target.binaryName), process.argv.slice(2), {
32
+ stdio: "inherit",
33
+ windowsHide: false
34
+ });
35
+
36
+ child.on("error", (error) => {
37
+ console.error("Failed to start chilly: " + error.message);
38
+ process.exit(1);
39
+ });
40
+
41
+ child.on("exit", (code, signal) => {
42
+ if (signal) {
43
+ process.kill(process.pid, signal);
44
+ return;
45
+ }
46
+ process.exit(code ?? 1);
47
+ });
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@chill-institute/cli",
3
+ "version": "0.0.0-bootstrap",
4
+ "description": "Agent-first command-line client for chill.institute",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/chill-institute/chill-cli.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/chill-institute/chill-cli/issues"
12
+ },
13
+ "homepage": "https://github.com/chill-institute/chill-cli#readme",
14
+ "keywords": [
15
+ "chill.institute",
16
+ "cli",
17
+ "chilly"
18
+ ],
19
+ "bin": {
20
+ "chilly": "bin/chilly.js"
21
+ },
22
+ "files": [
23
+ "bin"
24
+ ],
25
+ "optionalDependencies": {
26
+ "@chill-institute/cli-darwin-arm64": "0.0.0-bootstrap",
27
+ "@chill-institute/cli-darwin-x64": "0.0.0-bootstrap",
28
+ "@chill-institute/cli-linux-arm64": "0.0.0-bootstrap",
29
+ "@chill-institute/cli-linux-x64": "0.0.0-bootstrap",
30
+ "@chill-institute/cli-win32-arm64": "0.0.0-bootstrap",
31
+ "@chill-institute/cli-win32-x64": "0.0.0-bootstrap"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
36
+ }