@higgsfield/cli 0.1.16 → 0.1.20

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.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @higgsfield/cli
2
+
3
+ Higgsfield AI CLI — generate images and videos from the terminal.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @higgsfield/cli
9
+ ```
10
+
11
+ Postinstall fetches the prebuilt `hf` binary for your platform from the [GitHub release](https://github.com/higgsfield-ai/cli/releases).
12
+
13
+ Supported platforms: macOS, Linux, Windows (x64, arm64).
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ higgsfield auth login
19
+ higgsfield generate create text2image_soul_v2 --prompt "a cat in a spaceship"
20
+ higgsfield --help
21
+ ```
22
+
23
+ Aliases: `higgsfield`, `higgs`.
24
+
25
+ ## Links
26
+
27
+ - Source: https://github.com/higgsfield-ai/cli-src
28
+ - Releases: https://github.com/higgsfield-ai/cli/releases
29
+ - Higgsfield: https://higgsfield.ai
package/bin/run.js CHANGED
@@ -3,7 +3,8 @@ const path = require("path");
3
3
  const fs = require("fs");
4
4
 
5
5
  module.exports = function run() {
6
- const bin = path.join(__dirname, "..", "vendor", "hf");
6
+ const binName = process.platform === "win32" ? "hf.exe" : "hf";
7
+ const bin = path.join(__dirname, "..", "vendor", binName);
7
8
  if (!fs.existsSync(bin)) {
8
9
  console.error(
9
10
  "@higgsfield/cli: binary not found at " +
package/install.js CHANGED
@@ -7,7 +7,7 @@ const { execFileSync } = require("child_process");
7
7
  const pkg = require("./package.json");
8
8
  const VERSION = pkg.version;
9
9
 
10
- const PLATFORM_MAP = { darwin: "darwin", linux: "linux" };
10
+ const PLATFORM_MAP = { darwin: "darwin", linux: "linux", win32: "windows" };
11
11
  const ARCH_MAP = { x64: "amd64", arm64: "arm64" };
12
12
 
13
13
  const platform = PLATFORM_MAP[process.platform];
@@ -17,10 +17,11 @@ if (!platform || !arch) {
17
17
  console.error(
18
18
  `@higgsfield/cli: unsupported platform ${process.platform}/${process.arch}`
19
19
  );
20
- console.error("Supported: darwin|linux × x64|arm64");
20
+ console.error("Supported: darwin|linux|windows × x64|arm64");
21
21
  process.exit(1);
22
22
  }
23
23
 
24
+ const binName = platform === "windows" ? "hf.exe" : "hf";
24
25
  const tarball = `hf_${VERSION}_${platform}_${arch}.tar.gz`;
25
26
  const url = `https://github.com/higgsfield-ai/cli/releases/download/v${VERSION}/${tarball}`;
26
27
 
@@ -65,8 +66,10 @@ function download(targetUrl, dest, redirects = 0) {
65
66
  (async () => {
66
67
  console.log(`@higgsfield/cli: downloading ${url}`);
67
68
  await download(url, tarballPath);
68
- execFileSync("tar", ["-xzf", tarballPath, "-C", vendorDir, "hf"]);
69
- fs.chmodSync(path.join(vendorDir, "hf"), 0o755);
69
+ execFileSync("tar", ["-xzf", tarballPath, "-C", vendorDir, binName]);
70
+ if (platform !== "windows") {
71
+ fs.chmodSync(path.join(vendorDir, binName), 0o755);
72
+ }
70
73
  fs.unlinkSync(tarballPath);
71
74
  console.log("@higgsfield/cli: installed");
72
75
  })().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@higgsfield/cli",
3
- "version": "0.1.16",
3
+ "version": "0.1.20",
4
4
  "description": "Higgsfield AI CLI — generate images and videos from the terminal.",
5
5
  "bin": {
6
6
  "higgsfield": "bin/higgsfield.js",
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "files": [
13
13
  "bin/",
14
- "install.js"
14
+ "install.js",
15
+ "README.md"
15
16
  ],
16
17
  "engines": {
17
18
  "node": ">=14"
@@ -24,7 +25,8 @@
24
25
  },
25
26
  "os": [
26
27
  "darwin",
27
- "linux"
28
+ "linux",
29
+ "win32"
28
30
  ],
29
31
  "cpu": [
30
32
  "x64",