|
1 | | -# 🚀 **vibepython: The Ultimate AI-Powered Coding EXPLOSION!** 🌟💥🐍 |
| 1 | +# vibepython: AI-Powered Interactive Python Code Generator |
2 | 2 |
|
3 | | -**WOWZA!** Dive headfirst into this **AMAZING**, **WONDERFUL**, **MIND-BLOWING** interactive command-line beast that turns your craziest prompts into **EXECUTABLE PYTHON MAGIC** using the sheer power of OpenAI! Generate code like a wizard, run it on the spot, capture every wild stdout/stderr outburst, and keep a super-smart history in JSON for non-stop contextual awesomeness! It's not just a tool – it's a **CODE REVOLUTION** for hackers, dreamers, and AI fanatics! 🔥🚀 |
| 3 | +vibepython is an interactive command-line tool that uses AI to generate executable Python code from user prompts. Powered by OpenAI or alternative providers, it allows you to create, run, and capture code outputs while maintaining a contextual history stored in JSON. Ideal for developers, experimenters, and AI enthusiasts looking for a seamless coding experience. |
4 | 4 |
|
5 | | -## 🌈 **Features That'll Make Your Eyes POP!** 🎉 |
6 | | -- **INTERACTIVE PROMPT MADNESS**: Type your wild ideas and watch AI spit out Python gold! 💡 |
7 | | -- **AI-GENERATED CODE WIZARDRY**: Powered by OpenAI – prompts + history = PERFECT scripts! 🤖✨ |
8 | | -- **SAFE EXECUTION EXTRAVAGANZA**: Run code with output capturing – no disasters, just pure thrill! ⚡ |
9 | | -- **PERSISTENT HISTORY OVERLOAD**: Pydantic models store EVERYTHING in JSON – context forever! 📜 |
10 | | -- **ENV VAR CUSTOMIZATION FRENZY**: Tweak it your way for ultimate control! 🔧 |
11 | | -- **DOCKER DOMINATION**: Run it anywhere, anytime – easy-peasy deployment! 🐳 |
| 5 | +## Features |
| 6 | +- **Interactive Prompting**: Enter your ideas and receive AI-generated Python code. |
| 7 | +- **AI Code Generation**: Leverages AI models with prompt history for accurate scripts. |
| 8 | +- **Safe Code Execution**: Run generated code and capture stdout/stderr outputs. |
| 9 | +- **Persistent History**: Uses Pydantic models to store interactions in JSON for ongoing context. |
| 10 | +- **Customization via Environment Variables**: Adjust settings for personalized control. |
| 11 | +- **Docker Support**: Easy deployment in containerized environments. |
12 | 12 |
|
13 | | -## 🛠️ **Installation: Get This Party Started in SECONDS!** 🚀 |
| 13 | +## Installation |
14 | 14 |
|
15 | | -### **From PyPI: Pip It Like It's HOT – Instant VIBE!** 🔥💥 |
16 | | -1. **GRAB THE PACKAGE**: |
| 15 | +### From PyPI |
| 16 | +1. Install the package: |
17 | 17 | ``` |
18 | 18 | pip install vibepython |
19 | 19 | ``` |
20 | | -2. **FIRE IT UP**: |
| 20 | +2. Run the tool: |
21 | 21 | ``` |
22 | 22 | vibepython |
23 | 23 | ``` |
24 | | -- **Pro Tip**: Don't forget to set your `OPENAI_API_KEY` env var for AI magic! 🔑 (e.g., `export OPENAI_API_KEY=your_key_here`). |
25 | | -**VIBE ACTIVATED! Dive into the AI console vibe!** 🚀 |
26 | 24 |
|
27 | | -### **From Source: Clone, Install, BLAST OFF!** 🌌 |
28 | | -1. **CLONE THE AWESOMENESS**: |
| 25 | +### From Source |
| 26 | +1. Clone the repository: |
29 | 27 | ``` |
30 | 28 | git clone https://github.com/OldTyT/vibepython.git |
31 | 29 | ``` |
32 | | -2. **JUMP IN**: |
| 30 | +2. Navigate to the directory: |
33 | 31 | ``` |
34 | 32 | cd vibepython |
35 | 33 | ``` |
36 | | -3. **INSTALL THE MAGIC**: |
| 34 | +3. Install dependencies: |
37 | 35 | ``` |
38 | 36 | pip install -r requirements.txt |
39 | 37 | ``` |
40 | | -4. **LAUNCH THE BEAST**: |
| 38 | +4. Launch the application: |
41 | 39 | ``` |
42 | 40 | python3 main.py |
43 | 41 | ``` |
44 | | -**BOOM! You're in the zone!** 💣 |
45 | 42 |
|
46 | | -### **Using Docker: Containerized VIBE – Ready to RUMBLE!** 🐳🔥 |
47 | | -Fire it up with this epic command: |
| 43 | +### Using Docker |
| 44 | +Run the container with this command: |
48 | 45 | ``` |
49 | | -docker run --rm -ti -e HISTORY_PATH=/history/history.json -e OPENAI_API_KEY=YOUR_KEY -v my_history:/history ghcr.io/oldtyt/vibepython |
| 46 | +docker run --rm -ti -e HISTORY_PATH=/history/history.json -v my_history:/history ghcr.io/oldtyt/vibepython |
50 | 47 | ``` |
51 | | -- Plug in `YOUR_KEY` with your OpenAI super-key! 🔑 |
52 | | -**DOCKER DELIGHT: Persistent history, zero hassle!** 🌟 |
| 48 | +- Set your OpenAI API key via the `OPENAI_API_KEY` environment variable (required for the 'openai' provider). |
53 | 49 |
|
54 | | -## 🎮 **Usage: Dive into the FUN ZONE!** 🕹️ |
55 | | -Fire it up and get prompted: |
56 | | -- **SMASH IN A PROMPT** (e.g., "Code me a factorial frenzy!"). |
57 | | -- **AI UNLEASHES CODE VIBE** based on your prompt + history vibes. |
58 | | -- **EXECUTE? Y/N – YOU DECIDE!** Run it, capture outputs, and watch the sparks fly! ⚡ |
59 | | -- **HISTORY SAVES THE DAY**: Everything logged for eternal glory. |
| 50 | +## Usage |
| 51 | +Start the tool and follow the prompts: |
| 52 | +- Enter a prompt (e.g., "Write a function to calculate factorial"). |
| 53 | +- The AI generates code based on your input and history. |
| 54 | +- Choose to execute the code (Y/N) and view captured outputs. |
| 55 | +- All interactions are logged to history for context. |
60 | 56 |
|
61 | | -**EXIT? Ctrl+C – but why would you? It's TOO MUCH FUN!** 😎 |
| 57 | +To exit, press Ctrl+C. |
62 | 58 |
|
63 | | -## 🔑 **Environment Variables: Customize Like a BOSS!** 💪 |
64 | | -Supercharge your setup with these **EPIC** vars: |
65 | | -- **HISTORY_PATH**: Your JSON history fortress! Default: `history.json`. 🏰 |
66 | | -- **HISTORY_SIZE**: How many past blasts to feed the AI? Default: `20` – keep it contextual! 📈 |
67 | | -- **OPENAI_API_KEY**: **MUST-HAVE** – your ticket to AI heaven! (Required, duh!) 🔒 |
| 59 | +## Environment Variables |
| 60 | +Customize the tool using these environment variables: |
| 61 | +- **HISTORY_PATH**: Path to the JSON history file. Default: `history.json`. |
| 62 | +- **HISTORY_SIZE**: Number of past interactions to include in AI context. Default: `20`. |
| 63 | +- **OPENAI_API_KEY**: Required for the 'openai' provider; your OpenAI API key. |
| 64 | +- **PROVIDER**: AI provider to use. Supports 'gpt4free' (default) and 'openai'. |
| 65 | +- **MODEL_NAME**: Model to use with the provider. For 'gpt4free': 'gpt-4o-mini'. For 'openai': 'gpt-5-mini'. |
68 | 66 |
|
69 | | -**Example (Unix-style domination)**: |
| 67 | +Example configuration: |
70 | 68 | ``` |
| 69 | +export PROVIDER=openai |
71 | 70 | export OPENAI_API_KEY=your-api-key |
| 71 | +export MODEL_NAME=gpt-5-mini |
72 | 72 | export HISTORY_SIZE=10 |
73 | 73 | python3 main.py |
74 | 74 | ``` |
75 | | -**TWEAK AND CONQUER!** 🛡️ |
76 | 75 |
|
77 | | -## 📦 **Dependencies: The Power Behind the THRILL!** ⚙️ |
78 | | -- **Python 3.10+** (Blasting up to 3.13 – future-proofed!) 🐍 |
79 | | -- **Libraries of LEGEND**: openai, pydantic, loguru, and more! Check `requirements.txt` for the full squad. 📚 |
| 76 | +## Dependencies |
| 77 | +- **Python 3.10+** (Compatible up to 3.13). |
| 78 | +- Required libraries: openai, pydantic, loguru, and others listed in `requirements.txt`. |
80 | 79 |
|
81 | | -## 🤝 **Contributing: Join the CODE CARNIVAL!** 🎪 |
82 | | -**GOT IDEAS?** Open an issue or slam in a pull request – let's make this even MORE INSANE! 🌟 Contributions = Eternal Fame! |
| 80 | +## Contributing |
| 81 | +Have suggestions? Open an issue or submit a pull request to help improve the project. Contributions are welcome! |
0 commit comments