# IDE Bridge Quick Start Guide

Get Task-engine working with your IDE's built-in AI agent in just a few minutes!

## 🚀 Quick Setup (3 steps)

### 1. Check Prerequisites

```bash
task-master migrate-to-ide --check-prereqs
```

This will verify:
- ✅ Node.js version (>=18)
- ✅ WebSocket package installed
- ✅ Task-engine configuration exists
- ✅ IDE detection working

### 2. Run Migration

```bash
task-master migrate-to-ide
```

Follow the interactive wizard to:
- Choose migration mode (gradual recommended)
- Auto-detect your IDE (Cursor, VS Code, Windsurf)
- Configure WebSocket bridge
- Start bridge server automatically

### 3. Test Your Setup

```bash
task-master generate-text "Hello from my IDE!"
```

If successful, you'll see a response generated by your IDE's AI agent!

## 🎯 Migration Modes

### Gradual (Recommended)
- ✅ IDE as primary AI
- ✅ External APIs as fallback
- ✅ Safe transition
- ✅ Easy rollback

### Complete
- ✅ IDE only, no external APIs
- ✅ Zero cost
- ✅ Full independence
- ⚠️ No fallback

### IDE-First
- ✅ IDE for main tasks only
- ✅ External APIs for research/fallback
- ✅ Hybrid approach

## 🔧 Common Commands

```bash
# Check migration status
task-master migrate-to-ide --status

# Start bridge server
npm run bridge-start

# Check bridge status
npm run bridge-status

# Stop bridge server
npm run bridge-stop

# Rollback migration
task-master migrate-to-ide --rollback

# Check bridge health
npm run bridge-health
```

## 🆘 Troubleshooting

### Bridge Won't Start
```bash
# Check if port is in use
lsof -i :8765

# Try different port
# Edit .taskmaster/bridge-config.json
{
  "bridge": {
    "port": 8766
  }
}
```

### IDE Not Detected
```bash
# Manual detection
npm run bridge-detect

# Set IDE type manually
# Edit .taskmaster/bridge-config.json
{
  "ide": {
    "type": "cursor"  # or vscode, windsurf
  }
}
```

### Connection Issues
```bash
# Check bridge logs
npm run bridge-logs

# Restart bridge
npm run bridge-restart

# Test connection
task-master generate-text "test"
```

## 🎉 Success Indicators

✅ **Bridge Status**: `npm run bridge-status` shows "running: true"
✅ **IDE Detection**: Shows your IDE type (cursor/vscode/windsurf)
✅ **Migration Status**: `task-master migrate-to-ide --status` shows "Migrated: ✅"
✅ **Text Generation**: `task-master generate-text "test"` works without API keys

## 📚 Next Steps

- **Explore Features**: Try `task-master parse-prd`, `task-master add-task`, etc.
- **Configure Models**: Run `task-master models` to see available options
- **Read Full Docs**: See `docs/ide-bridge.md` for advanced configuration
- **Join Community**: Share your experience and get help

## 🔄 Rollback Anytime

If you need to go back to external APIs:

```bash
task-master migrate-to-ide --rollback
```

This will:
- ✅ Restore original configuration
- ✅ Stop bridge server
- ✅ Re-enable external API providers
- ✅ Keep your backup safe

---

**Need Help?** Check the full documentation in `docs/ide-bridge.md` or open an issue on GitHub.

**Working?** Great! You're now running Task-engine completely independently from external API providers! 🎉
