nyzhi 0.3.2

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 (2) hide show
  1. package/bin/nyz +48 -0
  2. package/package.json +40 -0
package/bin/nyz ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFileSync } = require("child_process");
4
+ const path = require("path");
5
+ const fs = require("fs");
6
+
7
+ const PLATFORMS = {
8
+ "darwin-arm64": "nyz-darwin-arm64",
9
+ "darwin-x64": "nyz-darwin-x64",
10
+ "linux-x64": "nyz-linux-x64",
11
+ "linux-arm64": "nyz-linux-arm64",
12
+ };
13
+
14
+ function getBinaryPath() {
15
+ const key = `${process.platform}-${process.arch}`;
16
+ const pkg = PLATFORMS[key];
17
+ if (!pkg) {
18
+ console.error(`nyz: unsupported platform ${key}`);
19
+ console.error(`Supported: ${Object.keys(PLATFORMS).join(", ")}`);
20
+ process.exit(1);
21
+ }
22
+
23
+ try {
24
+ const pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
25
+ const bin = path.join(pkgDir, "bin", "nyz");
26
+ if (fs.existsSync(bin)) return bin;
27
+ } catch {}
28
+
29
+ // Fallback: check if nyz is on PATH (installed via another method)
30
+ return "nyz";
31
+ }
32
+
33
+ const bin = getBinaryPath();
34
+ const result = require("child_process").spawnSync(bin, process.argv.slice(2), {
35
+ stdio: "inherit",
36
+ env: process.env,
37
+ });
38
+
39
+ if (result.error) {
40
+ if (result.error.code === "ENOENT") {
41
+ console.error("nyz: binary not found. Try reinstalling: npm install -g nyz");
42
+ } else {
43
+ console.error(`nyz: ${result.error.message}`);
44
+ }
45
+ process.exit(1);
46
+ }
47
+
48
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "nyzhi",
3
+ "version": "0.3.2",
4
+ "description": "AI coding agent for the terminal",
5
+ "license": "GPL-3.0-or-later",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/nyzhi-com/code"
9
+ },
10
+ "homepage": "https://nyzhi.com",
11
+ "keywords": [
12
+ "ai",
13
+ "cli",
14
+ "coding",
15
+ "llm",
16
+ "terminal",
17
+ "agent"
18
+ ],
19
+ "bin": {
20
+ "nyz": "bin/nyz"
21
+ },
22
+ "files": [
23
+ "bin/nyz",
24
+ "README.md"
25
+ ],
26
+ "optionalDependencies": {
27
+ "nyz-darwin-arm64": "0.3.2",
28
+ "nyz-darwin-x64": "0.3.2",
29
+ "nyz-linux-x64": "0.3.2",
30
+ "nyz-linux-arm64": "0.3.2"
31
+ },
32
+ "os": [
33
+ "darwin",
34
+ "linux"
35
+ ],
36
+ "cpu": [
37
+ "x64",
38
+ "arm64"
39
+ ]
40
+ }