Metadata-Version: 2.4
Name: devin-agi
Version: 4.0.0
Summary: The most capable open-source autonomous AI agent — fully controls your OS, works with zero API keys
Author-email: Kevin Hamza <kevin.x.hamza@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/kevinhamza/Devin-4.0
Project-URL: Issues, https://github.com/kevinhamza/Devin-4.0/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools>=83.0.0
Requires-Dist: flask
Requires-Dist: flask-socketio
Requires-Dist: python-telegram-bot
Requires-Dist: requests
Requires-Dist: python-dotenv
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pyarrow
Requires-Dist: websockets
Requires-Dist: cmake
Requires-Dist: rich
Requires-Dist: openai
Requires-Dist: anthropic
Requires-Dist: google-generativeai
Requires-Dist: prompt-toolkit
Requires-Dist: ollama
Requires-Dist: python3-xlib
Requires-Dist: easyocr
Requires-Dist: scikit-learn
Requires-Dist: spacy
Requires-Dist: torch
Requires-Dist: torchvision
Requires-Dist: torchaudio
Requires-Dist: ultralytics
Requires-Dist: Pillow
Requires-Dist: tiktoken
Requires-Dist: sentence-transformers
Requires-Dist: tweepy
Requires-Dist: praw
Requires-Dist: cryptography>=49.0.0
Requires-Dist: discord.py
Requires-Dist: slack-bolt
Requires-Dist: psutil
Requires-Dist: watchdog
Requires-Dist: pynput
Requires-Dist: selenium
Requires-Dist: playwright
Requires-Dist: pyautogui
Requires-Dist: mss
Requires-Dist: pygetwindow; sys_platform != "linux"
Requires-Dist: pycaw; sys_platform == "win32"
Requires-Dist: paramiko
Requires-Dist: boto3
Requires-Dist: google-cloud-storage
Requires-Dist: google-cloud-compute
Requires-Dist: pywin32; sys_platform == "win32"
Requires-Dist: SpeechRecognition
Requires-Dist: openai-whisper
Requires-Dist: PyAudio
Requires-Dist: pyttsx3
Requires-Dist: gtts
Requires-Dist: simpleaudio
Requires-Dist: pyserial
Requires-Dist: opencv-python
Requires-Dist: face_recognition
Requires-Dist: python-nmap
Requires-Dist: beautifulsoup4
Requires-Dist: scapy
Requires-Dist: pymetasploit3
Requires-Dist: tqdm
Requires-Dist: pyyaml
Requires-Dist: webdriver-manager
Requires-Dist: ppad
Requires-Dist: pure-python-adb
Requires-Dist: dataclasses
Requires-Dist: google-genai
Requires-Dist: hf_xet
Requires-Dist: GPUtil
Requires-Dist: qiskit
Requires-Dist: qiskit-aer
Requires-Dist: qiskit-algorithms
Requires-Dist: qiskit-machine-learning
Requires-Dist: liboqs-python
Requires-Dist: diffprivlib
Requires-Dist: presidio-analyzer
Requires-Dist: presidio-anonymizer
Requires-Dist: Faker
Requires-Dist: scipy
Requires-Dist: prometheus_client
Requires-Dist: geopy
Requires-Dist: tinytuya
Requires-Dist: stem
Requires-Dist: PySocks
Requires-Dist: googlesearch-python
Requires-Dist: numexpr
Requires-Dist: pytz
Requires-Dist: ccxt
Requires-Dist: pandas-ta; python_version >= "3.12"
Requires-Dist: reportlab
Dynamic: license-file

<div align="center">

<h1>🤖 Devin 4.0</h1>
<h3>The most capable open-source autonomous AI agent — fully controls your OS, works with zero API keys</h3>

[![CI](https://github.com/kevinhamza/Devin-4.0/actions/workflows/devin-ci.yml/badge.svg)](https://github.com/kevinhamza/Devin-4.0/actions/workflows/devin-ci.yml)
[![Security Scan](https://github.com/kevinhamza/Devin-4.0/actions/workflows/security-scan.yml/badge.svg)](https://github.com/kevinhamza/Devin-4.0/actions/workflows/security-scan.yml)
[![Python](https://img.shields.io/badge/Python-3.10%2B-blue?logo=python)](https://python.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE)
[![Stars](https://img.shields.io/github/stars/kevinhamza/Devin-4.0?style=social)](https://github.com/kevinhamza/Devin-4.0/stargazers)

<br/>

> **Works completely free — no API key required.**  
> Uses HuggingFace free tier or free-claude-code proxy automatically when no paid key is set.

</div>

---

## ⚡ Install

### pip install

```bash
pip install devin-agi
devin                  # starts immediately — no config needed
```

> Or directly from GitHub (no PyPI upload needed):
> ```bash
> pip install git+https://github.com/kevinhamza/Devin-4.0
> ```

### curl one-liner

```bash
curl -fsSL https://github.com/kevinhamza/Devin-4.0/raw/main/scripts/install.sh | sh
devin
```

Both put the `devin` command on your PATH. No `cd`, no venv activation.

### Add API keys (optional — works free without any)

After a pip or curl install, keys go in **`~/.devin/.env`**:

```bash
# ~/.devin/.env
HF_TOKEN=hf_...                 # free — huggingface.co/settings/tokens
GEMINI_API_KEY=AIza...          # free tier — aistudio.google.com
ANTHROPIC_API_KEY=sk-ant-...    # paid, best quality
OPENAI_API_KEY=sk-...           # paid
CLAUDE_SESSION_KEY=...          # free via fcc-server proxy (see below)
OLLAMA_BASE_URL=http://localhost:11434   # local, fully offline
```

Devin picks the best available key automatically. No key → falls back to HuggingFace free tier.

### Use FCC (free Claude proxy — no account needed)

```bash
# 1. Install fcc-server
curl -fsSL https://github.com/Alishahryar1/free-claude-code/raw/main/scripts/install.sh | sh

# 2. Start it
fcc-server &

# 3. Add your claude.ai session cookie to ~/.devin/.env
echo "CLAUDE_SESSION_KEY=your_cookie_here" >> ~/.devin/.env

# 4. Run Devin — it will use Claude for free
devin
```

---

## ⚡ Quick Start (manual clone)

### 1 — Clone & install

```bash
git clone https://github.com/kevinhamza/Devin-4.0
cd Devin-4.0
pip install -r requirements.txt
```

### 2 — Add an API key (optional — works without one)

```bash
cp .env.example .env
# Then open .env and paste at least one key, e.g.:
#   HF_TOKEN=hf_...          ← free at huggingface.co/settings/tokens
#   GEMINI_API_KEY=...        ← free tier at aistudio.google.com
#   ANTHROPIC_API_KEY=...     ← paid, best quality
```

### 3 — Run

```bash
# Interactive REPL (recommended)
python3 agent.py

# Or use the shell launcher (same thing, picks Python automatically)
chmod +x devin
./devin

# One-shot task — no REPL
python3 agent.py "open a browser and go to github.com"

# Headless / server (no display)
_HAS_DISPLAY=false python3 agent.py "scrape the top 10 Hacker News headlines"
```

> **Zero-key mode:** if no key is set, Devin falls back to the HuggingFace free tier automatically.

---

## 🧠 What Makes Devin Different

| Feature | Devin 4.0 | AutoGPT | Open Interpreter | Devin (commercial) |
|---|:---:|:---:|:---:|:---:|
| **Zero API key needed** | ✅ | ❌ | ❌ | ❌ |
| **Full OS mouse/keyboard control** | ✅ | ❌ | Partial | ✅ |
| **Screen vision (AI sees your screen)** | ✅ | ❌ | ❌ | ✅ |
| **Voice input + output** | ✅ | ❌ | ❌ | ❌ |
| **213 built-in tools** | ✅ | ~30 | ~20 | Unknown |
| **5 AI providers + auto-fallback** | ✅ | 1–2 | 1–2 | 1 |
| **110+ capability modules** | ✅ | ❌ | ❌ | ❌ |
| **Local LLM support (Ollama)** | ✅ | Partial | ✅ | ❌ |
| **Open source** | ✅ | ✅ | ✅ | ❌ |
| **Price** | **Free** | API cost | API cost | $500/mo |

---

## 🎯 What Devin Can Do

### 👁️ See & Understand
- Takes screenshots and analyzes them with AI vision
- Reads any UI element, window, dialog, or terminal output
- Identifies positions, text, and state of everything on screen

### 🖱️ Control Your Computer
- Clicks, types, scrolls, drags — full mouse + keyboard control
- Works on Linux (X11/Wayland), macOS, and Windows
- Opens and operates any GUI application

### 🌐 Automate the Web
- Full browser control via Playwright and Selenium
- Vision-guided element finding — no selectors needed
- Scrapes, fills forms, logs in, navigates complex SPAs

### 🗣️ Speak & Listen
- Text-to-speech (pyttsx3, gTTS, ElevenLabs)
- Speech-to-text via Whisper and SpeechRecognition
- Continuous voice command mode

### 💻 Write & Execute Code
- Python execution with live stdout capture
- Shell subprocess with timeout and safety checks
- Iterates until the code actually works

### 📁 Manage Everything
- Files: read, write, move, archive, diff, search
- Processes: list, kill, monitor, spawn
- Network: HTTP requests, scraping, API calls
- Databases: SQLite, query, CRUD

### 🔐 Security & Pentesting (Authorized Use)
- nmap, sqlmap, Metasploit integration
- Network analysis, vulnerability scanning
- Requires explicit authorization — refuses unauthorized use

---

## 🤖 AI Providers

Devin automatically picks the best available provider. Set any one key — or none.

| Priority | Provider | Variable | Free? | Best Model |
|:---:|---|---|:---:|---|
| 1 | **Anthropic Claude** | `ANTHROPIC_API_KEY` | No | claude-sonnet-5 |
| 2 | **Google Gemini** | `GEMINI_API_KEY` | Limited | gemini-2.5-flash |
| 3 | **OpenAI GPT** | `OPENAI_API_KEY` | No | gpt-4o |
| 4 | **HuggingFace** | `HF_TOKEN` | ✅ Yes | Qwen2.5-72B |
| 5 | **Ollama (local)** | `OLLAMA_BASE_URL` | ✅ Yes | llama3.1 |
| 6 | **Free Claude proxy** | `CLAUDE_SESSION_KEY` | ✅ Yes | claude-sonnet |

**Override:** `DEVIN_PROVIDER=huggingface python3 agent.py`

### Zero-Key Setup (Completely Free)

```bash
# Option A: HuggingFace free tier
HF_TOKEN=your_free_token  # get at huggingface.co/settings/tokens

# Option B: Free Claude proxy (no account needed)
# Install: curl -fsSL https://github.com/Alishahryar1/free-claude-code/raw/main/scripts/install.sh | sh
# Run in background: fcc-server
CLAUDE_SESSION_KEY=your_session_cookie

# Option C: Local Ollama (fully offline)
OLLAMA_BASE_URL=http://localhost:11434
```

---

## 🏗️ Architecture

```
┌─────────────────────────────────────────────────────────┐
│                      agent.py                           │
│              11,776 lines · 213 tools                   │
│                                                         │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐             │
│  │ AI Core  │  │ OS Layer │  │  Tools   │             │
│  │ 5 provs  │  │mouse/kbd │  │ 213 fns  │             │
│  │ fallback │  │ vision   │  │ REPL loop│             │
│  └──────────┘  └──────────┘  └──────────┘             │
└─────────────────────────────────────────────────────────┘
          ↕ graceful import (fails silently)
┌─────────────────────────────────────────────────────────┐
│                   modules/  (110+ files)                │
│                                                         │
│  browser     │ voice        │ os_agent    │ security    │
│  reasoning   │ web_scrape   │ analytics   │ automation  │
│  memory      │ social_media │ robotics    │ cloud       │
│  Gemini      │ OpenAI       │ HuggingFace │ Claude      │
│  + 70 more capability modules…                          │
└─────────────────────────────────────────────────────────┘
          ↕
┌─────────────────────────────────────────────────────────┐
│            src/  — TypeScript CLI (optional)            │
│   providers · memory · tools · voice · agents · ui     │
└─────────────────────────────────────────────────────────┘
```

---

## 📦 Project Structure

```
Devin-4.0/
├── agent.py           # Core runtime — 11,776 lines, 213 tools, 5 AI providers
├── main.py            # Entry point with dynamic module discovery
├── devin              # Shell launcher (chmod +x devin && ./devin)
├── modules/           # 110+ plug-in capability modules
│   ├── browser.py          # Playwright/Selenium browser control
│   ├── browser_agent.py    # Vision-guided autonomous browsing
│   ├── os_agent.py         # Full OS control (mouse, keyboard, screen)
│   ├── voice_engine.py     # Speech I/O
│   ├── reasoning_engine.py # Chain-of-thought planning
│   ├── free_claude_provider.py  # Zero-key Claude fallback
│   └── ...  (100+ more)
├── src/               # TypeScript CLI (optional alternative interface)
│   ├── providers/     # Claude · Gemini · OpenAI · HuggingFace · Ollama
│   ├── tools/         # Tool definitions and executors
│   ├── memory/        # SQLite conversation memory
│   └── ui/            # Terminal UI components
├── tests/             # 130 tests
├── .env.example       # All supported environment variables
└── requirements.txt   # Python dependencies
```

---

## 🖥️ Platform Support

| Platform | Status | Notes |
|---|:---:|---|
| **Linux** | ✅ Full | X11/Wayland or headless with `_HAS_DISPLAY=false` |
| **macOS** | ✅ Full | May need accessibility permissions |
| **Windows** | ✅ Full | PowerShell required for some features |

---

## 🛠️ Advanced Usage

```bash
# One-shot task
python3 agent.py "take a screenshot, describe what's on screen, and open a browser"

# Run the test suite
python3 agent.py --test

# Show all loaded capabilities
python3 main.py --caps

# Use a specific provider
DEVIN_PROVIDER=gemini python3 agent.py

# Headless (no display, e.g. CI/server)
_HAS_DISPLAY=false python3 agent.py "write and run a Python web scraper"

# TypeScript CLI (alternative interface)
npm install && npm run dev
```

### Useful `.env` Options

```bash
DEVIN_MODEL=claude-sonnet-5        # override model name
DEVIN_MAX_TOKENS=8192              # token limit per response
DEVIN_THINKING=true                # enable chain-of-thought reasoning
DEVIN_PERMISSION_MODE=auto_approve # auto-approve all tool calls
DEVIN_VOICE=true                   # enable voice I/O
DEVIN_VERBOSE=true                 # verbose logging
```

---

## 🔐 Security

Devin is built for **authorized use only**:

- Security and pentesting tools require explicit authorization in the conversation
- Unauthorized targeting, credential theft, persistence, and lateral movement are refused at the tool level
- API keys are never hard-coded — always loaded from `.env`
- `.env` is in `.gitignore` and must never be committed

---

## 🤝 Contributing

1. Fork the repo
2. Create a feature branch: `git checkout -b feature/my-feature`
3. Add your changes (a new module goes in `modules/`, register its tools in `agent.py`)
4. Run tests: `python3 agent.py --test`
5. Open a PR

See [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) for the full system design.

---

## 📄 License

MIT — free for personal and commercial use. See [`LICENSE`](LICENSE).

---

<div align="center">

**If Devin helped you — give it a ⭐ and share it.**  
[GitHub Issues](https://github.com/kevinhamza/Devin-4.0/issues) · [Discussions](https://github.com/kevinhamza/Devin-4.0/discussions)

</div>
