epro-cli
v2.0.0
Published
AI-powered prompt enhancement and translation CLI tool
Maintainers
Readme
epro CLI - AI-Powered Prompt Enhancement and Translation Tool
A command-line interface (CLI) tool that enhances and translates prompts for AI models using Google Generative AI (Gemini) via the @google/genai library.
Table of Contents
- Installation
- Configuration
- Usage
- Detailed Examples
- Supported Languages
- Best Practices
- Troubleshooting
- Contributing
Installation
Install from npm (Recommended)
npm install -g epro-cliInstall from source
git clone https://github.com/ledhcg/epro-cli.git
cd epro-cli
npm install
npm run build
npm linkConfiguration
Step 1: Get your Gemini API Key
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the generated API key
Step 2: Set up the API Key
On Windows:
set GEMINI_API_KEY=your-api-key-hereFor permanent setup:
- Open System Properties > Environment Variables
- Add new variable:
GEMINI_API_KEYwith your API key value
On macOS/Linux:
export GEMINI_API_KEY="your-api-key-here"Add permanently to ~/.bashrc or ~/.zshrc:
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrcUsage
Interactive Mode
Start an interactive session to process multiple prompts continuously:
eproIn this mode, you can:
Available Commands:
/help- Display available commands/language <code>- Set target language (e.g., en, fr, ja, ko, vi)/context <text>- Set context for prompt enhancement/context- Clear current context/exit- Exit interactive mode
Example Session:
🚀 Welcome to epro interactive mode!
Type /help for available commands or /exit to quit.
> /language fr
✅ Language set to: fr
> /context web development with React
✅ Context updated
> create login form
🤖 Enhancing prompt...
✔ Prompt enhanced
🌐 Translating to fr...
✔ Translation complete
📝 Result:
Créer un composant de formulaire de connexion React avec les exigences suivantes:
1. **Structure du formulaire:**
- Champ de saisie pour email/nom d'utilisateur avec validation
- Champ de saisie pour mot de passe avec fonctionnalité afficher/masquer
- Case à cocher "Se souvenir de moi"
- Bouton de soumission "Se connecter"
- Lien "Mot de passe oublié?"
2. **Validation:**
- L'email doit être au format valide
- Le mot de passe doit contenir au moins 8 caractères
- Afficher les erreurs en temps réel
[... more content ...]
> /exit
👋 Goodbye!Direct Mode
Process a single prompt and exit:
Basic Syntax:
epro [options] "prompt content"Options:
-e, --enhance- Only enhance the prompt (no translation)-t, --translate- Only translate (no enhancement)--lang <code>- Target language (default: en)--help- Display help
Detailed Examples
1. Default: Enhance and Translate to English
epro "create function to sort array"Output:
📝 Result:
Create a comprehensive sorting function with the following specifications:
1. Function should accept an array of comparable elements (numbers, strings, or objects)
2. Implement multiple sorting algorithms (quicksort, mergesort, bubblesort)
3. Include an optional parameter for sort order (ascending/descending)
4. Handle edge cases: empty arrays, single elements, duplicate values
5. Add type safety with TypeScript generics
6. Include time and space complexity documentation
7. Provide usage examples and unit tests2. Enhance Only (Keep Original Language)
epro -e "build REST API"3. Translate Only to Japanese
epro -t --lang ja "Hello, how are you today?"Output:
📝 Result:
こんにちは、今日はお元気ですか?4. Using Inline Commands
epro "/language es /context mobile development Create user profile screen"5. Pipeline with Other Tools
# Save result to file
epro "implement caching strategy" > cache-prompt.txt
# Copy to clipboard (macOS)
epro "optimize database queries" | pbcopy
# Use with other commands
echo "validate email" | xargs epro -eSupported Languages
| Code | Language | Code | Language | |------|----------|------|----------| | en | English | ko | Korean | | es | Spanish | ja | Japanese | | fr | French | zh | Chinese | | de | German | vi | Vietnamese | | it | Italian | th | Thai | | pt | Portuguese | ar | Arabic | | ru | Russian | hi | Hindi |
Best Practices
1. Use Appropriate Context
# Set context for programming tasks
> /context developing a Node.js REST API with Express and TypeScript
# Set context for content writing
> /context writing technical documentation for senior developers2. Keep Prompts Concise
# Instead of:
epro "I want you to help me write a function that handles array sorting"
# Use:
epro "array sorting function"3. Combine Multiple Operations
# Step 1: Enhance prompt
epro -e "CRUD operations" > enhanced.txt
# Step 2: Translate result
cat enhanced.txt | xargs -I {} epro -t --lang de "{}"4. Use for Different Domains
# Programming
epro "/context backend development implement user authentication"
# Data Science
epro "/context machine learning create neural network"
# DevOps
epro "/context kubernetes deploy microservices"Troubleshooting
1. "API key not found" Error
Solution: Verify environment variable:
echo $GEMINI_API_KEY # Linux/macOS
echo %GEMINI_API_KEY% # Windows2. Network Connection Issues
Solutions:
- Check internet connection
- Verify firewall/proxy settings
- Try again after a few seconds
3. Unexpected Results
Solutions:
- Add more specific context
- Use clearer prompts
- Try enhance-only or translate-only mode
4. Changing AI Model
Edit src/config.ts:
export const GEMINI_MODEL = 'gemini-2.5-flash'; // or other available models5. Rate Limiting
If you encounter rate limits:
- Wait a few seconds between requests
- Consider implementing request queuing
- Check your API quota in Google AI Studio
Advanced Usage
Custom Configurations
Create .eprorc in your home directory:
{
"defaultLanguage": "en",
"defaultModel": "gemini-2.5-flash",
"enhanceSystemPrompt": "Custom enhancement instructions..."
}Scripting Examples
#!/bin/bash
# Batch process multiple prompts
for prompt in "create navbar" "build footer" "design sidebar"; do
epro -e "$prompt" >> components-prompts.txt
echo "---" >> components-prompts.txt
doneContributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
git clone https://github.com/yourusername/epro-cli.git
cd epro-cli
npm install
npm run dev -- "test prompt"License
MIT License - see the LICENSE file for details.
Support
- 🐛 Report bugs: GitHub Issues
- 💡 Request features: GitHub Discussions
- 📧 Contact: [email protected]
Changelog
v2.0.0
- Migrated to @google/genai library
- Added interactive mode
- Improved error handling
- Added context support
- Updated to latest Gemini models
v1.0.0
- Initial release
- Basic enhance and translate features
