This guide enables you to add Piper Morgan to your Mac dock for one-click startup, making your daily 6:00 AM PT standup routine seamless and frictionless.
First, create the startup script in your Piper Morgan directory:
# Navigate to your Piper Morgan directory
cd /path/to/piper-morgan
# Create the startup script
cat > start-piper.sh << 'EOF'
#!/bin/bash
# Piper Morgan One-Click Startup Script
# Version: 1.0.0
# Purpose: Launch Piper Morgan with health checks
set -e # Exit on any error
echo "π Starting Piper Morgan..."
echo "================================"
# Check if Docker Desktop is running
if ! docker info > /dev/null 2>&1; then
echo "β Docker Desktop is not running"
echo "Please start Docker Desktop and try again"
echo "You can find Docker Desktop in your Applications folder"
exit 1
fi
echo "β
Docker Desktop is running"
# Check if we're in the right directory
if [ ! -f "main.py" ] || [ ! -f "web/app.py" ]; then
echo "β Not in Piper Morgan directory"
echo "Please navigate to your piper-morgan directory and try again"
exit 1
fi
echo "β
Piper Morgan directory confirmed"
# Activate virtual environment
if [ -d "venv" ]; then
echo "π§ Activating virtual environment..."
source venv/bin/activate
echo "β
Virtual environment activated"
else
echo "β Virtual environment not found"
echo "Please run: python -m venv venv && source venv/bin/activate"
exit 1
fi
# Check Python dependencies
echo "π Checking Python dependencies..."
if ! python -c "import services" > /dev/null 2>&1; then
echo "β Python dependencies not installed"
echo "Please run: pip install -r requirements.txt"
exit 1
fi
echo "β
Python dependencies verified"
# Start backend services
echo "π Starting backend services..."
echo "Starting main.py in background..."
nohup python main.py > logs/backend.log 2>&1 &
BACKEND_PID=$!
echo "Backend PID: $BACKEND_PID"
# Wait for backend to start
echo "β³ Waiting for backend to start..."
sleep 5
# Check backend health
if curl -s http://localhost:8001/health > /dev/null 2>&1; then
echo "β
Backend is healthy"
else
echo "β Backend health check failed"
echo "Check logs/backend.log for details"
exit 1
fi
# Start frontend
echo "π Starting frontend..."
echo "Starting web/app.py..."
nohup python web/app.py > logs/frontend.log 2>&1 &
FRONTEND_PID=$!
echo "Frontend PID: $FRONTEND_PID"
# Wait for frontend to start
echo "β³ Waiting for frontend to start..."
sleep 3
# Check frontend health
if curl -s http://localhost:8081/health > /dev/null 2>&1; then
echo "β
Frontend is healthy"
else
echo "β Frontend health check failed"
echo "Check logs/frontend.log for details"
exit 1
fi
# Create PID file for management
echo "$BACKEND_PID" > .piper-backend.pid
echo "$FRONTEND_PID" > .piper-frontend.pid
echo "π Piper Morgan is ready!"
echo "================================"
echo "π Frontend: http://localhost:8081/"
echo "π§ Backend: http://localhost:8001/"
echo "π Health: http://localhost:8081/health"
echo ""
echo "π‘ Tip: Bookmark http://localhost:8081/ for quick access"
echo "π To stop: ./stop-piper.sh"
echo ""
echo "π Ready for your 6:00 AM PT standup!"
# Open browser
open http://localhost:8081/
EOF
# Make the script executable
chmod +x start-piper.sh
Create a companion stop script for clean shutdown:
# Create the stop script
cat > stop-piper.sh << 'EOF'
#!/bin/bash
# Piper Morgan Stop Script
# Version: 1.0.0
# Purpose: Clean shutdown of Piper Morgan services
echo "π Stopping Piper Morgan..."
echo "================================"
# Stop backend
if [ -f ".piper-backend.pid" ]; then
BACKEND_PID=$(cat .piper-backend.pid)
if kill -0 $BACKEND_PID 2>/dev/null; then
echo "π Stopping backend (PID: $BACKEND_PID)..."
kill $BACKEND_PID
echo "β
Backend stopped"
else
echo "βΉοΈ Backend already stopped"
fi
rm -f .piper-backend.pid
else
echo "βΉοΈ No backend PID file found"
fi
# Stop frontend
if [ -f ".piper-frontend.pid" ]; then
FRONTEND_PID=$(cat .piper-frontend.pid)
if kill -0 $FRONTEND_PID 2>/dev/null; then
echo "π Stopping frontend (PID: $FRONTEND_PID)..."
kill $FRONTEND_PID
echo "β
Frontend stopped"
else
echo "βΉοΈ Frontend already stopped"
fi
rm -f .piper-frontend.pid
else
echo "βΉοΈ No frontend PID file found"
fi
# Clean up any remaining processes
echo "π§Ή Cleaning up..."
pkill -f "python main.py" 2>/dev/null || true
pkill -f "python web/app.py" 2>/dev/null || true
echo "β
Piper Morgan stopped successfully"
echo "================================"
EOF
# Make the stop script executable
chmod +x stop-piper.sh
# Create logs directory
mkdir -p logs
echo "β
Logs directory created"
start-piper.sh file to your Mac dockFor a more professional appearance, create an application bundle:
# Create application bundle
mkdir -p "Piper Morgan.app/Contents/MacOS"
mkdir -p "Piper Morgan.app/Contents/Resources"
# Copy startup script to bundle
cp start-piper.sh "Piper Morgan.app/Contents/MacOS/Piper Morgan"
# Make executable
chmod +x "Piper Morgan.app/Contents/MacOS/Piper Morgan"
# Create Info.plist
cat > "Piper Morgan.app/Contents/Info.plist" << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>Piper Morgan</string>
<key>CFBundleIdentifier</key>
<string>com.piper-morgan.startup</string>
<key>CFBundleName</key>
<string>Piper Morgan</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>10.15</string>
</dict>
</plist>
EOF
echo "β
Application bundle created"
# Test the startup script
./start-piper.sh
# Verify services are running
curl http://localhost:8081/health
curl http://localhost:8001/health
# Test the stop script
./stop-piper.sh
# For application bundle
cp your-icon.icns "Piper Morgan.app/Contents/Resources/AppIcon.icns"
# Update Info.plist to reference the icon
# Add this to Info.plist:
# <key>CFBundleIconFile</key>
# <string>AppIcon.icns</string>
The dock icon can show a badge indicating system status:
# Error: Docker Desktop is not running
# Solution: Start Docker Desktop from Applications folder
open -a Docker
# Error: Port 8081 or 8000 already in use
# Solution: Stop existing services
./stop-piper.sh
# Or find and kill processes using the ports
lsof -ti:8081 | xargs kill -9
lsof -ti:8000 | xargs kill -9
# Error: Virtual environment not found
# Solution: Recreate virtual environment
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Error: Permission denied on startup script
# Solution: Make script executable
chmod +x start-piper.sh
chmod +x stop-piper.sh
Check logs for detailed error information:
# Backend logs
tail -f logs/backend.log
# Frontend logs
tail -f logs/frontend.log
# System logs
tail -f /var/log/system.log | grep -i piper
# Check service status
curl http://localhost:8081/health
curl http://localhost:8001/health
# Check process status
ps aux | grep -E "(main.py|app.py)"
# Check port usage
lsof -i :8081
lsof -i :8001
./stop-piper.sh# Quick restart for development
./stop-piper.sh && sleep 2 && ./start-piper.sh
# Update Piper Morgan
git pull origin main
# Update dependencies
source venv/bin/activate
pip install -r requirements.txt
# Test startup
./stop-piper.sh
./start-piper.sh
# Rotate logs weekly
find logs/ -name "*.log" -mtime +7 -delete
# Check system health
./start-piper.sh --health-check-only
# Monitor resource usage
top -pid $(cat .piper-backend.pid) -pid $(cat .piper-frontend.pid)
Status: β Ready for Production Use Last Updated: September 10, 2025 Version: 2.0.0 - Enhanced for Issue #163 startup process changes Next Review: September 17, 2025
8000 to 8001python web/app.py to uvicorn app:app --port 8081GITHUB_TOKEN preservation for subprocess inheritanceGITHUB_TOKEN and other critical environment variables