terminal-ai-groq
v1.0.7
Published
Interactive AI assistant in your terminal powered by Groq
Downloads
323
Maintainers
Readme
Terminal AI Assistant
An interactive AI assistant for your terminal powered by Groq AI.
Features
- 🤖 Interactive chat with AI directly in your terminal
- 💬 Maintains conversation history for context-aware responses
- 🎨 Colorful and user-friendly interface
- ⚡ Fast responses powered by Groq's LLM infrastructure
- 🔄 Continuous conversation until you exit
Setup
1. Get Your Groq API Key
- Visit Groq Console
- Sign up or log in
- Create a new API key
- Copy the API key
2. Configure API Keys for Users
Open index.js and update the API keys for different users:
const API_KEYS = {
'devan': 'gsk_YOUR_API_KEY_FOR_DEVAN',
'john': 'gsk_YOUR_API_KEY_FOR_JOHN',
'alice': 'gsk_YOUR_API_KEY_FOR_ALICE',
'default': 'gsk_DEFAULT_API_KEY' // Used if name doesn't match
};Replace with your actual API keys:
const API_KEYS = {
'devan': 'gsk_abc123...',
'john': 'gsk_xyz789...',
'alice': 'gsk_def456...',
'default': 'gsk_default123...'
};How it works:
- When you start the app, it asks for your name
- Based on your name, it uses the corresponding API key
- If your name isn't in the list, it uses the 'default' key
- Names are case-insensitive (Devan = devan = DEVAN)
3. Install Dependencies
npm installUsage
Run directly:
npm startOr install globally and use the ai command:
npm install -g .
aiOr use with npx (after publishing):
npx terminal-aiCommands
- Type your question and press Enter to chat with AI
- Type
exitorquitto leave - Press
Ctrl+Cto exit
Example Conversation
👤 Please enter your name: Devan
✅ Welcome, Devan!
🤖 You: What is JavaScript?
🤔 AI is thinking...
✨ AI: JavaScript is a high-level, interpreted programming language...
🤖 You: How do I create a function?
🤔 AI is thinking...
✨ AI: In JavaScript, you can create a function in several ways...
🤖 You: exit
👋 Goodbye, devan! Have a great day!Available Models
You can change the AI model in index.js:
llama-3.3-70b-versatile(default) - Great balance of speed and qualityllama-3.1-70b-versatile- Alternative Llama modelmixtral-8x7b-32768- Mixtral model with large contextgemma2-9b-it- Smaller, faster model
Customization
Change the model:
Edit the model parameter in index.js:
model: 'mixtral-8x7b-32768'Adjust response creativity:
Modify the temperature parameter (0.0 - 2.0):
temperature: 0.7 // Lower = more focused, Higher = more creativeChange max response length:
Adjust max_tokens:
max_tokens: 2048 // Longer responsesLicense
MIT
