Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(packaging): ship the new openhuman-tui binary alongside the core CLI

Steven Enamakel9b16b1051f62
diff --git a/packages/deb/build.sh b/packages/deb/build.sh
index 2e77b1cbff..981302355b 100755
--- a/packages/deb/build.sh
+++ b/packages/deb/build.sh
@@ -1,12 +1,13 @@
#!/usr/bin/env bash
-# Build a .deb package for the openhuman-core CLI binary.
-# Usage: build.sh <binary_path> <version> <arch>
+# Build a .deb package for the openhuman core CLI and terminal UI binaries.
+# Usage: build.sh <core_binary_path> <tui_binary_path> <version> <arch>
# arch: amd64 | arm64
set -euo pipefail
-BINARY="$1"
-VERSION="$2"
-ARCH="$3"
+CORE_BINARY="$1"
+TUI_BINARY="$2"
+VERSION="$3"
+ARCH="$4"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORK_DIR="$(mktemp -d)"
@@ -18,7 +19,8 @@ PKG_DIR="$WORK_DIR/$PKG_NAME"
mkdir -p "$PKG_DIR/usr/bin"
mkdir -p "$PKG_DIR/DEBIAN"
-install -m 755 "$BINARY" "$PKG_DIR/usr/bin/openhuman"
+install -m 755 "$CORE_BINARY" "$PKG_DIR/usr/bin/openhuman"
+install -m 755 "$TUI_BINARY" "$PKG_DIR/usr/bin/openhuman-tui"
sed \
-e "s/@VERSION@/${VERSION}/g" \
diff --git a/packages/homebrew/openhuman.rb b/packages/homebrew/openhuman.rb
index c8c2c61de9..1caf6ef2a9 100644
--- a/packages/homebrew/openhuman.rb
+++ b/packages/homebrew/openhuman.rb
@@ -30,11 +30,12 @@ class Openhuman < Formula
end
def install
- bin.install "openhuman-core"
- mv bin/"openhuman-core", bin/"openhuman"
+ bin.install "openhuman-core", "openhuman-tui"
+ bin.install_symlink "openhuman-core" => "openhuman"
end
test do
system "#{bin}/openhuman", "--version"
+ system "#{bin}/openhuman-tui", "--help"
end
end
diff --git a/packages/npm/bin/openhuman-tui.js b/packages/npm/bin/openhuman-tui.js
new file mode 100644
index 0000000000..9cd4891064
--- /dev/null
+++ b/packages/npm/bin/openhuman-tui.js
@@ -0,0 +1,27 @@
+#!/usr/bin/env node
+'use strict';
+
+const { spawnSync } = require('child_process');
+const path = require('path');
+
+const isWin = process.platform === 'win32';
+const binName = isWin ? 'openhuman-tui-bin.exe' : 'openhuman-tui-bin';
+const binPath = path.join(__dirname, binName);
+
+const result = spawnSync(binPath, process.argv.slice(2), {
+ stdio: 'inherit',
+ windowsHide: false,
+});
+
+if (result.error) {
+ if (result.error.code === 'ENOENT') {
+ process.stderr.write(
+ 'openhuman-tui binary not found. Try reinstalling: npm install -g openhuman\n'
+ );
+ } else {
+ process.stderr.write(`openhuman-tui: ${result.error.message}\n`);
+ }
+ process.exit(1);
+}
+
+process.exit(result.status ?? 0);
diff --git a/packages/npm/install.js b/packages/npm/install.js
index 3f4ddfdf17..e011bb386c 100644
--- a/packages/npm/install.js
+++ b/packages/npm/install.js
@@ -2,7 +2,7 @@
'use strict';
// postinstall: downloads the correct pre-built binary for this platform/arch,
-// verifies the SHA-256 checksum, then places it at bin/openhuman-bin[.exe].
+// verifies the SHA-256 checksum, then installs the core and TUI executables.
//
// The binary is fetched from the GitHub release that matches package.json version.
@@ -98,11 +98,13 @@ async function main() {
fs.mkdirSync(binDir, { recursive: true });
const tmpTarball = path.join(binDir, tarball);
- const binDest = path.join(binDir, isWin ? 'openhuman-bin.exe' : 'openhuman-bin');
+ const coreDest = path.join(binDir, isWin ? 'openhuman-bin.exe' : 'openhuman-bin');
+ const tuiDest = path.join(binDir, isWin ? 'openhuman-tui-bin.exe' : 'openhuman-tui-bin');
- // Skip if binary already exists and is executable
- if (fs.existsSync(binDest)) {
- console.log('[openhuman] Binary already installed, skipping download.');
+ // Skip only when both commands are already installed. This lets an upgrade
+ // from a core-only package fetch the newly shipped TUI.
+ if (fs.existsSync(coreDest) && fs.existsSync(tuiDest)) {
+ console.log('[openhuman] Binaries already installed, skipping download.');
return;
}
@@ -139,25 +141,33 @@ async function main() {
],
{ stdio: 'inherit', env: { ...process.env, TC_SRC: tmpTarball, TC_DEST: binDir } }
);
- const extracted = path.join(binDir, 'openhuman-core.exe');
- if (fs.existsSync(extracted)) fs.renameSync(extracted, binDest);
+ const extractedCore = path.join(binDir, 'openhuman-core.exe');
+ const extractedTui = path.join(binDir, 'openhuman-tui.exe');
+ if (fs.existsSync(extractedCore)) fs.renameSync(extractedCore, coreDest);
+ if (fs.existsSync(extractedTui)) fs.renameSync(extractedTui, tuiDest);
} else {
execFileSync('tar', ['-xzf', tmpTarball, '-C', binDir], { stdio: 'inherit' });
- const extracted = path.join(binDir, 'openhuman-core');
- if (fs.existsSync(extracted)) {
- fs.renameSync(extracted, binDest);
- fs.chmodSync(binDest, 0o755);
+ const extractedCore = path.join(binDir, 'openhuman-core');
+ const extractedTui = path.join(binDir, 'openhuman-tui');
+ if (fs.existsSync(extractedCore)) {
+ fs.renameSync(extractedCore, coreDest);
+ fs.chmodSync(coreDest, 0o755);
+ }
+ if (fs.existsSync(extractedTui)) {
+ fs.renameSync(extractedTui, tuiDest);
+ fs.chmodSync(tuiDest, 0o755);
}
}
// Clean up archive
fs.rmSync(tmpTarball, { force: true });
- if (!fs.existsSync(binDest)) {
- throw new Error('[openhuman] Extraction failed — binary not found after unpack.');
+ if (!fs.existsSync(coreDest) || !fs.existsSync(tuiDest)) {
+ throw new Error('[openhuman] Extraction failed — core or TUI binary not found after unpack.');
}
- console.log(`[openhuman] Installed at ${binDest}`);
+ console.log(`[openhuman] Installed core at ${coreDest}`);
+ console.log(`[openhuman] Installed TUI at ${tuiDest}`);
}
main().catch((err) => {
diff --git a/packages/npm/package.json b/packages/npm/package.json
index 0aa045e797..233e2920f0 100644
--- a/packages/npm/package.json
+++ b/packages/npm/package.json
@@ -20,7 +20,8 @@
},
"license": "MIT",
"bin": {
- "openhuman": "./bin/openhuman.js"
+ "openhuman": "./bin/openhuman.js",
+ "openhuman-tui": "./bin/openhuman-tui.js"
},
"scripts": {
"postinstall": "node install.js"
diff --git a/scripts/release/build-apt-packages.sh b/scripts/release/build-apt-packages.sh
index 9bac5e004e..5f0194a43d 100755
--- a/scripts/release/build-apt-packages.sh
+++ b/scripts/release/build-apt-packages.sh
@@ -50,17 +50,25 @@ done
tar -xzf "$TMPDIR/tarballs/openhuman-core-${VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
-C "$TMPDIR/bins"
mv "$TMPDIR/bins/openhuman-core" "$TMPDIR/bins/openhuman-core-amd64"
+mv "$TMPDIR/bins/openhuman-tui" "$TMPDIR/bins/openhuman-tui-amd64"
tar -xzf "$TMPDIR/tarballs/openhuman-core-${VERSION}-aarch64-unknown-linux-gnu.tar.gz" \
-C "$TMPDIR/bins"
mv "$TMPDIR/bins/openhuman-core" "$TMPDIR/bins/openhuman-core-arm64"
+mv "$TMPDIR/bins/openhuman-tui" "$TMPDIR/bins/openhuman-tui-arm64"
-chmod +x "$TMPDIR/bins/openhuman-core-amd64" "$TMPDIR/bins/openhuman-core-arm64"
+chmod +x \
+ "$TMPDIR/bins/openhuman-core-amd64" "$TMPDIR/bins/openhuman-tui-amd64" \
+ "$TMPDIR/bins/openhuman-core-arm64" "$TMPDIR/bins/openhuman-tui-arm64"
# ── Build .deb packages ─────────────────────────────────────────────────────
echo "[apt] Building .deb packages ..."
-bash "$REPO_ROOT/packages/deb/build.sh" "$TMPDIR/bins/openhuman-core-amd64" "${VERSION}" amd64
-bash "$REPO_ROOT/packages/deb/build.sh" "$TMPDIR/bins/openhuman-core-arm64" "${VERSION}" arm64
+bash "$REPO_ROOT/packages/deb/build.sh" \
+ "$TMPDIR/bins/openhuman-core-amd64" "$TMPDIR/bins/openhuman-tui-amd64" \
+ "${VERSION}" amd64
+bash "$REPO_ROOT/packages/deb/build.sh" \
+ "$TMPDIR/bins/openhuman-core-arm64" "$TMPDIR/bins/openhuman-tui-arm64" \
+ "${VERSION}" arm64
ls -lh openhuman_*.deb