From 83c21327f0ecb04f712f593cffaafb84a0a7ead2 Mon Sep 17 00:00:00 2001 From: KeiSei84 <2206745@gmail.com> Date: Fri, 22 May 2026 16:06:17 +0800 Subject: [PATCH] style(install): KeiSei brand colors + ASCII banner in installer output (#37) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit KEISEI ASCII logo (голубой) at install start; [install] prefix тёмно-жёлтый (38;5;178); primitive names + language codes голубой (38;5;39); language names тёмно-жёлтый. lib-log COLOR now enables under curl|bash (detect terminal via [ -t 1 ] || /dev/tty — web-install tees stdout so -t 1 was false → colors off). Color detection, not an interactivity gate. Verified piped-under-pty. Co-authored-by: Claude Opus 4.7 (1M context) --- install.sh | 1 + install/lib-log.sh | 32 +++++++++++++++++++++++++++----- install/lib-onboarding-ui.sh | 2 +- install/lib-plan.sh | 2 +- install/lib-primitives.sh | 8 ++++---- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index ad6c609..2522782 100755 --- a/install.sh +++ b/install.sh @@ -203,6 +203,7 @@ if ! printf '%s\n' "$CONFIRM_INPUT" | show_confirm_screen "$CONFIRM_LABEL"; then fi # --- execute install phases ---------------------------------------------- +kei_banner setup_target_dirs scaffold_memory_index install_blocks diff --git a/install/lib-log.sh b/install/lib-log.sh index 4038ae7..f0b0a3e 100644 --- a/install/lib-log.sh +++ b/install/lib-log.sh @@ -1,21 +1,43 @@ # shellcheck shell=bash -# lib-log.sh — say / warn / err with optional ANSI color. -# Honors NO_COLOR (no-color.org) and TTY detection on fd 1. +# lib-log.sh — say / warn / err with optional ANSI color + KeiSei banner. +# Honors NO_COLOR (no-color.org). Color is ON when stdout is a TTY OR a +# controlling terminal is reachable via /dev/tty — the latter matters under +# `curl|bash`, where web-install.sh tees stdout (so `-t 1` is false even in an +# interactive session, but the terminal is still there via /dev/tty). +# This `-t 1`-with-/dev/tty test is COLOR detection, NOT an interactivity gate +# (see ~/.claude/rules/tty-interactivity-gate.md) — it pairs with no `-t 0`. # Sourced by install.sh; no top-level execution. -# ANSI on iff stdout is a TTY and NO_COLOR is unset. -if [ -t 1 ] && [ "${NO_COLOR:-}" = "" ]; then +if { [ -t 1 ] || { : < /dev/tty; } 2>/dev/null; } && [ "${NO_COLOR:-}" = "" ]; then COLOR=1 else COLOR=0 fi +# Brand palette: тёмно-жёлтый (gold) for [install], голубой (sky-blue) for KeiSei. if [ "$COLOR" = "1" ]; then - say() { printf '\033[1;36m[install]\033[0m %s\n' "$*"; } + KEI_GOLD=$'\033[38;5;178m' # тёмно-жёлтый — install prefix + KEI_BLUE=$'\033[38;5;39m' # голубой — logo / primitives + KEI_DIM=$'\033[2m' + KEI_RST=$'\033[0m' + say() { printf '%s[install]%s %s\n' "$KEI_GOLD" "$KEI_RST" "$*"; } warn() { printf '\033[1;33m[warn]\033[0m %s\n' "$*"; } err() { printf '\033[1;31m[error]\033[0m %s\n' "$*" >&2; } else + KEI_GOLD= KEI_BLUE= KEI_DIM= KEI_RST= say() { printf '[install] %s\n' "$*"; } warn() { printf '[warn] %s\n' "$*"; } err() { printf '[error] %s\n' "$*" >&2; } fi + +# KeiSei ASCII banner — голубой logo, shown once at install start. +kei_banner() { + printf '\n' + printf '%s ██╗ ██╗███████╗██╗███████╗███████╗██╗%s\n' "$KEI_BLUE" "$KEI_RST" + printf '%s ██║ ██╔╝██╔════╝██║██╔════╝██╔════╝██║%s\n' "$KEI_BLUE" "$KEI_RST" + printf '%s █████╔╝ █████╗ ██║███████╗█████╗ ██║%s\n' "$KEI_BLUE" "$KEI_RST" + printf '%s ██╔═██╗ ██╔══╝ ██║╚════██║██╔══╝ ██║%s\n' "$KEI_BLUE" "$KEI_RST" + printf '%s ██║ ██╗███████╗██║███████║███████╗██║%s\n' "$KEI_BLUE" "$KEI_RST" + printf '%s ╚═╝ ╚═╝╚══════╝╚═╝╚══════╝╚══════╝╚═╝%s\n' "$KEI_BLUE" "$KEI_RST" + printf '%s KeiSeiKit · installing%s\n\n' "$KEI_GOLD" "$KEI_RST" +} diff --git a/install/lib-onboarding-ui.sh b/install/lib-onboarding-ui.sh index 5fe87aa..0b80413 100644 --- a/install/lib-onboarding-ui.sh +++ b/install/lib-onboarding-ui.sh @@ -57,7 +57,7 @@ onboarding_pick_language() { while IFS=$'\t' read -r code name; do [ -z "$code" ] && continue codes+=("$code") - printf " %2d) %s — %s\n" "$i" "$code" "$name" >&2 + printf " %2d) ${KEI_BLUE:-}%s${KEI_RST:-} — ${KEI_GOLD:-}%s${KEI_RST:-}\n" "$i" "$code" "$name" >&2 i=$((i+1)) done <<< "$langs" ans="$(_onb_read_choice "${#codes[@]}" "[1-${#codes[@]}, default 1=en]: ")" diff --git a/install/lib-plan.sh b/install/lib-plan.sh index ef9e422..77633b3 100644 --- a/install/lib-plan.sh +++ b/install/lib-plan.sh @@ -100,7 +100,7 @@ _print_primitive_rows() { [ -z "$name" ] && continue kind="$(primitive_field "$name" kind 2>/dev/null || echo '?')" extra="$(primitive_time_secs "$name")s, $(( $(primitive_disk_kb "$name") / 1024 )) MB" - printf ' + %-22s (%s, ~%s)\n' "$name" "$kind" "$extra" + printf ' + %s%-22s%s (%s, ~%s)\n' "${KEI_BLUE:-}" "$name" "${KEI_RST:-}" "$kind" "$extra" done } diff --git a/install/lib-primitives.sh b/install/lib-primitives.sh index dd07bae..2cbe29b 100644 --- a/install/lib-primitives.sh +++ b/install/lib-primitives.sh @@ -28,7 +28,7 @@ copy_shell_primitive() { mkdir -p "$AGENTS_DIR/_primitives" cp -f "$src" "$dst" chmod +x "$dst" - say " + shell: $name ($file)" + say " + shell: ${KEI_BLUE:-}$name${KEI_RST:-} ($file)" } remove_shell_primitive() { @@ -65,7 +65,7 @@ copy_rust_primitive() { cp -rf "$src/$sibling/"* "$dst/$sibling/" 2>/dev/null || true fi done - say " + rust: $name (crate $crate)" + say " + rust: ${KEI_BLUE:-}$name${KEI_RST:-} (crate $crate)" } remove_rust_primitive() { @@ -103,7 +103,7 @@ copy_node_primitive() { find "$dst" -depth -name "$ex" -exec rm -rf {} + 2>/dev/null || true done < <(_node_excludes) fi - say " + node: $name (path $rel)" + say " + node: ${KEI_BLUE:-}$name${KEI_RST:-} (path $rel)" } remove_node_primitive() { @@ -171,7 +171,7 @@ install_external_primitive() { err "external primitive $name: entry point $slug not found in $file" return 1 fi - say " + external: $name (via $file)" + say " + external: ${KEI_BLUE:-}$name${KEI_RST:-} (via $file)" "$slug" || warn "$name install failed — re-run after fixing prereqs" }