Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,20 @@ Already installed? Open **Settings → Check for Updates** to upgrade in-app.
curl -fsSL https://raw.githubusercontent.com/RealZST/HarnessKit/main/install.sh | sh
```

Or download the binary manually:
Or download the binary manually from the [latest release](https://github.com/RealZST/HarnessKit/releases/latest):

| Chip | File |
|------|------|
| Apple Silicon (M1/M2/M3/M4) | `hk-macos-arm64` |
| Intel | `hk-macos-x64` |

Then install it:

```bash
chmod +x hk-macos-arm64 # make it executable (use hk-macos-x64 for Intel)
mv hk-macos-arm64 ~/.local/bin/hk # move to a directory in your PATH
```

After installation, restart your terminal and verify with `hk status`.

---
Expand Down
52 changes: 52 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh
# HarnessKit CLI installer — auto-detects architecture and installs the
# latest `hk` binary to ~/.local/bin.
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/RealZST/HarnessKit/main/install.sh | sh

set -e

REPO="RealZST/HarnessKit"
INSTALL_DIR="$HOME/.local/bin"

# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
arm64|aarch64) BINARY="hk-macos-arm64" ;;
x86_64) BINARY="hk-macos-x64" ;;
*)
echo "Error: unsupported architecture: $ARCH"
exit 1
;;
esac

# Get latest release tag
TAG=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | head -1 | sed 's/.*: "//;s/".*//')
if [ -z "$TAG" ]; then
echo "Error: failed to fetch latest release"
exit 1
fi

URL="https://github.com/$REPO/releases/download/$TAG/$BINARY"

echo "Installing HarnessKit CLI $TAG ($ARCH)..."

# Download
mkdir -p "$INSTALL_DIR"
curl -fsSL "$URL" -o "$INSTALL_DIR/hk"
chmod +x "$INSTALL_DIR/hk"

echo "Installed hk to $INSTALL_DIR/hk"

# Check if INSTALL_DIR is in PATH
case ":$PATH:" in
*":$INSTALL_DIR:"*) ;;
*)
echo ""
echo "Add ~/.local/bin to your PATH:"
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
echo "Then restart your terminal and verify with: hk status"
;;
esac
Loading