A CLI tool to enhance prompts using Ollama AI.
Project description
enhance-this ✨
enhance-this is a powerful, fast, and reliable CLI tool designed to elevate your prompts. It takes a simple idea, enhances it using local Ollama AI models, and delivers a comprehensive, structured prompt ready to generate superior AI responses. The enhanced prompt is streamed directly to your terminal and automatically copied to your clipboard for immediate use.
🚀 Overview
The core mission of enhance-this is to bridge the gap between a simple user query and a high-quality, detailed prompt that AI models can understand and act upon effectively. By leveraging a sophisticated and customizable templating system, the power of local language models via Ollama, and a rich terminal interface, it transforms basic inputs into professional-grade prompts.
✨ Features
- Live Streaming Output: Get instant feedback as the enhanced prompt is generated token by token, providing a dynamic user experience.
- Powerful Prompt Enhancement: Utilizes a system of style-based templates (
detailed,concise,creative,technical) to convert simple prompts into comprehensive, actionable ones. - Fully Customizable Templates: Extend the tool with your own unique enhancement styles by simply adding paths to your custom template files in
config.yaml. - Diff View: Use the
--diffflag to see a clear, color-coded comparison between your original prompt and the enhanced version, highlighting the changes. - Full Ollama Integration: Seamlessly connects to your local Ollama instance (
http://localhost:11434) to manage and interact with AI models directly on your machine. - Intelligent Model Management:
- Automatically detects if the Ollama service is running.
- Lists all available local models with
enhance --list-models. - Auto-selects an optimal model if one is not specified.
- Features resilient retry logic for network requests, ensuring robust communication.
- Automatic Setup: A simple
enhance --auto-setupcommand downloads a recommended model (e.g.,llama3.1:8b) if no models are found locally, with intelligent fallbacks. - Rich Terminal UI: Employs the
richlibrary for beautiful, color-coded output, elegant markdown rendering, and informative progress bars during operations. - Cross-Platform Clipboard: Automatically copies the final enhanced prompt to your system's clipboard, ready for pasting into your AI interface. Works seamlessly across macOS, Linux, and Windows.
- Highly Configurable: Control everything from the Ollama host and default styles to temperature and maximum token length via a simple YAML configuration file.
- Robust Testing: Includes a comprehensive testing suite covering unit, integration, and end-to-end scenarios to ensure reliability and correctness.
📦 Installation
enhance-this is designed for easy installation across multiple platforms.
PyPI (Python Package Index)
pip install enhance-this
NPM (Node.js Package Manager)
npm install -g enhance-this
Homebrew (macOS & Linux)
brew install hariharen9/tap/enhance-this
For Local Development
If you want to contribute or develop locally, clone the repository and install in editable mode:
git clone https://github.com/hariharen9/enhance-this.git
cd enhance-this
pip install -e .
💡 Usage
First, ensure you have Ollama installed and running. If you don't have any models downloaded, run:
enhance --auto-setup
Then, you can start enhancing your prompts:
Basic Enhancement:
enhance "write a blog post about AI"
Using the Diff View:
enhance "review my code" --diff
Using a Custom Style:
(First, define your custom style in ~/.enhance-this/config.yaml)
enhance "a logo for a coffee shop" -s my-logo-style
Command-Line Options
| Option | Short | Description |
|---|---|---|
<prompt> |
The initial prompt to enhance. | |
--model <MODEL> |
-m |
Ollama model to use. |
--temperature <T> |
-t |
Temperature for generation (0.0-2.0). |
--length <LENGTH> |
-l |
Max tokens for the enhanced prompt. |
--style <STYLE> |
-s |
Enhancement style (e.g., detailed, creative). |
--diff |
Show a diff between the original and enhanced prompt. | |
--output <FILE> |
-o |
Save the enhanced prompt to a file. |
--no-copy |
-n |
Disable automatic copying to the clipboard. |
--verbose |
-v |
Enable verbose output. |
--list-models |
List all available Ollama models. | |
--download-model <MODEL> |
Download a specific model from Ollama. | |
--auto-setup |
Automatically download a recommended model. | |
--version |
Show the application version. | |
--help |
-h |
Show the help message. |
🧪 Testing
The project includes a comprehensive test suite to ensure reliability and correctness.
Running Tests Locally
To run all tests, navigate to the project root and execute:
pytest tests/
Test Strategy
- Unit Tests: Verify individual functions and components in isolation.
- Integration Tests: Ensure different modules and external services (like Ollama, with proper mocking or live checks) work together correctly.
- End-to-End Tests: Simulate real-world usage scenarios through the CLI to confirm the entire workflow functions as expected.
📚 Documentation
- Configuration Guide: Learn how to customize every aspect of the tool, including setting up custom templates.
- Troubleshooting Guide: Find solutions to common problems and error messages.
- Examples: Explore more real-world usage examples and prompt enhancement scenarios.
🤝 Contributing
Contributions are welcome! Please feel free to open issues, submit pull requests, or suggest new features. See the CONTRIBUTING.md (coming soon) for more details.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
This README was generated and enhanced by Gemini based on the project's development specification and implemented features.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enhance_this-0.1.3.tar.gz.
File metadata
- Download URL: enhance_this-0.1.3.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fb191162f3c2ad6070b72051dd42e4d18b7397757c2df97ccdedb7acc11549f
|
|
| MD5 |
c2236ab8b7a81fa9cac9e543564b59a3
|
|
| BLAKE2b-256 |
d6e5b51e46736026217838f2c399263165d5d350772f4508a1c6c958a2bbf46d
|
File details
Details for the file enhance_this-0.1.3-py3-none-any.whl.
File metadata
- Download URL: enhance_this-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
904361506067408907c8eb84c0b9b26cc63cdaa5e9b2864d19a93aba1e17fe96
|
|
| MD5 |
1ad02e8945c46b85cdd44c3a2b53d8e9
|
|
| BLAKE2b-256 |
0eb925342ee6fcec4b39216d589e9617fd93d25dd6a0898e69046cc525eed0a8
|