Skip to main content

A background AI agent that controls your computer via Telegram

Project description

doit-fm

A background AI agent that lets you control your computer via Telegram.

How it works

Telegram message → long-polling → AI model → structured JSON → OS tool → result → Telegram reply

You send a natural language message. The AI maps it to a tool + args. The tool runs as a real OS action. The result comes back to you in Telegram. In 2–5 seconds.

Install

pip install doit-fm

Or from source:

git clone <repo>
cd doit-fm
pip install -e .

Setup

doitfm init

The wizard walks you through:

  1. Checking dependencies
  2. Choosing AI provider + model (free options: Groq, OpenRouter, Ollama)
  3. Connecting your Telegram bot
  4. Sending a test message

Run

doitfm run

Background:

nohup doitfm run &

Commands

doitfm init     — Setup wizard
doitfm run      — Start the agent
doitfm stop     — Stop the agent
doitfm status   — Check if running
doitfm doctor   — Diagnostics

Telegram commands

/health         — CPU, RAM, disk, battery
/ps             — Running processes
/disk           — Disk partitions
/ip             — Public IP
/time           — Date and time
/weather <city> — Weather
/volume [0-100] — Get/set volume
/ls [path]      — List directory
/run <cmd>      — Shell command (with confirmation)
/notes          — List notes
/note <text>    — Save note
/clear          — Clear AI conversation memory
/status         — Agent status
/help           — Help

Or just talk naturally:

  • "how's my system?"
  • "what's the weather in Tokyo?"
  • "remind me to call John in 30 minutes"
  • "what's using all my CPU?"
  • "take a screenshot"
  • "what's my public IP?"
  • "calculate 847 * 23"

AI Providers

Provider Free tier Notes
Groq ✅ Yes Fast, free Llama/Mixtral
OpenRouter ✅ Yes Gemma 3, Llama 3.3 free
Ollama ✅ Local Fully offline
OpenAI ❌ Paid GPT-4o
Anthropic ❌ Paid Claude
Together AI ❌ Paid Various models

Tools

Tool Description Dangerous
system_health CPU, RAM, disk, battery No
list_processes Top processes by CPU No
kill_process Kill process by PID Yes
run_shell Execute shell command Yes
list_directory List files No
read_file Read text file No
write_file Write to file Yes
delete_file Delete file/dir Yes
move_file Move/rename Yes
copy_file Copy No
find_files Search by pattern No
ping Ping host No
get_public_ip Public IP No
dns_lookup DNS resolve No
http_get HTTP GET No
speedtest Speed test No
weather Weather by city No
get_volume Get volume No
set_volume Set volume No
screenshot Take screenshot No
get_clipboard Clipboard read No
set_clipboard Clipboard write No
set_reminder Set reminder No
get_datetime Date/time No
calculate Math expression No
add_note Save note No
list_notes Read notes No
open_app Launch app No
disk_usage Partition usage No
network_interfaces Network info No
shutdown Shutdown PC Yes
reboot Reboot PC Yes
sleep Suspend No
list_pip_packages pip list No

Security

  • Only your Telegram user ID can control the agent
  • All other messages are silently rejected
  • Dangerous tools require explicit tap-to-confirm via inline buttons
  • API key is encrypted at rest (Fernet symmetric encryption)
  • Encryption key stored at ~/.local/share/doit-fm/data/.enc_key (chmod 600)

Architecture

src/doitfm/
├── __init__.py   — package metadata
├── config.py     — constants, paths, provider registry
├── store.py      — encrypted config file (singleton)
├── tools.py      — 35 tool implementations + registry + dispatcher
├── ai.py         — AIEngine + ConversationMemory
├── bot.py        — TelegramAPI + TelegramBot
└── cli.py        — Click CLI

Adding a new tool

  1. Write an async function in tools.py — takes **kwargs, returns dict, never raises
  2. Add one entry to TOOLS dict
  3. Add one intent rule to the system prompt in ai.py
  4. Optionally add a slash command in bot.py

Adding a new AI provider

  1. Add entry to AI_PROVIDERS in config.py
  2. If not OpenAI-compatible, add a branch in AIEngine in ai.py

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doit_fm-3.0.6.tar.gz (37.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

doit_fm-3.0.6-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file doit_fm-3.0.6.tar.gz.

File metadata

  • Download URL: doit_fm-3.0.6.tar.gz
  • Upload date:
  • Size: 37.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for doit_fm-3.0.6.tar.gz
Algorithm Hash digest
SHA256 130cd0b3d9102e007f07708c1d2d70006e43857a9219c9d4304c1d86a6146238
MD5 cc393389a252ed390d768f435058283a
BLAKE2b-256 b06fb44a3c8d26c01713aa71e562d8345d4127b1121c5e443df64644995d0431

See more details on using hashes here.

File details

Details for the file doit_fm-3.0.6-py3-none-any.whl.

File metadata

  • Download URL: doit_fm-3.0.6-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for doit_fm-3.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2aad6f9922bae97b64210230519d88abd208936cddf3c96cd5b2bc00c25ba7a5
MD5 77600dda7c70f4e413855da6ce5c1b42
BLAKE2b-256 72840886c623a25b985f08d01f1c7d90f9b27d71b62bcc6483d3c93e76aea84a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page