Metadata-Version: 2.5
Name: explait
Version: 0.1.0
Summary: CLI tool that analyzes your Python code using Gemini AI
Author-email: EL7ADYDY <malhdydy095@gmail.com>
License-Expression: MIT
Requires-Python: >=3.9
Requires-Dist: google-genai>=0.5.0
Requires-Dist: typer>=0.9.0
Description-Content-Type: text/markdown

# explait

A lightweight CLI tool that uses Google's Gemini AI to analyze your Python code or generate code from comments — right in your terminal.

## Installation

```bash
pip install explait
```


## Setup

Before using `explait`, you need a free Gemini API key:

1. Get your key from [Google AI Studio](https://aistudio.google.com/apikey)
2. Set it as a permanent environment variable (Windows PowerShell):

```powershell
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "your-key-here", "User")
```

3. Close and reopen your terminal for the change to take effect.

You only need to do this once. To update your key later, just run the same command again with the new key.


## Usage

Run `explait` inside any folder with Python files:

```bash
# Analyze the most recently edited .py file automatically
explait

# Or specify a file directly
explait my_script.py
```

`explait` can do two things depending on what it finds in your code:

- **Analyze existing code**: predicts the output, gives quality tips, and flags bugs with fixes.
- **Generate code from a comment**: write a comment like `# write a function that reverses a string`, and it will write the code for you.