@hlix/cli 0.7.1 → 0.7.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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ var s="@hlix/cli",e="0.7.2",n="SEE LICENSE IN LICENSE",a="Hlix Code and the hlix control-plane CLI.",r=["hlix","cli","agents"],l="https://hlix.ai",c="module",p="./dist/index.js",o={hlix:"./bin/hlix"},b=["bin","install.cjs","dist","skills","LICENSE","THIRD_PARTY_NOTICES"],u={node:">=22.19.0"},d={access:"public"},h={build:"rm -rf dist && bun build src/index.ts --outdir dist --target node --format esm --splitting --packages external --minify --banner '#!/usr/bin/env node'",test:'bun test src --path-ignore-patterns "**/*.integration.test.ts" --timeout 20000',typecheck:"tsc --noEmit",prepublishOnly:"bun run typecheck && bun run build && bun run test","test:integration":"NODE_ENV=test bun run ../../apps/backend/scripts/with-aimock.ts -- bun run ../../apps/backend/scripts/with-test-db.ts -- bun test --isolate --preload ../../apps/backend/test/helpers/pool-lifecycle.ts --timeout 60000 .integration.test.ts","build:binary":"bun run scripts/build-binary.ts","test:binary":"bun run build:binary && HLIX_TEST_BINARY=dist-native/hlix bun test src/binary.test.ts --timeout 60000 && bun run scripts/smoke-binary.ts","test:integration:binary":"bun run build:binary && HLIX_TEST_BINARY=dist-native/hlix NODE_ENV=test bun run ../../apps/backend/scripts/with-aimock.ts -- bun run ../../apps/backend/scripts/with-test-db.ts -- bun test --isolate --preload ../../apps/backend/test/helpers/pool-lifecycle.ts --timeout 60000 src/sync.integration.test.ts src/auth.integration.test.ts",postinstall:"node install.cjs"},m={"@earendil-works/pi-tui":"0.85.1","@mastra/acp":"^0.4.1","@mastra/core":"1.71.0","@mastra/docker":"^0.9.0","@mastra/libsql":"1.23.0","@mastra/mcp":"2.1.0","@mastra/memory":"1.30.0",ignore:"7.0.8","jsonc-parser":"3.3.1","openapi-fetch":"^0.17.0","smol-toml":"1.8.0",yaml:"2.9.0",zod:"4.5.4"},x={"@hlix/sdk":"^0.3.0","@hlix/shared":"*","@types/bun":"latest",typescript:"^7.0.2"},y={"@hlix/cli-darwin-arm64":"0.7.2","@hlix/cli-darwin-x64":"0.7.2","@hlix/cli-linux-x64":"0.7.2","@hlix/cli-linux-arm64":"0.7.2"},k={name:s,version:e,license:n,description:a,keywords:r,homepage:l,type:c,main:p,bin:o,files:b,engines:u,publishConfig:d,scripts:h,dependencies:m,devDependencies:x,optionalDependencies:y};export{o as bin,k as default,m as dependencies,a as description,x as devDependencies,u as engines,b as files,l as homepage,r as keywords,n as license,p as main,s as name,y as optionalDependencies,d as publishConfig,h as scripts,c as type,e as version};
package/install.cjs ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+ // @hlix/cli's postinstall: put the standalone hlix binary where `hlix` points.
3
+ //
4
+ // npm installs exactly one of the optional @hlix/cli-<platform> packages (their
5
+ // os/cpu/libc fields choose it). This links or copies its binary over
6
+ // bin/hlix, so the command runs the binary directly with no Node process in
7
+ // between. Without that package (--omit=optional, an unsupported platform) or
8
+ // without this script (--ignore-scripts, pnpm), bin/hlix stays the small Node
9
+ // wrapper, which finds the binary itself or runs the Node build.
10
+ //
11
+ // bin/hlix loads this file for `nativeBinary`, so the platform rules live once.
12
+ "use strict"
13
+ const { execFileSync } = require("node:child_process")
14
+ const { copyFileSync, existsSync, linkSync, renameSync, rmSync } = require("node:fs")
15
+ const { dirname, join } = require("node:path")
16
+
17
+ const PLATFORMS = ["darwin-arm64", "darwin-x64", "linux-x64", "linux-arm64"]
18
+
19
+ /** The platform package's binary, or the reason there is none. */
20
+ function nativeBinary() {
21
+ const platform = `${process.platform}-${process.arch}`
22
+ if (!PLATFORMS.includes(platform)) return { reason: `no native build for ${platform}` }
23
+ if (process.platform === "linux" && !process.report?.getReport().header.glibcVersionRuntime) {
24
+ return { reason: "no native build for musl-based Linux" }
25
+ }
26
+ const pkg = `@hlix/cli-${platform}`
27
+ try {
28
+ const binary = join(dirname(require.resolve(`${pkg}/package.json`)), "hlix")
29
+ if (existsSync(binary)) return { binary }
30
+ } catch {
31
+ // Not installed: reported below.
32
+ }
33
+ return { reason: `${pkg} is not installed (npm skips it with --omit=optional)` }
34
+ }
35
+
36
+ function main() {
37
+ const found = nativeBinary()
38
+ if (!found.binary) {
39
+ process.stderr.write(`@hlix/cli: ${found.reason}; hlix will run its Node build.\n`)
40
+ return
41
+ }
42
+ const target = join(__dirname, "bin", "hlix")
43
+ const staged = `${target}.${process.pid}`
44
+ try {
45
+ try {
46
+ linkSync(found.binary, staged)
47
+ } catch {
48
+ copyFileSync(found.binary, staged)
49
+ }
50
+ // A binary that cannot run here must never replace the working wrapper.
51
+ const { version } = require("./package.json")
52
+ const reported = execFileSync(staged, ["--version"], { stdio: ["ignore", "pipe", "ignore"], timeout: 30_000 })
53
+ if (reported.toString().trim() !== version) throw new Error(`the ${version} binary reported ${reported.toString().trim()}`)
54
+ renameSync(staged, target)
55
+ } catch (error) {
56
+ rmSync(staged, { force: true })
57
+ process.stderr.write(`@hlix/cli: kept the Node wrapper (${error instanceof Error ? error.message : error})\n`)
58
+ }
59
+ }
60
+
61
+ module.exports = { nativeBinary }
62
+ if (require.main === module) main()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hlix/cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Hlix Code and the hlix control-plane CLI.",
6
6
  "keywords": [
@@ -12,9 +12,11 @@
12
12
  "type": "module",
13
13
  "main": "./dist/index.js",
14
14
  "bin": {
15
- "hlix": "./dist/index.js"
15
+ "hlix": "./bin/hlix"
16
16
  },
17
17
  "files": [
18
+ "bin",
19
+ "install.cjs",
18
20
  "dist",
19
21
  "skills",
20
22
  "LICENSE",
@@ -34,7 +36,8 @@
34
36
  "test:integration": "NODE_ENV=test bun run ../../apps/backend/scripts/with-aimock.ts -- bun run ../../apps/backend/scripts/with-test-db.ts -- bun test --isolate --preload ../../apps/backend/test/helpers/pool-lifecycle.ts --timeout 60000 .integration.test.ts",
35
37
  "build:binary": "bun run scripts/build-binary.ts",
36
38
  "test:binary": "bun run build:binary && HLIX_TEST_BINARY=dist-native/hlix bun test src/binary.test.ts --timeout 60000 && bun run scripts/smoke-binary.ts",
37
- "test:integration:binary": "bun run build:binary && HLIX_TEST_BINARY=dist-native/hlix NODE_ENV=test bun run ../../apps/backend/scripts/with-aimock.ts -- bun run ../../apps/backend/scripts/with-test-db.ts -- bun test --isolate --preload ../../apps/backend/test/helpers/pool-lifecycle.ts --timeout 60000 src/sync.integration.test.ts src/auth.integration.test.ts"
39
+ "test:integration:binary": "bun run build:binary && HLIX_TEST_BINARY=dist-native/hlix NODE_ENV=test bun run ../../apps/backend/scripts/with-aimock.ts -- bun run ../../apps/backend/scripts/with-test-db.ts -- bun test --isolate --preload ../../apps/backend/test/helpers/pool-lifecycle.ts --timeout 60000 src/sync.integration.test.ts src/auth.integration.test.ts",
40
+ "postinstall": "node install.cjs"
38
41
  },
39
42
  "dependencies": {
40
43
  "@earendil-works/pi-tui": "0.85.1",
@@ -56,5 +59,11 @@
56
59
  "@hlix/shared": "*",
57
60
  "@types/bun": "latest",
58
61
  "typescript": "^7.0.2"
62
+ },
63
+ "optionalDependencies": {
64
+ "@hlix/cli-darwin-arm64": "0.7.2",
65
+ "@hlix/cli-darwin-x64": "0.7.2",
66
+ "@hlix/cli-linux-x64": "0.7.2",
67
+ "@hlix/cli-linux-arm64": "0.7.2"
59
68
  }
60
69
  }
@@ -182,7 +182,8 @@ config key, which only picks the coder Hlix Code spawns on this machine.
182
182
  ## Commands
183
183
 
184
184
  ```bash
185
- hlix status [--json] # workspace, binding, local and cloud drift
185
+ hlix status [--json] # workspace, binding, local and cloud drift, and how this hlix was installed
186
+ hlix uninstall [--yes] [--json] # remove an hlix the one-line installer put here; keeps your login
186
187
  hlix standards [--json] # instruction files, skills, commands, MCP servers and subagents other agent tools left in this folder
187
188
  hlix rules [--edit] [--global] [--json] # the rules files the coding agent reads; --edit opens one in $EDITOR
188
189
  hlix projects list [--json] # projects in the workspace