An always-on second brain you talk to. Voice notes in Telegram → typed, linked knowledge in your Obsidian vault. Runs 24/7 on the Claude subscription you already have.
Python ai-agentsai-automationclaudeclaude-codeebbinghausknowledge-graphllmmemory-systemobsidianpersonal-assistantpkmproductivitypythonsecond-braintelegram-botvoice-assistant
fix(bootstrap): download to file then exec, no pipe stdin issues
smixs4cce52b51975
diff --git a/bootstrap.sh b/bootstrap.shindex 18419ae..12a4de3 100755--- a/bootstrap.sh+++ b/bootstrap.sh@@ -3,13 +3,10 @@# =============================================================================# Agent Second Brain - Bootstrap Script# =============================================================================-# Downloads and runs the full setup script+# Downloads setup.sh and runs it properly (not via pipe)#-# Usage (after forking the repo):-# curl -fsSL https://raw.githubusercontent.com/YOUR_USER/agent-second-brain/main/bootstrap.sh | bash-#-# Or with your username:-# curl -fsSL https://raw.githubusercontent.com/YOUR_USER/agent-second-brain/main/bootstrap.sh | bash -s YOUR_USER+# Usage:+# curl -fsSL https://raw.githubusercontent.com/smixs/agent-second-brain/main/bootstrap.sh | bash# =============================================================================set -e@@ -31,58 +28,35 @@ if [ "$EUID" -eq 0 ]; thenexit 1fi-# Get GitHub username-GITHUB_USER="${1:-}"--if [ -z "$GITHUB_USER" ]; then- echo -e "${CYAN}Enter your GitHub username (where you forked the repo):${NC}"- # Read from /dev/tty to handle curl | bash case- read -r GITHUB_USER < /dev/tty-fi--if [ -z "$GITHUB_USER" ]; then- echo -e "${RED}[X] GitHub username is required${NC}"- echo ""- echo "Usage:"- echo " curl -fsSL URL | bash -s YOUR_GITHUB_USER"- echo " Example: curl -fsSL URL | bash -s smixs"- exit 1-fi+# Always download from original repo+SETUP_URL="https://raw.githubusercontent.com/smixs/agent-second-brain/main/setup.sh"-SETUP_URL="https://raw.githubusercontent.com/$GITHUB_USER/agent-second-brain/main/setup.sh"+echo "Downloading setup script..."-echo ""-echo "Downloading setup script from:"-echo " $SETUP_URL"-echo ""+# Create temp file+TEMP_SCRIPT=$(mktemp /tmp/setup-XXXXXX.sh)-# Check if curl or wget available+# Download setup scriptif command -v curl &> /dev/null; then- SETUP_SCRIPT=$(curl -fsSL "$SETUP_URL")+ curl -fsSL "$SETUP_URL" -o "$TEMP_SCRIPT"elif command -v wget &> /dev/null; then- SETUP_SCRIPT=$(wget -qO- "$SETUP_URL")+ wget -q "$SETUP_URL" -O "$TEMP_SCRIPT"else- echo -e "${RED}[X] Neither curl nor wget found. Install one first:${NC}"- echo " sudo apt install curl"+ echo -e "${RED}[X] Neither curl nor wget found${NC}"+ echo " Install: sudo apt install curl"exit 1fi-if [ -z "$SETUP_SCRIPT" ]; then+if [ ! -s "$TEMP_SCRIPT" ]; thenecho -e "${RED}[X] Failed to download setup script${NC}"- echo " Make sure you've forked the repo and the username is correct"+ rm -f "$TEMP_SCRIPT"exit 1fi-echo -e "${GREEN}[OK] Setup script downloaded${NC}"-echo ""--# Run the setup script-echo "Starting setup..."+echo -e "${GREEN}[OK] Downloaded${NC}"echo ""-# Create temp file and run-TEMP_SCRIPT=$(mktemp)-echo "$SETUP_SCRIPT" > "$TEMP_SCRIPT"+# Make executable and run PROPERLY (not via pipe!)+# exec replaces current process, so stdin works normallychmod +x "$TEMP_SCRIPT"-bash "$TEMP_SCRIPT"-rm -f "$TEMP_SCRIPT"+exec bash "$TEMP_SCRIPT"diff --git a/setup.sh b/setup.shindex cd8c4fb..22a9c6e 100755--- a/setup.sh+++ b/setup.sh@@ -129,7 +129,7 @@ check_os() {. /etc/os-releaseif [[ "$ID" != "ubuntu" && "$ID" != "debian" ]]; thenwarn "This script is tested on Ubuntu/Debian. You're running: $ID"- read -p "Continue anyway? (y/N): " -r REPLY < /dev/tty+ read -p "Continue anyway? (y/N): " -r REPLYif [[ ! $REPLY =~ ^[Yy]$ ]]; thenexit 1fi@@ -245,7 +245,7 @@ clone_repository() {if [ -d "$PROJECT_DIR" ]; thenwarn "Project directory already exists: $PROJECT_DIR"- read -p "Remove and re-clone? (y/N): " -r REPLY < /dev/tty+ read -p "Remove and re-clone? (y/N): " -r REPLYif [[ $REPLY =~ ^[Yy]$ ]]; thenrm -rf "$PROJECT_DIR"else@@ -256,7 +256,7 @@ clone_repository() {fiask "Enter your GitHub username (the one where you forked the repo):"- read -r GITHUB_USER < /dev/tty+ read -r GITHUB_USERif [ -z "$GITHUB_USER" ]; thenerror "GitHub username cannot be empty"@@ -293,7 +293,7 @@ collect_tokens() {# Telegram Bot Tokenwhile true; doask "Telegram Bot Token (from @BotFather):"- read -r TELEGRAM_BOT_TOKEN < /dev/tty+ read -r TELEGRAM_BOT_TOKENif validate_telegram_token "$TELEGRAM_BOT_TOKEN"; thensuccess "Token format valid"break@@ -305,7 +305,7 @@ collect_tokens() {# Telegram User IDwhile true; doask "Your Telegram User ID (from @userinfobot):"- read -r TELEGRAM_USER_ID < /dev/tty+ read -r TELEGRAM_USER_IDif validate_telegram_id "$TELEGRAM_USER_ID"; thensuccess "User ID valid"break@@ -317,7 +317,7 @@ collect_tokens() {# Deepgram API Keywhile true; doask "Deepgram API Key (from console.deepgram.com):"- read -r DEEPGRAM_API_KEY < /dev/tty+ read -r DEEPGRAM_API_KEYif validate_deepgram_key "$DEEPGRAM_API_KEY"; thensuccess "API Key format valid"break@@ -329,7 +329,7 @@ collect_tokens() {# Todoist API Tokenwhile true; doask "Todoist API Token (from Settings > Integrations > Developer):"- read -r TODOIST_API_KEY < /dev/tty+ read -r TODOIST_API_KEYif validate_todoist_key "$TODOIST_API_KEY"; thensuccess "API Token format valid"break@@ -346,7 +346,7 @@ create_env_file() {if [ -f "$ENV_FILE" ]; thenwarn ".env file already exists"- read -p "Overwrite? (y/N): " -r REPLY < /dev/tty+ read -p "Overwrite? (y/N): " -r REPLYif [[ ! $REPLY =~ ^[Yy]$ ]]; thensuccess "Keeping existing .env"return@@ -436,7 +436,7 @@ configure_git_remote() {git config user.email "bot@localhost"ask "Do you want to configure GitHub push access? (for auto-sync)"- read -p "(y/N): " -r REPLY < /dev/tty+ read -p "(y/N): " -r REPLYif [[ ! $REPLY =~ ^[Yy]$ ]]; thenwarn "Skipping GitHub push configuration"@@ -451,7 +451,7 @@ configure_git_remote() {echo ""ask "Enter your GitHub Personal Access Token:"- read -rs GITHUB_TOKEN < /dev/tty+ read -rs GITHUB_TOKENecho ""if [ -z "$GITHUB_TOKEN" ]; then@@ -463,7 +463,7 @@ configure_git_remote() {if [ -z "$GITHUB_USER" ]; thenask "Enter your GitHub username:"- read -r GITHUB_USER < /dev/tty+ read -r GITHUB_USERfigit remote set-url origin "https://[email protected]/$GITHUB_USER/agent-second-brain.git"@@ -609,7 +609,7 @@ main() {echo " 5. Set up auto-start service"echo ""- read -p "Ready to start? (Y/n): " -r REPLY < /dev/tty+ read -p "Ready to start? (Y/n): " -r REPLYif [[ $REPLY =~ ^[Nn]$ ]]; thenecho "Setup cancelled."exit 0