Turn scrappy ideas into production-ready prompts without ever leaving the terminal.
Prompting is still a superpower, but crafting great prompts takes time. AI Prompt Refiner CLI transforms a single rough idea into five ready-to-use variants in seconds:
- Polished improved prompt
- Power prompt with deep structure
- Short <20 word prompt
- Long narrative-style prompt
- Creative twist prompt
All powered by an abstract provider system (defaults to OpenAI GPT-4o mini), wrapped in a fast, colorful CLI.
pip install promptrefinerOr work locally:
git clone https://github.com/oss/prompt-refiner-cli.git
cd prompt-refiner-cli
pip install -e .Basic command:
promptref refine "Help me explain quantum computing to kids"Flagged variants:
promptref refine "Plan a Mars mission" --short --creativePipe from any tool:
cat idea.txt | promptref refineInteractive mode (no args, no stdin):
promptref refine+-----------------------------------------------------------+
| promptref refine "Design a community art festival" |
+-----------------------------------------------------------+
| ORIGINAL: Design a community art festival |
| |
| Variant | Prompt |
| -------------- | ---------------------------------------- |
| Improved | Curate a vibrant neighborhood art... |
| Power | You are an event architect... |
| Short | Design an immersive community art fest |
| Long | Imagine a summer weekend... |
| Creative Twist | Surprise residents with... |
+-----------------------------------------------------------+
See example_output.md for a full run with every variant rendered.
- Set your OpenAI key:
export OPENAI_API_KEY="sk-live..."
- Run the CLI. Missing keys produce a helpful error.
Providers live in promptrefiner/providers/.
from promptrefiner.providers.base import BaseProvider
class MyProvider(BaseProvider):
name = "my-provider"
def generate(self, prompt: str) -> dict[str, str]:
# Hit your favorite API
return {
"improved": "...",
"power": "...",
"short": "...",
"long": "...",
"creative": "...",
}Then register it in promptrefiner.cli.get_provider.
Use --debug to see API payloads and internal state transitions:
promptref refine "Frame a VC pitch" --debuggit clone https://github.com/oss/prompt-refiner-cli.git
cd prompt-refiner-cli
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest- Fork the repo
- Create a feature branch
- Add/adjust tests
- Submit a PR with context and screenshots
We love docs and creative prompt presets—send them!
If this repo saved you time or sparked an idea, consider buying me a coffee to keep the prompts flowing. ❤️
https://buymeacoffee.com/connectankush
Your support and feedback are valuable in maintaining and improving the extension.
MIT © Prompt Refiner contributors