# Gemini-powered Prompt Generator A simple CLI tool to generate detailed, high-quality prompts from simple ideas using the Google Gemini API. The tool intelligently infers the user's intent and uses a two-step generation process to create rich prompts for various tasks. ## Features - **Intent Inference**: Automatically determines the user's intent (e.g., Image Generation, Code Generation, Text Summarization, General Question). - **Two-Step Prompt Generation**: Uses a meta-prompt to infer intent, then a specialized prompt to generate a detailed final output. - **Configurable Model**: Easily change the Gemini model via an environment file. - **Robust**: Includes retry logic for API calls to handle transient network issues. - **Cross-platform**: Works on environments that support Python, with encoding explicitly set. ## Installation & Setup This project uses `uv` for fast environment and package management. 1. **Create a virtual environment:** ```bash uv venv ``` 2. **Activate the environment:** ```bash # On Linux/macOS source .venv/bin/activate # On Windows .venv\Scripts\activate ``` 3. **Install dependencies:** ```bash uv pip install -r requirements.txt ``` ## Configuration 1. **Copy the example environment file:** ```bash cp .env.example .env ``` 2. **Edit the `.env` file:** Open the newly created `.env` file and set the following variables: - `GOOGLE_API_KEY`: Your Google AI Studio API key. **(Required)** - `GEMINI_MODEL`: The name of the Gemini model you want to use. Defaults to `gemini-1.5-pro` if not set. You can change this to other valid models like `gemini-pro`. ## Usage Run the script from your terminal using the following command. The `PYTHONIOENCODING=UTF-8` prefix is important to ensure correct handling of non-ASCII characters (like Korean, Japanese, etc.) in the terminal. ```bash PYTHONIOENCODING=UTF-8 python main.py ``` The script will then prompt you to enter your idea: ``` --- Gemini-powered Prompt Generator --- Using Gemini model: gemini-1.5-pro Enter your simple prompt idea: [your idea here] ``` The script will then show the inferred intent and the final, detailed prompt paragraph.