From 9c38af5469b2fd69db411962c9bd14e0938c2ee9 Mon Sep 17 00:00:00 2001 From: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com> Date: Sat, 17 Oct 2026 18:12:07 -0700 Subject: [PATCH 1/3] feat(install): unified install.sh that prefers Homebrew Ships scripts/install.sh as a release asset. It installs through the hotdata-dev/tap/cli formula when brew is present (HOTDATA_NO_BREW=1 to skip), otherwise pipes to the cargo-dist installer. README now leads with the one-liner. --- README.md | 8 ++++-- dist-workspace.toml | 4 +++ scripts/install.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100755 scripts/install.sh diff --git a/README.md b/README.md index dc949935..68c6813b 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,14 @@ commands. ## Install ```sh -brew install hotdata-dev/tap/cli # Homebrew -cargo install --path . # from source (requires Rust) +curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hotdata-dev/hotdata-cli/releases/latest/download/install.sh | sh ``` +The script uses Homebrew (`brew install hotdata-dev/tap/cli`) when `brew` is +present and otherwise drops a prebuilt binary into `~/.hotdata/cli`. Set +`HOTDATA_NO_BREW=1` to skip Homebrew. To build from source instead: +`cargo install --path .` (requires Rust). + Or grab a binary from [Releases](https://github.com/hotdata-dev/hotdata-cli/releases). Stay current with `hotdata manage upgrade`; enable tab completion with `hotdata manage completions bash|zsh|fish`. diff --git a/dist-workspace.toml b/dist-workspace.toml index 211549aa..6b726a55 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -29,3 +29,7 @@ build = ["tar", "-czf", "skills.tar.gz", "skills/"] [[dist.extra-artifacts]] artifacts = ["SKILL.md"] build = ["cp", "skills/hotdata/SKILL.md", "SKILL.md"] + +[[dist.extra-artifacts]] +artifacts = ["install.sh"] +build = ["cp", "scripts/install.sh", "install.sh"] diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 00000000..964926d9 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# install.sh — one installer for Linux and macOS. +# +# If Homebrew is on the machine, install (or upgrade) through the tap so the +# binary is managed by brew and `hotdata manage upgrade` follows suit. +# Otherwise fall back to the cargo-dist shell installer, which drops a +# prebuilt binary into ~/.hotdata/cli. +# +# Usage: +# curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hotdata-dev/hotdata-cli/releases/latest/download/install.sh | sh +# +# Environment: +# HOTDATA_NO_BREW=1 skip Homebrew even when it is installed + +set -eu + +FORMULA="hotdata-dev/tap/cli" +REPO="https://github.com/hotdata-dev/hotdata-cli" +DIST_INSTALLER="$REPO/releases/latest/download/hotdata-cli-installer.sh" + +find_brew() { + if command -v brew >/dev/null 2>&1; then + command -v brew + return 0 + fi + for candidate in /opt/homebrew/bin/brew /usr/local/bin/brew /home/linuxbrew/.linuxbrew/bin/brew; do + if [ -x "$candidate" ]; then + echo "$candidate" + return 0 + fi + done + return 1 +} + +BREW="" +if [ "${HOTDATA_NO_BREW:-}" != "1" ]; then + BREW="$(find_brew || true)" +fi + +if [ -n "$BREW" ]; then + echo "Homebrew found at $BREW; installing $FORMULA" >&2 + if "$BREW" list --formula cli >/dev/null 2>&1; then + "$BREW" upgrade "$FORMULA" + else + "$BREW" install "$FORMULA" + fi + echo "Installed $("$BREW" --prefix)/bin/hotdata" >&2 + exit 0 +fi + +echo "Homebrew not found; installing a prebuilt binary to ~/.hotdata/cli" >&2 +if command -v curl >/dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -LsSf "$DIST_INSTALLER" | sh +elif command -v wget >/dev/null 2>&1; then + wget -qO- "$DIST_INSTALLER" | sh +else + echo "error: need curl or wget to download the installer" >&2 + exit 1 +fi From 53ef1e6498d8dfa25fb665007c341bfb7de63351 Mon Sep 17 00:00:00 2001 From: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com> Date: Sat, 17 Oct 2026 18:16:28 -0700 Subject: [PATCH 2/3] feat(install): install the agent skill after the binary Runs 'hotdata manage skills install --no-input' once the binary is in place, so ~/.claude/skills/hotdata exists right after install. Best-effort; HOTDATA_NO_SKILLS=1 skips it. --- README.md | 7 ++++--- scripts/install.sh | 25 +++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 68c6813b..63a5c2ea 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,10 @@ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hotdata-dev/hotdata-cli ``` The script uses Homebrew (`brew install hotdata-dev/tap/cli`) when `brew` is -present and otherwise drops a prebuilt binary into `~/.hotdata/cli`. Set -`HOTDATA_NO_BREW=1` to skip Homebrew. To build from source instead: -`cargo install --path .` (requires Rust). +present and otherwise drops a prebuilt binary into `~/.hotdata/cli`. It then +installs the agent skill for Claude Code and friends. Set `HOTDATA_NO_BREW=1` +to skip Homebrew, `HOTDATA_NO_SKILLS=1` to skip the skill. To build from +source instead: `cargo install --path .` (requires Rust). Or grab a binary from [Releases](https://github.com/hotdata-dev/hotdata-cli/releases). Stay current with `hotdata manage upgrade`; enable tab completion with diff --git a/scripts/install.sh b/scripts/install.sh index 964926d9..3150c529 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -9,8 +9,13 @@ # Usage: # curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hotdata-dev/hotdata-cli/releases/latest/download/install.sh | sh # +# After the binary lands, the agent skill is installed too (`hotdata manage +# skills install`): it goes to ~/.agents/skills and is linked into ~/.claude +# when that directory exists, so Claude Code picks it up with no extra step. +# # Environment: -# HOTDATA_NO_BREW=1 skip Homebrew even when it is installed +# HOTDATA_NO_BREW=1 skip Homebrew even when it is installed +# HOTDATA_NO_SKILLS=1 install the binary only, skip the agent skill set -eu @@ -32,6 +37,19 @@ find_brew() { return 1 } +# Best-effort: a skill failure must not fail the install. +install_skills() { + bin="$1" + [ "${HOTDATA_NO_SKILLS:-}" = "1" ] && return 0 + if [ ! -x "$bin" ]; then + echo "warning: $bin not found; run 'hotdata manage skills install' to add the agent skill" >&2 + return 0 + fi + echo "Installing the hotdata agent skill" >&2 + "$bin" manage skills install --no-input \ + || echo "warning: skill install failed; run 'hotdata manage skills install' later" >&2 +} + BREW="" if [ "${HOTDATA_NO_BREW:-}" != "1" ]; then BREW="$(find_brew || true)" @@ -44,7 +62,9 @@ if [ -n "$BREW" ]; then else "$BREW" install "$FORMULA" fi - echo "Installed $("$BREW" --prefix)/bin/hotdata" >&2 + HOTDATA_BIN="$("$BREW" --prefix)/bin/hotdata" + echo "Installed $HOTDATA_BIN" >&2 + install_skills "$HOTDATA_BIN" exit 0 fi @@ -57,3 +77,4 @@ else echo "error: need curl or wget to download the installer" >&2 exit 1 fi +install_skills "$HOME/.hotdata/cli/hotdata" From 42df2d4bd2db1960c1a7d2acef023c2a57639299 Mon Sep 17 00:00:00 2001 From: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com> Date: Sat, 17 Oct 2026 18:18:50 -0700 Subject: [PATCH 3/3] fix(install): check the qualified formula; download the dist installer before running it --- scripts/install.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 3150c529..92d81495 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -57,7 +57,7 @@ fi if [ -n "$BREW" ]; then echo "Homebrew found at $BREW; installing $FORMULA" >&2 - if "$BREW" list --formula cli >/dev/null 2>&1; then + if "$BREW" list --formula "$FORMULA" >/dev/null 2>&1; then "$BREW" upgrade "$FORMULA" else "$BREW" install "$FORMULA" @@ -69,12 +69,17 @@ if [ -n "$BREW" ]; then fi echo "Homebrew not found; installing a prebuilt binary to ~/.hotdata/cli" >&2 +# Download fully before running: plain sh has no pipefail, so a failed +# download piped into sh would otherwise "succeed" with nothing installed. +TMP="$(mktemp)" +trap 'rm -f "$TMP"' EXIT if command -v curl >/dev/null 2>&1; then - curl --proto '=https' --tlsv1.2 -LsSf "$DIST_INSTALLER" | sh + curl --proto '=https' --tlsv1.2 -LsSf "$DIST_INSTALLER" -o "$TMP" elif command -v wget >/dev/null 2>&1; then - wget -qO- "$DIST_INSTALLER" | sh + wget -qO "$TMP" "$DIST_INSTALLER" else echo "error: need curl or wget to download the installer" >&2 exit 1 fi +sh "$TMP" install_skills "$HOME/.hotdata/cli/hotdata"