@guilloteam/cli 0.0.1

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/bin/guillo.js ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { dirname, join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const __dirname = dirname(fileURLToPath(import.meta.url));
7
+ const binary = join(__dirname, "guillo-bin");
8
+
9
+ const { status } = spawnSync(binary, process.argv.slice(2), {
10
+ stdio: "inherit",
11
+ });
12
+ process.exit(status ?? 1);
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@guilloteam/cli",
3
+ "version": "0.0.1",
4
+ "description": "Headless task management for humans and AI agents",
5
+ "type": "module",
6
+ "bin": {
7
+ "guillo": "./bin/guillo.js"
8
+ },
9
+ "scripts": {
10
+ "postinstall": "node postinstall.js"
11
+ },
12
+ "engines": {
13
+ "node": ">=18"
14
+ },
15
+ "keywords": [
16
+ "task-management",
17
+ "cli",
18
+ "ai-agents"
19
+ ],
20
+ "license": "MIT"
21
+ }
package/postinstall.js ADDED
@@ -0,0 +1,46 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { chmod } from "node:fs/promises";
3
+ import { createRequire } from "node:module";
4
+ import { dirname, join } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const require = createRequire(import.meta.url);
9
+ const { version } = require("./package.json");
10
+
11
+ const REPO = "kwybro/guilloteam";
12
+
13
+ const ARTIFACTS = {
14
+ darwin: { arm64: "guillo-darwin-arm64", x64: "guillo-darwin-x64" },
15
+ linux: { arm64: "guillo-linux-arm64", x64: "guillo-linux-x64" },
16
+ };
17
+
18
+ const artifact = ARTIFACTS[process.platform]?.[process.arch];
19
+ if (!artifact) {
20
+ console.error(
21
+ `guillo: unsupported platform ${process.platform}/${process.arch}`,
22
+ );
23
+ process.exit(1);
24
+ }
25
+
26
+ const url = `https://github.com/${REPO}/releases/download/v${version}/${artifact}`;
27
+ const dest = join(__dirname, "bin", "guillo-bin");
28
+
29
+ mkdirSync(join(__dirname, "bin"), { recursive: true });
30
+
31
+ console.log(
32
+ `Downloading guillo v${version} for ${process.platform}/${process.arch}...`,
33
+ );
34
+
35
+ const response = await fetch(url);
36
+ if (!response.ok) {
37
+ console.error(
38
+ `guillo: download failed — HTTP ${response.status} from ${url}`,
39
+ );
40
+ process.exit(1);
41
+ }
42
+
43
+ writeFileSync(dest, Buffer.from(await response.arrayBuffer()));
44
+ await chmod(dest, 0o755);
45
+
46
+ console.log("guillo installed successfully");