Skip to main content

A CLI tool to enhance prompts using Ollama AI.

Project description

enhance-this ✨

PyPI - Version npm - Version Homebrew - Version License

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 --diff flag 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-setup command downloads a recommended model (e.g., llama3.1:8b) if no models are found locally, with intelligent fallbacks.
  • Rich Terminal UI: Employs the rich library 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enhance_this-0.1.2.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

enhance_this-0.1.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file enhance_this-0.1.2.tar.gz.

File metadata

  • Download URL: enhance_this-0.1.2.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

Hashes for enhance_this-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d7894b452e4dce39081c81dcb1904553455d702a79bc4d2faf6062dea399d6e1
MD5 009a09029d4ab35243485ce4e182df38
BLAKE2b-256 1cec7b7c3a688331a4c92af250c2285b88171a941d40496574fb2c0006b56763

See more details on using hashes here.

File details

Details for the file enhance_this-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: enhance_this-0.1.2-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

Hashes for enhance_this-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a81040a0881a56d871ddbfc9939ed885dbd5e34cb1a0b4a5e09601b1f3b4c401
MD5 4a44bda6b818b39cd3c44000460e76f3
BLAKE2b-256 a95e0f2773ace2eb3dad7181df3cc21db39eae208a3fb237ae5b6d19d3cbfdcd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page