@intellia/hutly-cli 0.0.0 → 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 +37 -0
  2. package/bin/hutly.js +79 -0
  3. package/package.json +25 -3
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @intellia/hutly-cli
2
+
3
+ Command-line interface for the Hutly Platform.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @intellia/hutly-cli
9
+ ```
10
+
11
+ ## Configure
12
+
13
+ ```bash
14
+ export HUTLY_ORG_ID="<your org id>"
15
+ export HUTLY_API_KEY="<your api key>"
16
+ # Optional — defaults to the production endpoint
17
+ export HUTLY_API_ENDPOINT="https://api.intellia.com.au"
18
+ ```
19
+
20
+ ## Use
21
+
22
+ ```bash
23
+ hutly --help
24
+ hutly workflow list
25
+ hutly org create --kind office --name "Sydney Office"
26
+ ```
27
+
28
+ Full reference: <https://docs.hutly.com/cli>.
29
+
30
+ ## Supported platforms
31
+
32
+ - macOS (Apple Silicon and Intel)
33
+ - Linux (x86_64 and arm64)
34
+ - Windows (x86_64)
35
+
36
+ Each platform receives a single bun-compiled native binary. The npm package
37
+ is a thin launcher that dispatches to the matching binary.
package/bin/hutly.js ADDED
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Public-facing launcher for `@intellia/hutly-cli`. Pure platform-detection +
4
+ * `execvp` of the per-platform binary. No business logic.
5
+ *
6
+ * Each per-platform sub-package (e.g. `@intellia/hutly-cli-darwin-arm64`) is
7
+ * listed as an `optionalDependency` of `@intellia/hutly-cli`, so npm only
8
+ * installs the one matching the host's os/cpu. This launcher resolves
9
+ * the installed one and forks it.
10
+ */
11
+
12
+ "use strict";
13
+
14
+ const PLATFORM_MAP = {
15
+ "darwin-arm64": { pkg: "@intellia/hutly-cli-darwin-arm64", binRelative: "bin/hutly" },
16
+ "darwin-x64": { pkg: "@intellia/hutly-cli-darwin-x64", binRelative: "bin/hutly" },
17
+ "linux-arm64": { pkg: "@intellia/hutly-cli-linux-arm64", binRelative: "bin/hutly" },
18
+ "linux-x64": { pkg: "@intellia/hutly-cli-linux-x64", binRelative: "bin/hutly" },
19
+ "win32-x64": { pkg: "@intellia/hutly-cli-win32-x64", binRelative: "bin/hutly.exe" },
20
+ };
21
+
22
+ function resolveBinaryFor(host) {
23
+ const key = `${host.platform}-${host.arch}`;
24
+ const entry = PLATFORM_MAP[key];
25
+ if (!entry) {
26
+ const supported = Object.keys(PLATFORM_MAP).join(", ");
27
+ throw new Error(
28
+ `no @intellia/hutly-cli build for ${key}; supported platforms: ${supported}`,
29
+ );
30
+ }
31
+ return entry;
32
+ }
33
+
34
+ module.exports = { resolveBinaryFor, PLATFORM_MAP };
35
+
36
+ // CLI entry — skip when imported by tests.
37
+ if (require.main === module) {
38
+ const { spawnSync } = require("node:child_process");
39
+ const path = require("node:path");
40
+ try {
41
+ const entry = resolveBinaryFor({
42
+ platform: process.platform,
43
+ arch: process.arch,
44
+ });
45
+ // Use require.resolve so we surface a clear error if the optionalDep
46
+ // wasn't installed (e.g. user is on an unsupported platform and npm
47
+ // skipped it silently).
48
+ let binPath;
49
+ try {
50
+ binPath = require.resolve(`${entry.pkg}/${entry.binRelative}`);
51
+ } catch (e) {
52
+ console.error(
53
+ `error: ${entry.pkg} is not installed. If you installed @intellia/hutly-cli ` +
54
+ `with --no-optional or are on an unsupported platform, please ` +
55
+ `re-install without that flag.`,
56
+ );
57
+ process.exit(127);
58
+ }
59
+ const result = spawnSync(binPath, process.argv.slice(2), {
60
+ stdio: "inherit",
61
+ env: process.env,
62
+ });
63
+ if (result.error) {
64
+ console.error(`error: failed to spawn ${binPath}: ${result.error.message}`);
65
+ process.exit(1);
66
+ }
67
+ // A signal-killed child has status === null and signal set. Map it to the
68
+ // Unix 128 + signum convention so a wrapping script's $? sees the abnormal
69
+ // termination instead of a masked exit 0.
70
+ if (result.signal) {
71
+ const signum = require("node:os").constants.signals[result.signal];
72
+ process.exit(128 + (signum ?? 1));
73
+ }
74
+ process.exit(result.status ?? 0);
75
+ } catch (err) {
76
+ console.error(`error: ${err.message}`);
77
+ process.exit(1);
78
+ }
79
+ }
package/package.json CHANGED
@@ -1,7 +1,29 @@
1
1
  {
2
2
  "name": "@intellia/hutly-cli",
3
- "version": "0.0.0",
4
- "description": "Placeholder — the real artifact is published via CI. See https://github.com/NexEvol/intellia-monorepo",
3
+ "version": "1.0.0",
4
+ "description": "Hutly Platform CLI — workflow / agent / KB deployment, secrets, sub-org provisioning",
5
+ "bin": {
6
+ "hutly": "bin/hutly.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "README.md"
11
+ ],
5
12
  "license": "UNLICENSED",
6
- "repository": { "type": "git", "url": "https://github.com/NexEvol/intellia-monorepo.git" }
13
+ "homepage": "https://docs.hutly.com/cli",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/NexEvol/intellia-monorepo.git",
17
+ "directory": "packages/hutly-cli-npm/launcher"
18
+ },
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
22
+ "optionalDependencies": {
23
+ "@intellia/hutly-cli-darwin-arm64": "1.0.0",
24
+ "@intellia/hutly-cli-darwin-x64": "1.0.0",
25
+ "@intellia/hutly-cli-linux-arm64": "1.0.0",
26
+ "@intellia/hutly-cli-linux-x64": "1.0.0",
27
+ "@intellia/hutly-cli-win32-x64": "1.0.0"
28
+ }
7
29
  }