promptrix-cli
v0.1.24
Published
Professional prompt engineering CLI from The Prompt Engineering Platform. Optimize AI prompts with advanced tools and analytics.
Maintainers
Readme
Promptrix CLI
🚀 AI-powered prompt optimization from your terminal
Promptrix CLI brings the power of AI prompt optimization directly to your development workflow. Optimize prompts for ChatGPT, Claude, Gemini, and more with a simple command.
🎯 Features
- Instant Optimization: Transform any prompt into a more effective version
- Advanced Methods: 21+ optimization methods with category and complexity filtering
- Multi-Model Support: Optimize for specific AI models (GPT-4, Claude, Gemini, etc.)
- Multiple Styles: Choose from concise, detailed, creative, or technical outputs
- Pipe Support: Integrate seamlessly with Unix tools and scripts
- Free Tier: 100 optimizations per month at no cost
- Developer-Friendly: JSON output, quiet mode, and scriptable interface
📦 Installation
npm install -g promptrix-cliOr use directly with npx:
npx promptrix-cli "Your prompt here"🔑 Authentication
Get your free API key (100 optimizations/month):
- Visit https://promptrix.co/developers
- Sign up for a free account
- Copy your API key
- Configure the CLI:
promptrix config --key your-api-key-hereAlternatively, set via environment variable:
export PROMPTRIX_API_KEY=your-api-key-here📖 Usage
Basic Optimization
promptrix "Explain quantum computing"Target Specific Models
# Optimize for GPT-4
promptrix "Write a Python function" --target gpt-4
# Optimize for Claude
promptrix "Analyze this text" --target claude-3
# Optimize for Gemini
promptrix "Create a story" --target geminiStyle Options
# Concise output
promptrix "Summarize machine learning" --style concise
# Detailed explanation
promptrix "Explain Docker" --style detailed
# Creative writing
promptrix "Write a story opening" --style creative
# Technical documentation
promptrix "Document this API" --style technicalPipe from Files or Commands
# From file
cat prompt.txt | promptrix
# From another command
echo "Explain this concept" | promptrix
# Chain with other tools
promptrix "Generate SQL query" | mysql databaseJSON Output
promptrix "Your prompt" --format jsonOutput:
{
"improvedPrompt": "...",
"improvements": ["..."],
"confidence": 0.95
}Check Usage
promptrix usageOutput:
📊 Promptrix Usage Stats
━━━━━━━━━━━━━━━━━━━━━━
Used: 42 / 100 (42%)
Remaining: 58
Resets: 01/01/2024Optimization Methods
List available optimization methods:
promptrix methodsOutput with enhanced metadata:
🔧 Available Optimization Methods
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Your tier: PRO
Available: 21 methods
Locked: 0 methods
✅ Available Methods:
🧠 Chain of Thought
Adds systematic reasoning steps to prompts
⭐ Basic • 🧠 Reasoning & Analysis • ⏱️ 5-15s
Tier: FREE
Use: promptrix "prompt" --method CHAIN_OF_THOUGHT
✅ Chain-of-Verification
Reduces hallucinations by adding fact-checking
⭐⭐ Intermediate • 🔍 Verification & Quality • ⏱️ 15-30s
Tier: PRO
Use: promptrix "prompt" --method CHAIN_OF_VERIFICATION
💡 Tip: Filter methods with --category or --complexity flagsFilter Methods by Category
# Show only verification methods
promptrix methods --category verification
# Show only reasoning methods
promptrix methods --category reasoning
# Available categories:
# - verification: Reduce hallucinations, improve accuracy
# - reasoning: Systematic thinking, multi-perspective analysis
# - structure: Organize output, format responses
# - learning: Learn from examples, improve patterns
# - planning: Break down complex tasks, strategizeFilter Methods by Complexity
# Show only basic methods (fast, simple)
promptrix methods --complexity basic
# Show only advanced methods (complex, thorough)
promptrix methods --complexity advanced
# Complexity levels:
# - basic: ⭐ Quick optimization (5-15s)
# - intermediate: ⭐⭐ Balanced approach (15-30s)
# - advanced: ⭐⭐⭐ Deep optimization (25-45s)Combine Filters
# Find advanced reasoning methods
promptrix methods --category reasoning --complexity advanced
# Find basic verification methods
promptrix methods --category verification --complexity basicUse Advanced Methods
# Apply specific optimization method
promptrix "Explain blockchain" --method CHAIN_OF_VERIFICATION
# Use expert panel method for multiple perspectives
promptrix "Design a system" --method EXPERT_PANEL_SIMULATOR🛠️ Advanced Usage
Configuration File
The CLI stores configuration in ~/.promptrix/config.json:
{
"apiKey": "your-key",
"defaultStyle": "concise",
"defaultTargetModel": "gpt-4",
"analytics": true
}Scripting Example
#!/bin/bash
# optimize_prompts.sh
for file in prompts/*.txt; do
optimized=$(cat "$file" | promptrix --quiet)
echo "$optimized" > "optimized/$(basename "$file")"
doneCI/CD Integration
# GitHub Actions Example
- name: Optimize prompts
run: |
npm install -g @promptrix/cli
echo "${{ secrets.PROMPTRIX_API_KEY }}" | promptrix config --key -
promptrix "Deploy message" > deploy_message.txt🎨 Command Reference
| Command | Description |
|---------|-------------|
| promptrix [prompt] | Optimize a prompt |
| promptrix methods | List optimization methods |
| promptrix methods --category <cat> | Filter methods by category |
| promptrix methods --complexity <level> | Filter methods by complexity |
| promptrix methods show <name> | Show method details |
| promptrix --help | Show help message |
| promptrix --version | Show version |
| promptrix config --key <key> | Set API key |
| promptrix usage | Check usage stats |
Options
| Option | Description | Example |
|--------|-------------|---------|
| --method <name> | Use specific optimization method | --method CHAIN_OF_VERIFICATION |
| --target <model> | Target AI model | --target gpt-4 |
| --style <style> | Output style | --style concise |
| --level <level> | Complexity level | --level expert |
| --format <format> | Output format | --format json |
| --lang <language> | Output language | --lang es |
| --quiet | Suppress decorative output | --quiet |
| --no-analytics | Disable anonymous telemetry | --no-analytics |
Method Filter Options (for promptrix methods command)
| Option | Description | Values |
|--------|-------------|--------|
| --category <cat> | Filter by category | verification, reasoning, structure, learning, planning |
| --complexity <level> | Filter by complexity | basic, intermediate, advanced |
💡 Examples
Development Workflows
# Optimize code documentation
promptrix "Document this function: $(cat function.js)"
# Generate commit messages with verification method
git diff | promptrix "Write commit message for these changes" --method CHAIN_OF_VERIFICATION
# Create test cases with expert panel method
promptrix "Generate test cases for login function" --method EXPERT_PANEL_SIMULATOR
# Find methods suitable for code tasks
promptrix methods --category structure --complexity basicContent Creation
# Blog post outline
promptrix "Create blog outline about AI trends" --style detailed
# Social media posts
promptrix "Tweet about product launch" --style creative --target gpt-4
# Email templates
promptrix "Customer support email for refund request" --style professionalData & Analysis
# SQL queries
promptrix "Query to find top customers by revenue" --style technical
# Data analysis
cat data.csv | head -10 | promptrix "Analyze this data pattern"
# RegEx patterns
promptrix "Regex to match email addresses" --format json🚀 Pro Tips
Save commonly used prompts: Create aliases for frequent optimizations
alias commit-msg='git diff | promptrix "Write commit message"'Batch processing: Process multiple files efficiently
find . -name "*.prompt" -exec promptrix {} \;Integration with AI tools: Pipe optimized prompts directly to AI CLIs
promptrix "Your prompt" | gpt-cliVersion control prompts: Track prompt evolution in git
promptrix "Initial prompt" > prompts/v1.txt git add prompts/v1.txt
📈 Pricing
- Free: 10 optimizations/month
- Pro ($20/month): 1,000 optimizations/month
- Business ($99/month): 10,000 optimizations/month
Upgrade at https://promptrix.co/pricing
🔗 Links
📝 License
Copyright © 2024 Promptrix Inc. All rights reserved.
This software is proprietary and confidential. Unauthorized copying, modification, or distribution is strictly prohibited. See Terms of Service for details.
🤝 Support
Need help? We're here for you:
- 📧 Email: [email protected]
- 🐛 Issues: Report on GitHub
Made with ❤️ by the Promptrix team
