Ultimate Prompt Generator (UPG) 🤖
A powerful CLI tool for generating, managing, and reusing prompts for different LLM providers. Currently supports OpenAI and Anthropic models with smart defaults.
Join Russian Speaking Telegram Channel | Watch Russian Video Tutorial
🌟 Features
- 🔄 Multi-Provider Support:
- OpenAI (default: gpt-4o)
- Anthropic (default: claude-3-sonnet-20240229)
- 📝 Smart Prompt Generation:
- Generate high-quality prompts for various tasks
- Create prompts with or without variables
- Automatic variable detection and validation
- 💾 Prompt Management:
- Save and reuse generated prompts
- Tag and categorize prompts
- Search through saved prompts
- 🔑 Secure Configuration: Safe storage of API keys and preferences
🚀 Quick Start
# Install with pip
pip install upg-cli
# Or install with Poetry
poetry add upg-cli
Initial Configuration
# Configure your preferred LLM provider
upg config --provider openai --api-key YOUR_API_KEY
Basic Usage
# Generate a simple prompt without variables
upg generate "Write a story about a space traveler"
# Generate a prompt with variables
upg generate "Create a Python function to calculate fibonacci numbers" \
-v FUNCTION_NAME \
-v ARGS \
--save --name "python-fibonacci" \
--tag python --tag math
# Use a saved prompt
upg answer python-fibonacci \
-v FUNCTION_NAME "fibonacci" \
-v ARGS "n: int"
📋 Detailed Usage Guide
Prompt Generation
You can generate prompts both with and without variables:
# Simple prompt without variables
upg generate "Write a poem about autumn"
# Prompt with variables
upg generate "Write a {GENRE} story about {TOPIC}" \
-v GENRE \
-v TOPIC
# Save generated prompt
upg generate "Your task description" [options]
Options:
--provider TEXT LLM provider to use (openai/anthropic)
-v, --variable TEXT Variable names for the prompt (optional)
-o, --output FILENAME Save prompt to file
-s, --save Save prompt for later use
--name TEXT Name for saved prompt
-d, --description TEXT Description for saved prompt
-t, --tag TEXT Tags for categorizing the prompt
Using Prompts
For prompts without variables, you can use them directly:
# Using a simple prompt without variables
upg answer simple-story
# Using a prompt with variables
upg answer story-template \
-v GENRE "mystery" \
-v TOPIC "lost artifact"
More Examples
Simple Prompts (No Variables)
# Generate a blog post outline
upg generate "Create an outline for a blog post about machine learning basics" \
--save --name "blog-outline" \
--tag content --tag blog
# Generate coding guidelines
upg generate "Write Python code style guidelines for a team" \
--save --name "python-guidelines" \
--tag python --tag guidelines
# Use saved prompts
upg answer blog-outline
upg answer python-guidelines
Prompts with Variables
# Generate a template for API documentation
upg generate "Write documentation for a REST API endpoint" \
-v ENDPOINT \
-v METHOD \
--save --name "api-docs" \
--tag api
# Use the template
upg answer api-docs \
-v ENDPOINT "/users" \
-v METHOD "POST"
🔧 Configuration
UPG provides flexible configuration options through the config command group:
Provider Configuration
# Configure a provider
upg config provider --provider openai --api-key YOUR_API_KEY --model gpt-4o
# Or configure interactively
upg config provider
Default Provider
# Set default provider
upg config set-default openai
# Switch to using Anthropic by default
upg config set-default anthropic
View Configuration
# Show current configuration
upg config show
Example output:
Current Configuration:
----------------------------------------
Default Provider: openai
Configured Providers:
OPENAI:
Model: gpt-4o
Temperature: 1.0
API Key: sk-abcd...wxyz
ANTHROPIC:
Model: claude-3-sonnet-20240229
Temperature: 1.0
API Key: sk-ant...4321
Configuration Storage
The tool stores configuration in ~/.config/upg/config.json:
- API keys for LLM providers
- Default provider settings
- Provider-specific configurations
- Saved prompts and their metadata
🗃️ Prompt Storage
Prompts are stored with:
- Unique name
- Description
- Variables list (if any)
- Tags for categorization
- Creation and update timestamps
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
⭐ Found this useful? Star the repo and share it!
Metadata
Release files for upg-cli 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| upg_cli-1.0.0.tar.gz | 22.3 kB | Without provenance | Details for upg_cli-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| upg_cli-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for upg_cli-1.0.0-py3-none-any.whl |
Total release size: 45.6 kB
Release files / upg_cli-1.0.0.tar.gz
| Download URL | upg_cli-1.0.0.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa8730be8b5db6562e57113c8331767ed9c113faee397e84cd7c3528bf1c7fa7
|
|
BLAKE2b-256 checksum How to use checksums |
115b8e759bb9430039c7cd4cabf1f3c9cb75677a50990a2ceb645cf1a20912d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.11 Linux/6.8.0-1021-azure
|
Release files / upg_cli-1.0.0-py3-none-any.whl
| Download URL | upg_cli-1.0.0-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f2f007b36c006ede1e5c0ee7668a865639352bf1cb31841193537a830300f43
|
|
BLAKE2b-256 checksum How to use checksums |
39957bde3015be92a6fdad0d77a8b4b4c30fffaf04d03e1d4664478a51520d05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.11 Linux/6.8.0-1021-azure
|
Security for upg-cli 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.