The error you encountered is now fixed. Here's how to proceed:
First, let's check if everything is set up correctly:
python troubleshoot-emad.pyThis will check:
- ✅ Python version compatibility
- ✅ Required packages installation
- ✅ File availability
- ✅ GitHub token configuration
- ✅ API connectivity
- ✅ File permissions
If diagnostics show missing packages, install them:
pip install requests pywin32Use the automated installer (run as Administrator):
Option A: Batch File (Recommended)
# Right-click Command Prompt -> "Run as administrator"
install-emad-service.batOption B: PowerShell
# Right-click PowerShell -> "Run as administrator"
.\install-emad-service.ps1Option C: Manual Installation
# Run as administrator
python emad-auto-sync-service.py install
python emad-auto-sync-service.py startThe original error occurred because:
- ❌ Python couldn't import
emad_auto_syncfromemad-auto-sync.py(hyphen vs underscore) - ✅ Fixed: Created
emad_auto_sync.pythat properly imports from the main script - ✅ Fixed: Updated service wrapper to use correct imports
- ✅ Fixed: Added automated installation scripts
If you prefer manual setup:
python --version
# Should show Python 3.7 or higherpip install requests pywin32python emad-auto-sync.py --test# Run as Administrator
python emad-auto-sync-service.py installpython emad-auto-sync-service.py startpython emad-auto-sync-service.py statusOnce installed, you can manage the service with:
# Start the service
python emad-auto-sync-service.py start
# Stop the service
python emad-auto-sync-service.py stop
# Check status
python emad-auto-sync-service.py status
# Remove service
python emad-auto-sync-service.py remove
# Run in debug mode (foreground)
python emad-auto-sync-service.py debug# View recent logs
type logs\emad-auto-sync-*.log
# Monitor logs in real-time (if you have tail)
tail -f logs\emad-auto-sync-*.log- Open Event Viewer (
eventvwr.msc) - Navigate to: Windows Logs → Application
- Look for "EMADAutoSync" entries
- Open Services (
services.msc) - Find "EMAD Auto-Sync Monitoring Service"
- Check status and configure startup type
Issue: Service won't install
# Solution: Run as Administrator
# Right-click Command Prompt → "Run as administrator"
python emad-auto-sync-service.py installIssue: Import errors
# Solution: Run diagnostics
python troubleshoot-emad.py
# Install missing packages
pip install requests pywin32Issue: GitHub authentication fails
# Solution: Check token in script or set environment variable
set GITHUB_TOKEN=your_token_here
python emad-auto-sync.py --testIssue: Permission denied
# Solution: Run as Administrator or check file permissions
# Ensure you have write access to the BMAD-METHOD directoryIf the service isn't working, run in debug mode to see detailed output:
python emad-auto-sync-service.py debugThis runs the service in the foreground so you can see all log messages.
After setup, you should have:
BMAD-METHOD/
├── emad-auto-sync.py # Main monitoring script
├── emad_auto_sync.py # Python-compatible import module
├── emad-auto-sync-service.py # Windows service wrapper
├── install-emad-service.bat # Automated installer (batch)
├── install-emad-service.ps1 # Automated installer (PowerShell)
├── troubleshoot-emad.py # Diagnostic script
├── logs/ # Log files directory
│ ├── emad-auto-sync-*.log # Daily log files
│ └── emad-auto-sync-service.log
└── ... (other BMAD files)
After installation, verify everything works:
-
Check service status:
python emad-auto-sync-service.py status
-
Check logs:
type logs\emad-auto-sync-*.log -
Test GitHub connection:
python troubleshoot-emad.py
-
Monitor for changes:
- Make a small change to any file in BMAD-METHOD
- Wait for the next monitoring cycle (default: 1 hour)
- Check logs for sync activity
Once everything is working, you should see:
- ✅ Service running in Windows Services
- ✅ Log entries every hour showing monitoring activity
- ✅ Automatic PRs created when files change
- ✅ Repository stays synchronized with local changes
The EMAD Auto-Sync service will now continuously monitor your BMAD-METHOD directory and automatically sync any changes to your GitHub repository!
If you encounter any issues:
- Run diagnostics:
python troubleshoot-emad.py - Check logs: Look in the
logs/directory - Try debug mode:
python emad-auto-sync-service.py debug - Verify permissions: Ensure you're running as Administrator
The system is now fully automated and should work seamlessly in the background! 🚀✨