Professional prompt engineering CLI from The Prompt Engineering Platform. Optimize AI prompts with advanced tools and analytics.
npm install 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.
- 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
``bash`
npm install -g promptrix-cli
Or use directly with npx:
`bash`
npx promptrix-cli "Your prompt here"
Get your free API key (100 optimizations/month):
1. Visit https://promptrix.co/developers
2. Sign up for a free account
3. Copy your API key
4. Configure the CLI:
`bash`
promptrix config --key your-api-key-here
Alternatively, set via environment variable:
`bash`
export PROMPTRIX_API_KEY=your-api-key-here
`bash`
promptrix "Explain quantum computing"
`bashOptimize for GPT-4
promptrix "Write a Python function" --target gpt-4
$3
`bash
Concise output
promptrix "Summarize machine learning" --style conciseDetailed explanation
promptrix "Explain Docker" --style detailedCreative writing
promptrix "Write a story opening" --style creativeTechnical documentation
promptrix "Document this API" --style technical
`$3
`bash
From file
cat prompt.txt | promptrixFrom another command
echo "Explain this concept" | promptrixChain with other tools
promptrix "Generate SQL query" | mysql database
`$3
`bash
promptrix "Your prompt" --format json
`Output:
`json
{
"improvedPrompt": "...",
"improvements": ["..."],
"confidence": 0.95
}
`$3
`bash
promptrix usage
`Output:
`
š Promptrix Usage Stats
āāāāāāāāāāāāāāāāāāāāāā
Used: 42 / 100 (42%)
Remaining: 58
Resets: 01/01/2024
`$3
List available optimization methods:
`bash
promptrix methods
`Output 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 flags
`$3
`bash
Show only verification methods
promptrix methods --category verificationShow only reasoning methods
promptrix methods --category reasoningAvailable 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, strategize
`$3
`bash
Show only basic methods (fast, simple)
promptrix methods --complexity basicShow only advanced methods (complex, thorough)
promptrix methods --complexity advancedComplexity levels:
- basic: ā Quick optimization (5-15s)
- intermediate: āā Balanced approach (15-30s)
- advanced: āāā Deep optimization (25-45s)
`$3
`bash
Find advanced reasoning methods
promptrix methods --category reasoning --complexity advancedFind basic verification methods
promptrix methods --category verification --complexity basic
`$3
`bash
Apply specific optimization method
promptrix "Explain blockchain" --method CHAIN_OF_VERIFICATIONUse expert panel method for multiple perspectives
promptrix "Design a system" --method EXPERT_PANEL_SIMULATOR
`š ļø Advanced Usage
$3
The CLI stores configuration in
~/.promptrix/config.json:`json
{
"apiKey": "your-key",
"defaultStyle": "concise",
"defaultTargetModel": "gpt-4",
"analytics": true
}
`$3
`bash
#!/bin/bash
optimize_prompts.sh
for file in prompts/*.txt; do
optimized=$(cat "$file" | promptrix --quiet)
echo "$optimized" > "optimized/$(basename "$file")"
done
`$3
`yaml
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 | Filter methods by category |
| promptrix methods --complexity | Filter methods by complexity |
| promptrix methods show | Show method details |
| promptrix --help | Show help message |
| promptrix --version | Show version |
| promptrix config --key | Set API key |
| promptrix usage | Check usage stats |$3
| Option | Description | Example |
|--------|-------------|---------|
|
--method | Use specific optimization method | --method CHAIN_OF_VERIFICATION |
| --target | Target AI model | --target gpt-4 |
| --style