Skip to content

CodePhyt/LinkedIn-Autopilot

Repository files navigation

GhostLink - The Autonomous LinkedIn Agent

A local-first, full-stack application that automates LinkedIn engagement using your existing Chrome browser session via Remote Debugging Port.

🚀 Features

  • Browser Connection: Connects to existing Chrome session (no login needed)
  • Stealth Mechanics: Human-like behavior with random delays, mouse movements, and scrolling
  • Auto Engagement: Automatically likes and comments on posts
  • Connection Management: Sends personalized connection requests
  • Inbox Handling: Reads and drafts replies to messages using AI
  • Safety Limits: Daily action limits to prevent bans
  • Real-time Dashboard: Flutter desktop app with live terminal and safety gauges

📋 Prerequisites

  1. Python 3.12+
  2. Flutter SDK (for desktop support)
  3. Chrome/Chromium with remote debugging enabled
  4. Google Gemini API Key

🛠️ Setup

1. Start Chrome with Remote Debugging

# Windows
chrome.exe --remote-debugging-port=9222

# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

# Linux
google-chrome --remote-debugging-port=9222

2. Backend Setup

cd backend
pip install -r requirements.txt
playwright install chromium

# Set your Gemini API key
export GEMINI_API_KEY=your_api_key_here
# Or create a .env file with GEMINI_API_KEY=your_api_key_here

# Run the backend
python main.py

The backend will start on http://localhost:8000

3. Frontend Setup

cd frontend
flutter pub get
flutter run -d windows  # or -d macos, -d linux

📁 Project Structure

LinkedIn Autopilot/
├── backend/
│   ├── browser_manager.py      # Browser CDP connection
│   ├── humanizer.py            # Stealth mechanics
│   ├── ai_service.py           # Gemini AI integration
│   ├── feed_scanner.py         # LinkedIn feed scanning
│   ├── auto_engager.py         # Auto like/comment
│   ├── connection_manager.py   # Connection requests
│   ├── inbox_handler.py        # Message handling
│   ├── daily_limit_service.py  # Safety limits
│   ├── main.py                 # FastAPI application
│   ├── database/
│   │   ├── models.py           # SQLAlchemy models
│   │   └── database.py         # Database setup
│   └── requirements.txt
├── frontend/
│   ├── lib/
│   │   ├── main.dart           # Flutter app entry
│   │   ├── screens/
│   │   │   └── dashboard_screen.dart
│   │   ├── widgets/
│   │   │   ├── terminal_widget.dart
│   │   │   ├── control_panel_widget.dart
│   │   │   └── safety_gauge_widget.dart
│   │   └── providers/
│   │       ├── websocket_provider.dart
│   │       └── api_provider.dart
│   └── pubspec.yaml
└── README.md

🎮 Usage

  1. Start Chrome with remote debugging (port 9222)
  2. Log into LinkedIn in that Chrome window
  3. Start the backend: python backend/main.py
  4. Start the frontend: flutter run from the frontend directory
  5. Use the dashboard to:
    • View real-time logs in the terminal
    • Toggle auto-engagement features
    • Start agent tasks (Engage Feed, Check Inbox)
    • Monitor safety limits

⚙️ Configuration

Daily Limits (in daily_limit_service.py)

  • Max Connects: 20/day
  • Max Likes: 50/day
  • Max Comments: 30/day
  • Max Messages: 10/day

AI Settings

The AI service uses Google Gemini 1.5 Flash for:

  • Generating comments on posts
  • Creating personalized connection notes
  • Drafting message replies (with RAG from resume.txt)

🔒 Safety Features

  • Daily Limits: Prevents exceeding LinkedIn's rate limits
  • Human-like Behavior: Random delays, mouse movements, scrolling
  • Error Handling: Graceful handling of missing elements
  • Action Logging: All actions are logged to the database

📝 Notes

  • Resume.txt: Place a resume.txt file in the project root for RAG-based message replies
  • Database: SQLite database is created automatically in backend/database/ghostlink.db
  • WebSocket: Real-time logs are streamed via WebSocket to the Flutter frontend

⚠️ Disclaimer

This tool is for educational purposes. Use responsibly and in accordance with LinkedIn's Terms of Service. Automated actions may violate LinkedIn's policies.

🐛 Troubleshooting

Browser not connecting?

  • Make sure Chrome is running with --remote-debugging-port=9222
  • Check that port 9222 is not blocked by firewall

AI service not working?

  • Verify your GEMINI_API_KEY is set correctly
  • Check API quota limits

Flutter build errors?

  • Run flutter pub get to install dependencies
  • Ensure you have Flutter desktop support enabled

📄 License

This project is for educational purposes only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages