feat: add non-technical user onboarding
- setup.sh: interactive wizard for Docker check and auth configuration - launch.sh: folder-picker launcher (macOS native dialog, zenity/kdialog on Linux, text fallback) - launch.bat: Windows launcher using PowerShell folder browser + Git Bash - claude.sh: friendlier error messages with actionable links; prompt setup.sh if .env missing - hooks/pre-commit: add setup.sh and launch.sh to executable enforcement - README: add Quick Start section aimed at non-technical users Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
51e7ab2b08
commit
f68ed674d0
6 changed files with 297 additions and 45 deletions
62
launch.sh
Executable file
62
launch.sh
Executable file
|
|
@ -0,0 +1,62 @@
|
|||
#!/usr/bin/env bash
|
||||
# launch.sh — Pick a project folder and start Claude Code
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# ─── First-time setup ─────────────────────────────────────────────────────────
|
||||
if [[ ! -f "$SCRIPT_DIR/.env" ]]; then
|
||||
echo "Looks like this is your first time. Running setup..."
|
||||
echo ""
|
||||
"$SCRIPT_DIR/setup.sh" || exit 1
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# ─── Folder picker ────────────────────────────────────────────────────────────
|
||||
pick_folder() {
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# macOS — native Finder dialog
|
||||
osascript -e \
|
||||
'tell application "Finder" to POSIX path of (choose folder with prompt "Select the project folder to work on:")' \
|
||||
2>/dev/null | tr -d '\n'
|
||||
elif command -v zenity &>/dev/null; then
|
||||
# Linux — GNOME/GTK dialog
|
||||
zenity --file-selection --directory \
|
||||
--title="Select your project folder" 2>/dev/null
|
||||
elif command -v kdialog &>/dev/null; then
|
||||
# Linux — KDE dialog
|
||||
kdialog --getexistingdirectory "$HOME" \
|
||||
--title "Select your project folder" 2>/dev/null
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
folder=$(pick_folder || true)
|
||||
|
||||
# Fallback: text prompt (no GUI available, or user cancelled dialog)
|
||||
if [[ -z "$folder" ]]; then
|
||||
echo "Enter the path to your project folder"
|
||||
echo "(Tip: you can drag the folder into this window, then press Enter)"
|
||||
echo ""
|
||||
read -rp "> " folder
|
||||
# Clean up: strip surrounding quotes and trailing whitespace from drag-and-drop
|
||||
folder="${folder%"${folder##*[![:space:]]}"}"
|
||||
folder="${folder#\'}" ; folder="${folder%\'}"
|
||||
folder="${folder#\"}" ; folder="${folder%\"}"
|
||||
# Expand ~ to home directory
|
||||
folder="${folder/#\~/$HOME}"
|
||||
fi
|
||||
|
||||
if [[ -z "$folder" ]]; then
|
||||
echo "No folder selected. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$folder" ]]; then
|
||||
echo "Folder not found: $folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$folder"
|
||||
exec "$SCRIPT_DIR/claude.sh" start
|
||||
Loading…
Add table
Add a link
Reference in a new issue