Skip to content

YofarDev/script4me

Repository files navigation

SCRIPT 4 ME

License: Apache-2.0

A powerful Flutter desktop application for managing, generating, and executing Python scripts with AI-powered assistance. Features an intuitive interface for script creation, LLM-based code generation and editing, parameter configuration, and seamless script execution.

Features

  • Script Management: Organize scripts by category with search and filtering capabilities
  • AI-Powered Generation: Generate Python scripts from natural language prompts using configurable LLM providers
  • AI-Assisted Editing: Improve and modify existing scripts with LLM-powered editing tools
  • Parameter Configuration: Define and configure script parameters through an intuitive UI
  • Script Execution: Run Python scripts directly from the app with real-time output display
  • Version History: Track changes to scripts with built-in version control
  • Multiple LLM Providers: Support for various LLM providers (OpenAI, Claude, local models, etc.)
  • Drag & Drop: Convenient file selection via drag-and-drop or file picker
  • Python Environment: Automated Python environment management using uv

Screenshots

Script Library Script Generator
Script Execution

Requirements

  • Flutter SDK (>=3.11.0)
  • Dart SDK (>=3.11.0)
  • uv package manager for Python environment management

Installation

1. Install Prerequisites

Flutter: Follow the official Flutter installation guide

uv: Install the Python package manager

curl -LsSf https://astral.sh/uv/install.sh | sh

2. Clone and Setup

git clone <repository-url>
cd script4me
flutter pub get

3. Run the Application

flutter run -d macos  # or -d windows, -d linux

Usage

Creating Scripts

Scripts are Python files with metadata defined as module-level variables:

import os
import datetime
import argparse

# --- Metadata ---

NAME = "Image Resizer"
DESCRIPTION = "Resize images to a specified dimension while maintaining aspect ratio."
CATEGORY = "Images"  # Images, Video, Audio, Files, Documents, Data, System
INPUT_TYPES = "Images (*.png *.jpg *.jpeg *.webp)"

PYTHON_VERSION = "3.12"
DEPENDENCIES = ["pillow"]

PARAMETERS = [
    {"name": "max_dimension", "type": "int", "default": 1920, "description": "Maximum width or height"},
    {"name": "quality", "type": "int", "default": 95, "description": "Output quality (0-100)"},
]

# --- Script Logic ---

def process_files(file_paths, max_dimension, quality):
    from PIL import Image

    for file_path in file_paths:
        with Image.open(file_path) as img:
            img.thumbnail((max_dimension, max_dimension), Image.Resampling.LANCZOS)
            # Save and output logic...

See SCRIPT_DOCUMENTATION.md for complete script template guidelines.

Application Features

  1. Script Generator: Create new scripts by describing what you want in natural language
  2. Script Editor: Edit script code and metadata with syntax highlighting
  3. LLM Edit Section: Use AI to modify and improve your scripts
  4. Execution Screen: Configure parameters and run scripts with file inputs

Configuring LLM Providers

Navigate to Settings > LLM Providers to add and configure your preferred AI providers:

  • OpenAI (GPT-4, GPT-3.5)
  • Anthropic (Claude)
  • Local models (Ollama, LM Studio)
  • Custom OpenAI-compatible endpoints

Project Structure

lib/
├── core/
│   ├── models/           # Data models (Script, LLM Provider, etc.)
│   ├── repositories/     # Data access layer
│   ├── services/         # Business logic services
│   └── theme/           # App theming
├── features/
│   ├── execution/       # Script execution UI and logic
│   ├── script_editor/   # Script editing with version history
│   ├── script_generator/ # AI-powered script generation
│   ├── scripts/         # Script library management
│   └── settings/        # App configuration
└── main.dart

Development

Code Quality

# Format code
dart apply --fix

# Analyze code
flutter analyze

Key Dependencies

  • flutter_bloc: State management with BLoC/Cubit pattern
  • go_router: Navigation and routing
  • window_manager: Desktop window management
  • file_picker: Cross-platform file selection
  • desktop_drop: Drag-and-drop support
  • syntax_highlight: Code syntax highlighting
  • uv: Python environment and package management

Architecture

The application follows clean architecture principles with:

  • Feature-based organization for scalable code structure
  • BLoC/Cubit pattern for predictable state management
  • Repository pattern for data access abstraction
  • Service layer for business logic separation
  • Dependency injection through RepositoryProvider and BlocProvider

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors