From 2194b11329fd16d7c8d8abaa4c55c32dbe66fd79 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Tue, 23 Jun 2026 14:09:55 +0200 Subject: [PATCH] fix(install): install jq prerequisite (active hooks require it) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jq is used 18+ times in always-on hooks (statusline.sh, rtk-rewrite.sh) but was never installed by any script — it only worked because dev machines happened to have it; a bare machine breaks at hook-run time. Add it to Step 1 (same inline pattern as the other prereqs) and to doctor.sh at fail level. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01UyNYwD4UccVw9ZCFZyJX55 --- doctor.sh | 6 ++++++ install-plugins.sh | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/doctor.sh b/doctor.sh index 9f4138a..ca36f08 100644 --- a/doctor.sh +++ b/doctor.sh @@ -127,6 +127,12 @@ else fail "Node.js not found" fi +if command -v jq &>/dev/null; then + pass "jq $(jq --version 2>/dev/null | sed 's/^jq-//')" +else + fail "jq not found — statusline & rtk-rewrite hooks require it" +fi + if command -v cargo &>/dev/null; then pass "Cargo $(cargo --version | awk '{print $2}')" else diff --git a/install-plugins.sh b/install-plugins.sh index 668a1cb..a4d466f 100644 --- a/install-plugins.sh +++ b/install-plugins.sh @@ -193,6 +193,25 @@ else fi fi +# --- jq (required by active hooks: statusline.sh, rtk-rewrite.sh) --- +if command -v jq &>/dev/null; then + ok "jq $(jq --version 2>/dev/null | sed 's/^jq-//')" +else + info "Installing jq..." + case $OS in + macos) brew install jq ;; + linux-apt) sudo apt-get install -y jq ;; + linux-dnf) sudo dnf install -y jq ;; + linux-pacman) sudo pacman -S --noconfirm jq ;; + *) warn "Cannot auto-install jq on $OS — statusline/rtk hooks need it" ;; + esac + if command -v jq &>/dev/null; then + ok "jq installed" + else + warn "jq install failed — statusline & rtk-rewrite hooks require it" + fi +fi + # --- Claude Code CLI --- if command -v claude &>/dev/null; then ok "Claude Code $(claude --version 2>/dev/null | head -1)"