Skip to main content

Smart AI Cron Tool with Web UI (Ollama, Gemini, GPT Support)

Project description

ai-cron

AI-Powered Cron Job Generator with Modern Web UI

Transform natural language into cron expressions using AI. Built with privacy in mind, supporting both local (Ollama) and cloud AI models (Google Gemini, OpenAI, Anthropic Claude, etc.).

โœจ Features

  • ๐Ÿค– Multi-Model AI Support

    • Local Privacy: Ollama (Llama 3, Mistral) - No internet required
    • Cloud Power: Google Gemini, OpenAI GPT-4o, Anthropic Claude, DeepSeek, xAI Grok
    • Smart Fallback: Automatic model switching when Ollama is unavailable
  • ๐Ÿ’ป Modern Web UI

    • Natural Language Chat: Generate cron jobs conversationally
    • Backup Wizard: Guided file backup scheduling with progress tracking
    • AI Settings: Configure models, API keys, and endpoints
  • โšก Smart Features

    • Instant Validation: Verify cron expressions before scheduling
    • Next Run Preview: See upcoming execution times
    • One-Click Deploy: Add to system crontab directly from UI

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.10+
  • Poetry (recommended) or pip

Option 1: Using Poetry (Recommended)

git clone https://github.com/dev-droid/ai-cron.git
cd ai-cron
poetry install

Option 2: Using pip

git clone https://github.com/dev-droid/ai-cron.git
cd ai-cron
pip install -r requirements.txt  # Or: pip install -e .

Optional: Install Ollama (for local AI)

  • Windows: Download Ollama
  • macOS: brew install ollama
  • Linux: curl -fsSL https://ollama.com/install.sh | sh

After installing Ollama, pull a model:

ollama pull llama3

๐Ÿš€ Usage

Web UI (Recommended)

# Using Poetry
poetry run python -m aicron.main web --port 8080

# Using pip
python -m aicron.main web --port 8080

Then open http://localhost:8080 in your browser.

CLI Mode

# Using Poetry
poetry run python -m aicron.main "Backup home folder every Friday at 5pm"

# Using pip
python -m aicron.main "Backup home folder every Friday at 5pm"

โš™๏ธ Configuration

Environment Variables

For users in regions requiring a proxy (e.g., China for Google Gemini):

# Set proxy for AI API requests
export AICRON_PROXY="http://127.0.0.1:7890"

# Or set system-wide proxy (automatically detected)
export HTTP_PROXY="http://127.0.0.1:7890"
export HTTPS_PROXY="http://127.0.0.1:7890"

API Keys (Cloud AI Models)

Configure via the Web UI Settings tab or export as environment variables:

# Google Gemini
export GEMINI_API_KEY="<YOUR_GEMINI_API_KEY>"

# OpenAI
export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"

# Anthropic Claude
export ANTHROPIC_API_KEY="<YOUR_ANTHROPIC_API_KEY>"

๐Ÿ“‚ Project Structure

ai-cron/
โ”œโ”€โ”€ aicron/
โ”‚   โ”œโ”€โ”€ __init__.py       # Package version
โ”‚   โ”œโ”€โ”€ main.py           # CLI entry point (Typer)
โ”‚   โ”œโ”€โ”€ web.py            # Web UI (NiceGUI)
โ”‚   โ”œโ”€โ”€ llm.py            # AI model integration (LiteLLM)
โ”‚   โ”œโ”€โ”€ cron.py           # Cron validation & system integration
โ”‚   โ”œโ”€โ”€ llm_tools.py      # File system context tools
โ”‚   โ””โ”€โ”€ ollama_utils.py   # Ollama installation checks
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_llm_logic.py # Unit tests
โ”œโ”€โ”€ pyproject.toml        # Poetry dependencies
โ”œโ”€โ”€ LICENSE               # MIT License
โ””โ”€โ”€ README.md             # This file

๐Ÿ› ๏ธ Development

Run tests:

poetry run pytest

๐Ÿ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

Copyright (c) 2025 dev-droid. All rights reserved.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.

๐ŸŒŸ Acknowledgments

  • Built with LiteLLM for unified AI API access
  • UI powered by NiceGUI
  • Inspired by the need for privacy-first AI tooling

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

ai_cron-0.2.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

ai_cron-0.2.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file ai_cron-0.2.0.tar.gz.

File metadata

  • Download URL: ai_cron-0.2.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for ai_cron-0.2.0.tar.gz
Algorithm Hash digest
SHA256 92abaaa2440c4907ae942e04f93a3079eb32eaec42c78b713e730a2f95752a62
MD5 5d47a8c84180a7a87379b7a6262d7164
BLAKE2b-256 86d0d2e9717a0122489eee298e0fad48ad3e4e60c5e9fd88dc044e46fc31ca2b

See more details on using hashes here.

File details

Details for the file ai_cron-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ai_cron-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for ai_cron-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb07e42ac6c744f77e7f5febf730a2041fe4bfa59d5c7a0901f614532dfdaf4b
MD5 7d14b9268bad66a9fce9d19cfc6073e0
BLAKE2b-256 d8f1fecf39ff73b60db863817f3e8d9628ee92208a84c893ecb45a92e66f1c0c

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