beads/examples/git-hooks/install.sh
Steve Yegge 19cd7d1887 Prepare for public launch: comprehensive examples, docs, and tooling
This commit adds everything needed for a successful public launch:

**New Documentation**
- SECURITY.md: Security policy and best practices
- CLAUDE.md: Complete agent instructions for contributing to beads
- Enhanced README with pain points, FAQ, troubleshooting sections
- Added Taskwarrior to comparison table with detailed explanation

**Installation**
- install.sh: One-liner installation script with platform detection
- Auto-detects OS/arch, tries go install, falls back to building from source
- Updated README with prominent installation instructions

**Examples** (2,268+ lines of working code)
- examples/python-agent/: Full Python implementation of agent workflow
- examples/bash-agent/: Shell script agent with colorized output
- examples/git-hooks/: Pre-commit, post-merge, post-checkout hooks with installer
- examples/claude-desktop-mcp/: Documentation for future MCP server integration
- examples/README.md: Overview of all examples

**Dogfooding**
- Initialized bd in beads project itself (.beads/beads.db)
- Created issues for roadmap (MCP server, migrations, demos, 1.0 milestone)
- Exported to .beads/issues.jsonl for git versioning

**Visual Assets**
- Added screenshot showing agent using beads to README intro
- Placed in .github/images/ following GitHub conventions

This addresses all launch readiness items:
✅ Security policy
✅ Working agent examples (Python, Bash)
✅ Git hooks for automation
✅ FAQ addressing skeptics
✅ Troubleshooting common issues
✅ Easy installation
✅ Dogfooding our own tool
✅ Pain points that create urgency

Ready to ship! 🚀

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 11:25:29 -07:00

83 lines
2.4 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# Install Beads git hooks
#
# This script copies the hooks to .git/hooks/ and makes them executable
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
HOOKS_DIR="$(git rev-parse --git-dir)/hooks"
# Check if we're in a git repository
if ! git rev-parse --git-dir &> /dev/null; then
echo "Error: Not in a git repository"
exit 1
fi
echo "Installing Beads git hooks to $HOOKS_DIR"
echo ""
# Install pre-commit hook
if [[ -f "$HOOKS_DIR/pre-commit" ]]; then
echo "⚠ $HOOKS_DIR/pre-commit already exists"
read -p "Overwrite? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Skipping pre-commit"
else
cp "$SCRIPT_DIR/pre-commit" "$HOOKS_DIR/pre-commit"
chmod +x "$HOOKS_DIR/pre-commit"
echo "✓ Installed pre-commit hook"
fi
else
cp "$SCRIPT_DIR/pre-commit" "$HOOKS_DIR/pre-commit"
chmod +x "$HOOKS_DIR/pre-commit"
echo "✓ Installed pre-commit hook"
fi
# Install post-merge hook
if [[ -f "$HOOKS_DIR/post-merge" ]]; then
echo "⚠ $HOOKS_DIR/post-merge already exists"
read -p "Overwrite? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Skipping post-merge"
else
cp "$SCRIPT_DIR/post-merge" "$HOOKS_DIR/post-merge"
chmod +x "$HOOKS_DIR/post-merge"
echo "✓ Installed post-merge hook"
fi
else
cp "$SCRIPT_DIR/post-merge" "$HOOKS_DIR/post-merge"
chmod +x "$HOOKS_DIR/post-merge"
echo "✓ Installed post-merge hook"
fi
# Install post-checkout hook
if [[ -f "$HOOKS_DIR/post-checkout" ]]; then
echo "⚠ $HOOKS_DIR/post-checkout already exists"
read -p "Overwrite? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Skipping post-checkout"
else
cp "$SCRIPT_DIR/post-checkout" "$HOOKS_DIR/post-checkout"
chmod +x "$HOOKS_DIR/post-checkout"
echo "✓ Installed post-checkout hook"
fi
else
cp "$SCRIPT_DIR/post-checkout" "$HOOKS_DIR/post-checkout"
chmod +x "$HOOKS_DIR/post-checkout"
echo "✓ Installed post-checkout hook"
fi
echo ""
echo "✓ Beads git hooks installed successfully!"
echo ""
echo "These hooks will:"
echo " • Export issues to JSONL before every commit"
echo " • Import issues from JSONL after merges"
echo " • Import issues from JSONL after branch checkouts"
echo ""
echo "To uninstall, simply delete the hooks from $HOOKS_DIR"