From 88b79daaddf7fdabf020275869af485279c7709f Mon Sep 17 00:00:00 2001 From: Josh Boys Date: Tue, 20 Oct 2026 23:59:09 +0800 Subject: [PATCH] feat(install): offer kindling demo after setup After the Claude Code setup step, prompt to load sample memory with `kindling demo --reset` (default yes) so new users can try search and browse straight away. The prompt is skipped when no terminal is available (CI, headless) or when KINDLING_NO_DEMO=1, so piped installs never hang. Closing hints now mention `kindling browse`, and `kindling demo` when the sample was not loaded. --- install.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ packaging/README.md | 5 +++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index eebfd28..3ed2ad3 100755 --- a/install.sh +++ b/install.sh @@ -13,6 +13,7 @@ set -eu # KINDLING_VERSION release tag to install (e.g. v0.1.0); default: latest # KINDLING_INSTALL_DIR install directory; default: ~/.local/bin # KINDLING_REPO GitHub repo to install from; default: eddacraft/kindling +# KINDLING_NO_DEMO set to 1 to skip the sample memory prompt # # POSIX sh, shellcheck-clean. @@ -24,6 +25,10 @@ INSTALL_DIR="${KINDLING_INSTALL_DIR:-${HOME}/.local/bin}" # even when INSTALL_DIR is not yet on PATH. KINDLING_CMD="" +# "yes" once the sample memory is loaded, "skipped" otherwise; tailors the +# closing hints. +DEMO_LOADED="skipped" + # --- helpers --- info() { printf '\033[1;34m==>\033[0m %s\n' "$1"; } @@ -32,6 +37,11 @@ error() { printf '\033[1;31merror:\033[0m %s\n' "$1" >&2; exit 1; } command_exists() { command -v "$1" >/dev/null 2>&1; } +# True when a controlling terminal can be opened for prompts. Under +# `curl | sh` stdin is the script, so prompts read from /dev/tty instead; in CI +# or other headless runs there is no terminal, so prompts are skipped. +has_tty() { (: /dev/null; } + # --- platform detection --- detect_target() { @@ -183,6 +193,34 @@ setup_claude_code() { esac } +offer_demo() { + [ -n "$KINDLING_CMD" ] || return 0 + + case "${KINDLING_NO_DEMO:-}" in + 1 | [yY] | [yY][eE][sS] | [tT][rR][uU][eE]) return 0 ;; + esac + + # Never block a headless install: without a terminal there is no one to ask. + has_tty || return 0 + + printf '\n' + printf ' Load sample memory to try search? [Y/n] ' + + answer="y" + read -r answer