Telegram-Controlled File Management Engine
Project description
๐๏ธ Doit โ Telegram-Controlled Local Automation Engine
Doit is a production-grade open-source automation agent that runs silently on your laptop and executes real OS-level tasks โ controlled entirely through Telegram.
No GUI. No web dashboard. No daily terminal usage. Just Telegram.
Features
| Category | Capabilities |
|---|---|
| File System | Create, read, write, delete, move, copy, search, compress, extract, organize, backup, clean |
| System | CPU/RAM/disk monitoring, process management, shutdown/restart/sleep |
| Network | Download files, ping, HTTP requests, URL uptime monitoring |
| Scheduler | Natural language + cron scheduling, persistent, crash-recoverable |
| Security | Single-user auth, encrypted config, injection protection, tool sandboxing |
| Resilience | Crash recovery, network loss tolerance, power-loss recovery, auto-restart |
| Plugins | Dynamic discovery, sandboxed execution, documented API |
| Observability | Status, tasks, logs, health, audit export (JSON/CSV) |
Quick Start
pip install doit-agent
doit init
The wizard walks you through:
- Trust grant (one-time)
- AI provider & model selection
- Telegram bot setup
- Auto-start service installation
After setup: just talk to your bot.
Usage (via Telegram)
list files in ~/Downloads
download https://example.com/report.pdf to ~/Desktop
backup ~/Documents to ~/Backups every day at 9am
show system health
kill process 12345
organize ~/Downloads
compress ~/Projects/myapp to ~/Backups/myapp.zip
safe mode โ pause all execution
resume โ resume execution
/status โ agent status
/tasks โ recent tasks
/health โ system resources
/logs โ recent log entries
/export json โ download audit log
Architecture
doit/
โโโ cli/ # Bootstrap, onboarding wizard, CLI commands
โโโ core/ # Config, constants, cross-platform paths
โโโ ai/ # Multi-provider AI intent engine
โโโ telegram_bot/ # Telegram interface, auth, injection guard
โโโ tools/ # Tool registry + all tool implementations
โโโ task_engine/ # Async queue, workers, retry, resource guard
โโโ scheduler/ # Natural language + cron scheduler
โโโ security/ # Encryption, lock file, authorization
โโโ persistence/ # SQLite database (tasks, logs, config, audit)
โโโ plugins/ # Plugin system with dynamic discovery
โโโ services/ # OS service (systemd/LaunchAgent/Windows)
โโโ supervisor/ # Process supervision, crash recovery
โโโ logging_system/# Structured logging to file + DB
โโโ updates/ # Version check, safe update, rollback
AI Providers
| # | Provider | Best Models |
|---|---|---|
| 1 | NVIDIA NIM | Llama 3.3 70B, Nemotron Ultra 253B |
| 2 | Zhipu AI (z.ai) | GLM-4 Flash (free), GLM-4 Air |
| 3 | OpenAI | GPT-4o, GPT-4o Mini |
| 4 | Anthropic | Claude 3.5 Sonnet, Claude 3 Haiku |
| 5 | Ollama | Local models, fully offline |
| 6 | Custom | Any OpenAI-compatible endpoint |
Security Model
- Single authorized user โ only your Telegram user ID can send commands
- Encrypted config โ API keys and tokens stored with Fernet encryption
- Tool sandboxing โ AI can only invoke registered tools; no arbitrary code execution
- Injection protection โ pattern-based prompt injection detection
- Path/command blocklist โ system-critical paths and destructive commands blocked
- No inbound ports โ only outbound connections to Telegram API
- Audit trail โ every action logged to SQLite
Plugin API
Create a .py file in ~/.config/doit/plugins/:
PLUGIN_NAME = "my_plugin"
PLUGIN_VERSION = "1.0.0"
PLUGIN_DOIT_MIN_VERSION = "1.0.0"
PLUGIN_DESCRIPTION = "What this plugin does"
async def my_tool(arg1: str, count: int = 1, **kwargs) -> dict:
# Must return a dict
return {"result": f"Did {arg1} x{count}", "success": True}
TOOLS = [
("my_tool", "Description of my tool", my_tool, False), # (name, desc, fn, is_dangerous)
]
Restart Doit. Your tool is now available to the AI.
CLI Commands
doit init # Run onboarding wizard
doit run # Start agent (used by OS service)
doit update # Check and install updates
doit status # Check if service is running
doit uninstall # Remove service and optionally data
Resilience
| Scenario | Behavior |
|---|---|
| Process crash | OS service auto-restarts; pending tasks recovered from DB |
| Network loss | Exponential backoff retry; never exits |
| Power loss | OS auto-start re-launches; state fully restored from SQLite |
| SIGTERM | Finish running tasks, persist state, close DB cleanly |
| AI unavailable | Notify user, retry with backoff, use fallback model |
| Resource overload | Delay task execution until CPU/RAM within limits |
Database Schema
SQLite at ~/.config/doit/data/doit.db:
tasksโ all task executions with status, payload, result, retry countschedulesโ persistent schedules with next_run computationlogsโ structured application logsaudit_logโ tamper-evident audit trailconfigโ runtime configurationplugin_registryโ installed pluginsmigrationsโ schema version history
Requirements
- Python 3.10+
- A Telegram bot token (free, from @BotFather)
- An AI API key (NVIDIA, Zhipu, OpenAI, Anthropic) OR Ollama running locally
License
MIT โ free to use, modify, and distribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file doit_fm-1.0.0.tar.gz.
File metadata
- Download URL: doit_fm-1.0.0.tar.gz
- Upload date:
- Size: 47.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f946d78e57a3e9c6d4ee61c1075baf1873e7e25b89c796b0d087aa6bb5d7e0d
|
|
| MD5 |
25da0e2ffe06a845de5e1ed4d750e045
|
|
| BLAKE2b-256 |
b46055823934fa0431d1e83ece56f86adfb657bcbacdfce9229ecc2c268a2a98
|
File details
Details for the file doit_fm-1.0.0-py3-none-any.whl.
File metadata
- Download URL: doit_fm-1.0.0-py3-none-any.whl
- Upload date:
- Size: 49.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0de237b99ec07a72354214d63b2148e18087c4b4d63f0ae482b5eac26eb8c555
|
|
| MD5 |
9d85f210db93346dd61a5e70ad98dd67
|
|
| BLAKE2b-256 |
6d39d078404934da867ac2ed436179f401e10e79cec6440d629dc168b243564b
|