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
43 changes: 43 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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"; }
Expand All @@ -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/tty) 2>/dev/null; }

# --- platform detection ---

detect_target() {
Expand Down Expand Up @@ -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 </dev/tty || answer="y"

case "$answer" in
"" | [yY] | [yY][eE][sS])
info "Running kindling demo..."
if "$KINDLING_CMD" demo --reset; then
DEMO_LOADED="yes"
else
warn "kindling demo failed; retry later with: kindling demo"
fi
;;
esac
}

# --- main ---

main() {
Expand All @@ -195,6 +233,7 @@ main() {
resolve_version
install_binary
setup_claude_code
offer_demo

printf '\n'
printf ' \342\234\223 kindling installed successfully!\n'
Expand All @@ -203,6 +242,10 @@ main() {
printf ' kindling status Show database status\n'
printf ' kindling log "note" Capture an observation\n'
printf ' kindling search "query" Search your memory\n'
printf ' kindling browse Explore your memory in a browser\n'
if [ "$DEMO_LOADED" != "yes" ]; then
printf ' kindling demo Load sample memory to try search\n'
fi
printf '\n'
printf ' Documentation: https://docs.eddacraft.ai/kindling/overview\n'
printf '\n'
Expand Down
5 changes: 3 additions & 2 deletions packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ The installer lives at the **repo root** ([`install.sh`](../install.sh)) — it
the single `curl | sh` entry point. It detects OS/arch, resolves the latest
release (or `KINDLING_VERSION`), downloads the matching archive + `.sha256`,
**verifies the checksum**, installs `kindling` to `KINDLING_INSTALL_DIR`
(default `~/.local/bin`), and offers to run `kindling init` (with optional Claude
Code setup). If no prebuilt binary matches the platform it falls back to
(default `~/.local/bin`), offers to run `kindling init` (with optional Claude
Code setup), then offers to load sample memory with `kindling demo` (skipped
without a terminal or when `KINDLING_NO_DEMO=1`). If no prebuilt binary matches the platform it falls back to
`cargo install eddacraft-kindling`. Linux (x86_64/aarch64, gnu + musl), macOS
(x86_64/aarch64), and Windows (x86_64, `.zip`) are covered.

Expand Down
Loading