Personal Assistant v2 is a Python productivity and spiritual workflow assistant with:
- prayer reminders and tracking,
- Pomodoro and health reminders,
- Google Calendar integration,
- Quran progress gate and goals,
- Telegram remote control,
- live web dashboard,
- cross-platform runtime behavior (Linux + Windows adapters).
This repository is designed for local-first usage with strong runtime observability, feature flags, and secure secret handling.
- Project Goals
- Core Features
- Architecture
- Repository Structure
- Requirements
- Quick Start
- Configuration
- Security Model
- Runtime Modes and Feature Flags
- CLI Reference
- Telegram Bot Commands
- Dashboard API Reference
- Autostart Installation
- Testing and CI
- Packaging
- Troubleshooting
- Roadmap and Status
- Contributing
- Keep the assistant local-first and reliable.
- Support daily workflow automation and spiritual habits in one runtime.
- Keep command/control available from desktop, dashboard, and Telegram.
- Maintain Linux baseline behavior while supporting Windows parity.
- Keep the system debuggable through logs, runtime status, and doctor diagnostics.
- Pomodoro loop with focus minutes tracking.
- Workday limit alerts.
- Telegram-first task capture with due dates, reminders, and Today/Overdue views.
- Meeting reminders and prep notes from Google Calendar.
- Auto-focus around meetings (feature-flagged).
- Water and stretch reminders.
- Eye-strain (20-20-20) reminders.
- Optional salawat audio reminder with configurable interval.
- Daily prayer timings and reminders.
- Prayer status tracking (
prayed/missed) and streak metrics. - Prayer recovery flow for missed prayers.
- Quran gate UI with notes/bookmarks and persisted progress.
- Quran daily goal and progress tracking.
- Telegram bot commands and inline control panel.
- Dashboard with live status, thread health, controls, toggles, and metrics.
- Optional tray controls.
- Linux/Windows platform adapter layer.
- Capability reporting (
--print-capabilities,/api/capabilities). .envsupport and secret redaction.- Doctor diagnostics (
--run-doctor). - Autostart installers for Linux and Windows.
personal_assistant.pyis a compatibility launcher that callsassistant_app.main.main().
assistant_app/main.pycontains the orchestration loop, thread runtime, Telegram and dashboard integrations, and backward-compatible flow.
assistant_app/platform/base.pydefines the runtime contract.assistant_app/platform/linux.pyimplements Linux behavior.assistant_app/platform/windows.pyimplements Windows behavior.assistant_app/platform/__init__.pyselects adapter by OS.
assistant_app/services/*hosts modular service utilities (scoring and helper abstractions).
assistant_app/main.pyincludesAssistantDB.assistant_app/migrations.pyadds v2 tables:schema_migrationsapp_settingsweekly_report_log
assistant_app/install/linux_autostart.pyassistant_app/install/windows_autostart.py
assistant_app/
main.py
config.py
runtime_state.py
migrations.py
platform/
services/
integrations/
install/
personal_assistant.py
requirements.txt
tests/
docs/
.github/workflows/ci.yml
scripts/
- Python 3.11+
- Linux or Windows desktop session
- Optional integrations:
- Google Calendar OAuth credentials
- Telegram bot token and allowed chat IDs
Install dependencies:
python3 -m pip install -r requirements.txt- Create
.envfrom template:
cp .env.example .env- Fill required secrets in
.env:
TELEGRAM_BOT_TOKENQURAN_CLIENT_IDQURAN_CLIENT_SECRET
- Validate config:
python3 personal_assistant.py --validate-config- Run:
python3 personal_assistant.pyPrimary configuration is config.json.
Important top-level sections:
securityfeaturespersonal_modesprayerspomodorohealtheye_straingoogle_calendarfocus_modequran_khatmatelegram_botdashboard
Environment variables override sensitive/runtime values.
- Secret material should be provided through environment variables or
.env. - When
security.require_env_secrets=true, startup validation fails if required secret env vars are missing. - Logs and runtime error messages redact configured secret values when
security.redact_secrets_in_logs=true. .envis ignored by git.- Do not commit real secrets to
config.json, helper scripts, or docs.
Feature flags live under features and are reflected in dashboard/telemetry. Examples:
telegram_inline_paneltelegram_sensitive_confirmcalendar_auto_focusdaily_scorequran_goalsprayer_recovery_flowweekly_report_pushpersonal_modes
Personal modes:
workdaylightramadan
Mode can be set from Telegram (/mode) or dashboard (/action/mode).
python3 personal_assistant.py --status
python3 personal_assistant.py --validate-config
python3 personal_assistant.py --print-capabilities
python3 personal_assistant.py --run-doctor
python3 personal_assistant.py --install-autostart
python3 personal_assistant.py --uninstall-autostartExisting commands are preserved and v2 adds:
/panel/mode <workday|light|ramadan>/goal [units]/weekly/salawat/salawaton [minutes]/salawatoff/salawatinterval <minutes>/task [title]/tasks [today|open|overdue|done]
Sensitive power actions can require callback confirmation when telegram_sensitive_confirm is enabled.
Core endpoints:
GET /api/statusGET /api/eventsGET /api/errors
v2 endpoints:
GET /api/capabilitiesGET /api/scorePOST /action/modePOST /action/quran_goalPOST /action/mark_prayer
Use cross-platform installer commands:
python3 personal_assistant.py --install-autostart
python3 personal_assistant.py --uninstall-autostartBehavior:
- Linux: writes/removes XDG autostart desktop entry.
- Windows: creates/removes Task Scheduler ONLOGON task.
Run locally:
python3 -m pytest -qCI matrix (.github/workflows/ci.yml) runs on:
ubuntu-latestwindows-latest
Build scripts:
- Linux:
scripts/build_dist.sh - Windows:
scripts/build_dist.ps1
Both use PyInstaller one-file mode.
If security.require_env_secrets=true, set required env vars in .env.
Check:
telegram_bot.enabledTELEGRAM_BOT_TOKENallowed_chat_ids
Run diagnostics:
python3 personal_assistant.py --run-doctorVerify screenshot capability in output.
Check dashboard config:
dashboard.enableddashboard.hostdashboard.portdashboard.auto_open_on_start
Implementation checklist and rollout notes:
docs/IMPLEMENTATION_TODO.mddocs/ROLLOUT_AND_ROLLBACK.md
See CONTRIBUTING.md.