# SurfAI

🏄 **Natural Language Browser Automation**

Say what you want, SurfAI does the browsing.

## Quick Start

```bash
# Install
pip install surfai

# Configure your LLM (choose one)
surfai config --model kimi --key sk-your-kimi-key
surfai config --model deepseek --key sk-your-deepseek-key

# Start automating
surfai "Go to GitHub and find the most starred Python project"
```

## Features

- 🎯 **Zero Code**: Just say what you want in natural language
- 🤖 **Multi-LLM**: Supports Kimi, DeepSeek, OpenAI, Gemini
- 🔒 **Local First**: Runs on your machine, data stays private
- 📸 **Screenshots**: Capture pages automatically
- 📊 **Data Export**: Save results to CSV, JSON, Excel

## Supported Models

| Model | Provider | Setup |
|-------|----------|-------|
| Kimi | Moonshot | `surfai config --model kimi --key sk-xxx` |
| DeepSeek | DeepSeek | `surfai config --model deepseek --key sk-xxx` |
| GPT-4o | OpenAI | `surfai config --model openai --key sk-xxx` |
| Gemini | Google | `surfai config --model gemini --key xxx` |

## Usage Examples

### Command Line

```bash
# Extract data
surfai "Go to example.com and get all product prices"

# Take screenshot
surfai "Open github.com/microsoft and take a screenshot"

# Complex task
surfai "Search for 'Python tutorials' on Google, open the first result, summarize the content"
```

### Python API

```python
import asyncio
from surfai import Browser

async def main():
    async with Browser() as browser:
        await browser.goto("https://github.com/openclaw/openclaw")
        stars = await browser.extract("stars count")
        print(f"Stars: {stars}")
        await browser.screenshot("openclaw.png")

asyncio.run(main())
```

## Configuration

Configuration is stored in `~/.surfai/config.json`:

```json
{
  "default_model": "kimi",
  "models": {
    "kimi": {
      "api_key": "sk-xxx",
      "base_url": "https://api.moonshot.cn/v1"
    },
    "deepseek": {
      "api_key": "sk-xxx",
      "base_url": "https://api.deepseek.com/v1"
    }
  }
}
```

## License

MIT License - see LICENSE file for details.
