Skip to content

Redesign setup.sh: interactive wizard with guided key entry & live health dashboard#89

Merged
valITino merged 2 commits into
mainfrom
claude/practical-franklin-7d4doq
Jun 12, 2026
Merged

Redesign setup.sh: interactive wizard with guided key entry & live health dashboard#89
valITino merged 2 commits into
mainfrom
claude/practical-franklin-7d4doq

Conversation

@valITino

Copy link
Copy Markdown
Owner

Summary

Completely redesigns setup.sh from a minimal one-command setup into a professional, guided interactive wizard that walks users through AI client selection, knowledge graph configuration, API key entry (with step-by-step help for each), and live service health monitoring. The wizard is fully non-interactive-friendly for CI/scripted runs while remaining user-friendly for interactive terminal sessions.

Key Changes

Interactive Wizard Flow

  • New 8-step guided setup: prerequisites → .env prep → AI client choice → Neo4j selection → optional recon keys → output dirs → image pull → service startup → health dashboard
  • AI client selection menu (Claude Code/Web/Desktop, ChatGPT, DeepSeek) with sub-choices where applicable
  • Neo4j mode selection (none/local Docker/Aura cloud) with detailed guidance for Aura signup
  • Optional recon API key prompts (WPScan, Shodan, VirusTotal, SecurityTrails) with links and brief how-to for each

Terminal & Color Handling

  • Detects TTY for stdin/stdout and respects NO_COLOR convention
  • Conditional color codes: only emitted when stdout is a TTY AND NO_COLOR is unset
  • Keeps piped/CI logs clean (no raw escape codes)
  • Cursor-redraw codes only on interactive terminals

Live Health Dashboard

  • render_status() function redraws service health table in place on TTY
  • Per-container state colorized (green=healthy, yellow=starting, red=unhealthy/exit, cyan=other)
  • Shows elapsed time and auto-refreshes every 4 seconds during wait_for_health()
  • Falls back to static output on non-TTY (CI logs, pipes)

API Key Entry with Validation

  • prompt_secret() reads keys without echoing, never prints values back
  • key_format_ok() soft-validates key prefixes (sk-ant-, sk-*) non-blockingly
  • set_env() safely writes KEY=VALUE to .env without sed escaping pitfalls
  • Separate help functions for each key type (Anthropic, DeepSeek, OpenAI) with exact steps

Non-Interactive Mode

  • --api-key and --deepseek-key flags still work for scripted runs
  • --minimal disables all prompts and optional profiles
  • --with-neo4j and --with-gateway flags preserved
  • Infers AI variant from flags when not interactive

Helper Functions

  • add_profile() appends compose profiles without duplicates
  • ask_yes_no() reads yes/no with default, respects non-TTY stdin
  • read_choice() numeric menu reader with bounds checking
  • link() renders OSC 8 terminal hyperlinks when color is enabled
  • env_has_value() checks if a key is set in .env

Output & Messaging

  • Step counter in headers (Step 1/8, Step 2/8, etc.)
  • Contextual hints and DIM text explaining each section
  • Hyperlinks to external resources (Anthropic console, DeepSeek API, Neo4j Aura, etc.)
  • print_launch_hint() tailors next steps to the chosen AI client
  • Updated summary with Neo4j Browser/Aura links and MCP Gateway info

Documentation Updates

  • README.md: expanded setup section describing the 8-step wizard flow
  • DOCKER.md: brief mention of the guided wizard
  • Usage help text updated with all new flags and interactive mode description

Notable Implementation Details

  • Secret safety: prompt_secret() writes to stderr for prompts, stdout for the value only (safe for command substitution). Values are never echoed back or logged.
  • TTY detection: [ -t 0 ] for stdin, [ -t 1 ] for stdout; used to gate prompts and color codes independently.
  • Compose profile deduplication: add_profile() uses case/pattern matching to avoid --profile neo4j --profile neo4j duplicates.
  • Live redraw: `render_

https://claude.ai/code/session_0111sKEqbgpbAZKAYDuQmcHa

claude added 2 commits June 12, 2026 07:07
Make the setup experience interactive, transparent, and easy to follow.

Live progress & health
- Stop piping `docker compose pull`/`up` through `tail` — that forced
  Docker's silent/plain mode and hid the per-layer download bars. Stream
  the output so the native progress UI renders in real time.
- Add a colorized, in-place live service-health dashboard that polls
  `docker compose ps` and refreshes until services report healthy.

Interactive AI client choice (with sub-choices)
- Provider menu (Claude / ChatGPT / DeepSeek); Claude expands to Claude
  Code (Docker), Claude Code (Web), or Claude Desktop. The choice drives
  which profile starts, whether the MCP Gateway is enabled, and which key
  (if any) is requested.

Guided API keys
- For each key, explain what it's for, where it's used, and the exact
  steps to obtain it; every key is optional and skippable. Secrets are
  read hidden and never echoed.

Neo4j: none / local / Aura
- Local starts the neo4j Docker profile; Aura walks through console.neo4j.io
  and stores the cloud connection details in .env without starting a local
  container.

Safety/robustness
- New set_env helper removes prior (commented or active) definitions and
  appends the value verbatim — never passing user values through sed
  (injection-safe; handles passwords with | & \).
- Detect non-interactive stdin and fall back to flag-driven defaults; all
  existing flags preserved. up -d guarded so the health dashboard always
  renders.

Docs: sync README install steps and DOCKER.md wizard description.

https://claude.ai/code/session_0111sKEqbgpbAZKAYDuQmcHa
Layered, opt-out-safe UX improvements on top of the guided wizard. No
change to existing logic or contracts; all additions degrade gracefully.

- Pre-flight confirmation: before pulling images or starting containers,
  show a review of every selection (AI client, knowledge graph, gateway)
  and the exact actions about to run, then ask "Proceed?". Declining exits
  cleanly with .env saved. Skipped in non-interactive runs.

- Missing-key warning: if the chosen containerized client's key was
  skipped, the summary now says so prominently with the one-line fix,
  instead of pointing at a launch command that would fail to start.

- Secret-file hardening: chmod 600 on .env (it holds live secrets).

- Non-blocking input validation: warn on unexpected API-key prefixes
  (offer to save anyway) and loop until a Neo4j password is >=8 chars
  (Neo4j 5 rejects shorter ones and won't start).

- Modern terminal output: honor NO_COLOR and auto-disable color when stdout
  isn't a TTY (clean piped/CI logs); render URLs as OSC 8 hyperlinks with a
  plain-text fallback for terminals without support.

https://claude.ai/code/session_0111sKEqbgpbAZKAYDuQmcHa
@valITino valITino merged commit f1da8d7 into main Jun 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants