Update: Bootstrap script now installs init-project helper

- Automatically installs init-project script to ~/.homelab-scripts
- Adds scripts directory to PATH
- Lists available commands after bootstrap
- Enables easy project initialization without manual git setup
This commit is contained in:
root
2025-11-23 21:38:51 +00:00
parent 72fd78de68
commit bd3cda3f1d

View File

@@ -8,12 +8,14 @@
# - Clones or updates the homelab-agents repo # - Clones or updates the homelab-agents repo
# - Sets up git remotes for pushing VPS work # - Sets up git remotes for pushing VPS work
# - Makes agents available for Claude Code # - Makes agents available for Claude Code
# - Installs helper scripts (init-project)
set -e set -e
GITEA_URL="http://100.120.125.113:3000" GITEA_URL="http://100.120.125.113:3000"
AGENTS_REPO="$GITEA_URL/pdm/homelab-agents.git" AGENTS_REPO="$GITEA_URL/pdm/homelab-agents.git"
AGENTS_DIR="$HOME/.homelab-agents" AGENTS_DIR="$HOME/.homelab-agents"
SCRIPTS_DIR="$HOME/.homelab-scripts"
echo "🔧 Bootstrapping homelab agents..." echo "🔧 Bootstrapping homelab agents..."
@@ -43,15 +45,35 @@ else
fi fi
fi fi
# Install helper scripts
echo ""
echo "📋 Installing helper scripts..."
mkdir -p "$SCRIPTS_DIR"
if [[ -f "$AGENTS_DIR/scripts/init-project.sh" ]]; then
cp "$AGENTS_DIR/scripts/init-project.sh" "$SCRIPTS_DIR/init-project"
chmod +x "$SCRIPTS_DIR/init-project"
echo "✅ init-project installed"
fi
# Add scripts directory to PATH if not already there
if [[ ":$PATH:" != *":$SCRIPTS_DIR:"* ]]; then
export PATH="$SCRIPTS_DIR:$PATH"
echo "✅ Scripts directory added to PATH"
fi
# Verify agents are available # Verify agents are available
if [[ -f "$AGENTS_DIR/agents/sysadmin-session-closer.md" ]]; then if [[ -f "$AGENTS_DIR/agents/sysadmin-session-closer.md" ]]; then
echo "✅ sysadmin-session-closer agent available" echo "✅ sysadmin-session-closer agent available"
echo ""
echo "📋 Agent location: $AGENTS_DIR/agents/sysadmin-session-closer.md"
echo "🚀 Use in Claude Code: Include the agent from this path"
else else
echo "⚠️ Warning: sysadmin-session-closer.md not found" echo "⚠️ Warning: sysadmin-session-closer.md not found"
fi fi
echo "" echo ""
echo "✨ Homelab agents bootstrap complete!" echo "✨ Homelab agents bootstrap complete!"
echo ""
echo "📚 Available commands:"
echo " init-project <name> - Initialize a new project with git remote"
echo " cd ~/.homelab-agents - Browse agents and scripts"
echo ""
echo "📋 Agent location: $AGENTS_DIR/agents/sysadmin-session-closer.md"