# 🤖 doit-fm

**Your AI-powered computer assistant — controlled entirely via Telegram.**

Just talk to it naturally. It does real things on your computer.

---

## Install in one line

```bash
pip install doit-fm
```

That's it. All dependencies install automatically — no manual `pip install` for anything.

---

## Set up in 2 minutes

```bash
doitfm init
```

The wizard walks you through everything step by step:
1. Picks and installs any missing dependencies automatically
2. Connects your AI provider (OpenAI, Claude, Gemini, free options, or local Ollama)
3. Creates a Telegram bot (takes ~30 seconds via @BotFather)
4. Installs an auto-start service so it runs on boot

Then open Telegram and just **talk**:

---

## Just say what you want

No commands to memorize. No technical jargon. Just plain English.

| What you say | What happens |
|---|---|
| *"show me what's in my Downloads folder"* | Lists your files |
| *"find my resume"* | Searches your whole computer |
| *"what's taking up space on my disk?"* | Shows disk usage |
| *"backup my Documents folder"* | Creates a timestamped backup |
| *"remind me in 30 minutes"* | Sets a desktop notification |
| *"what's the weather in Tokyo?"* | Gets live weather |
| *"translate 'hello world' to Spanish"* | Instant translation |
| *"take a screenshot"* | Captures and sends it to you |
| *"turn the volume to 40%"* | Sets system volume |
| *"run my tests and tell me if they pass"* | Runs pytest/jest |
| *"commit everything in my project"* | Does git add + commit + push |
| *"remember that my server is 10.0.0.5"* | Stores for later recall |
| *"search the web for Python tutorials"* | Live web search |
| *"install ffmpeg"* | Runs package manager |
| *"how's my computer doing?"* | CPU/RAM/disk health check |
| *"backup my Documents every day at 9am"* | Sets recurring schedule |

---

## What it can do

### 📁 Files & Folders
List, read, write, search, move, copy, delete, compress, extract, organize by type,
find duplicates, backup, diff files, recursive search by content.

### 💻 Your Computer
CPU/RAM/disk/network monitor, process list + kill, battery status, system info,
environment variables, shutdown/restart/sleep (with confirmation).

### 🌐 Internet & Web
Download files, search the web (DuckDuckGo), scrape pages, ping hosts,
monitor websites, make HTTP requests, send webhooks.

### 🖥 Desktop Automation
Open apps, take screenshots, read/write clipboard, type text, keyboard shortcuts,
volume control, text-to-speech notifications, desktop alerts.

### 📅 Scheduling
Natural language schedules: *"every day at 9am"*, *"every Monday"*, *"in 30 minutes"*.
Auto-backups, reminders, recurring tasks — all managed via Telegram.

### 🧠 Memory & Notes
Long-term memory that survives restarts (*"remember that..."*),
Markdown notes (*"make a note about..."*), to-do list with priorities.

### 🛠 Developer Tools
Git (status, commit, push, pull, log, diff, clone), Docker (list, start, stop, exec, logs),
run tests, lint, format, build — auto-detects your tools (pytest, jest, ruff, eslint...).

### 📦 Packages
Install/uninstall/search packages — auto-detects apt, brew, pip, npm, cargo, winget.

### 🔒 SSH & SFTP
Run commands on remote servers, upload/download files via SFTP.

### 📄 File Processing
PDF text extraction, PDF merge, image resize, CSV summarize,
JSON path query, SHA-256/MD5 hash, QR code generation.

### 🔐 Secrets Keychain
Securely store API keys and passwords (`secret_set`/`secret_get`) —
AES-256 encrypted, never shown in logs.

### 🎯 Utilities
Calculator (full math expressions), currency/unit conversion, weather (no API key needed),
translation (no API key needed), QR code generator.

---

## Telegram commands

| Command | Does |
|---|---|
| `/help` | Everything I can do, explained in plain English |
| `/health` | CPU, RAM, disk, battery at a glance |
| `/tasks` | Recent task history |
| `/memory` | Things I've remembered |
| `/tools` | Full list of 97+ capabilities |
| `/clear` | Reset conversation context |
| `/run <cmd>` | Direct shell command |
| `/safe` | Pause execution (safe mode) |
| `/resume` | Resume execution |
| `/cancel` | Cancel pending tasks |
| `/status` | Agent status |

---

## AI Providers

Works with any provider — use whatever you already have:

| Provider | Free Tier | Notes |
|---|---|---|
| **NVIDIA NIM** | ✅ Free | Llama 3.1, Mistral, etc. |
| **Zhipu AI** | ✅ Free | GLM-4 models |
| **OpenAI** | ❌ Paid | GPT-4o, GPT-4o-mini |
| **Anthropic** | ❌ Paid | Claude 3.5 Sonnet |
| **Google** | ✅ Free tier | Gemini Pro |
| **Ollama** | ✅ Fully free | 100% local, no internet |
| **Any OpenAI-compatible** | varies | Custom endpoint |

---

## Requirements

- Python 3.10 or newer
- Internet connection (for AI and Telegram)
- A Telegram account (free)
- An AI API key (free options available)

**All Python dependencies install automatically** when you run `pip install doit-fm`.

---

## More commands

```bash
doitfm init              # First-time setup wizard
doitfm run               # Start the agent
doitfm status            # Check if running
doitfm stop              # Stop the agent
doitfm update            # Update to latest version
doitfm doctor            # Diagnose + auto-fix problems
doitfm uninstall         # Remove service
doitfm uninstall --purge # Remove everything including data
```

---

## Privacy & Security

- **Single-user**: only your Telegram ID can control the agent
- **Encrypted config**: API keys and secrets stored with AES-256 (Fernet)
- **No cloud sync**: everything runs locally on your machine
- **Dangerous operations** (delete, shutdown, kill) require your explicit confirmation
- **Injection protection**: guards against prompt injection attacks
- **Path blocklist**: can't touch `/etc`, `/boot`, `/sys`, `/proc`
- **Audit log**: every action logged to a local SQLite database

---

## Plugin system

Drop a `.py` file into `~/.config/doit-fm/plugins/` and your custom tools appear
automatically in the AI's context. No restart needed.

---

## License

MIT — free to use, modify and distribute.
