# Pi Bux - 24/7 Pi or Hermes Agent

**Run Pi or Hermes continuously on any VPS. Control from Telegram. Browse the web.**

Inspired by [browser-use/bux](https://github.com/browser-use/bux)

## Quick Start

### Install Pi (default)
```bash
curl -fsSL https://raw.githubusercontent.com/artale93/pi-bux/main/install.sh \
  | sudo PI_API_KEY=your_key bash
```

### Install Hermes (self-evolving agent)
```bash
curl -fsSL https://raw.githubusercontent.com/artale93/pi-bux/main/install.sh \
  | sudo PI_API_KEY=your_key AGENT=hermes bash
```

### With Telegram bot
```bash
curl -fsSL https://raw.githubusercontent.com/artale93/pi-bux/main/install.sh \
  | sudo PI_API_KEY=xxx TELEGRAM_BOT_TOKEN=yyy bash
```

## Choose Your Agent

| Agent | Description | Best For |
|-------|-------------|----------|
| **pi** | Standard Pi coding agent | General coding, debugging |
| **hermes** | Self-evolving with memory | Long-term projects, learning |

## What You Get

- ✅ **24/7 uptime** via systemd
- ✅ **Telegram control** (optional)
- ✅ **Browser harness** for web scraping
- ✅ **Persistent state** across reboots
- ✅ **$5/month** VPS cost

## Architecture

```
┌─────────────────────────────────────────────────┐
│  VPS ($5/mo)                                     │
│  ┌─────────────────────────────────────────────┐  │
│  │ systemd: pi-agent.service OR pi-hermes.service│  │
│  │   └─► pi/hermes run --continuous            │  │
│  └─────────────────────────────────────────────┘  │
│  ┌─────────────────────────────────────────────┐  │
│  │ telegram-bot.service (optional)             │  │
│  │   └─► Messages → Agent commands            │  │
│  └─────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────┘
```

## Requirements

- Ubuntu 22.04+ VPS (≥2GB RAM)
- Pi API key
- Optional: Telegram bot token

## Commands

```bash
# Check status
systemctl status pi-agent
systemctl status pi-hermes

# View logs
journalctl -u pi-agent -f
journalctl -u pi-hermes -f

# Restart
systemctl restart pi-agent
systemctl restart pi-hermes

# Uninstall
curl -fsSL https://raw.githubusercontent.com/artale93/pi-bux/main/scripts/uninstall.sh | sudo bash
```

## Telegram Bot Commands

- `/start` - Welcome
- `/status` - Check agent status
- `/memory` - Memory usage
- `/uptime` - How long running
- `/help` - Show commands

## Docs

- [install.sh](install.sh) - Installer script
- [systemd/](systemd/) - Service files
- [scripts/](scripts/) - Bot scripts