Command-line interface for EnkaliPrime Chat API
Project description
๐ฅ๏ธ EnkaliPrime CLI
Beautiful Command-Line Interface for AI Chat
Chat with AI directly from your terminal with rich formatting and beautiful animations
Installation โข Quick Start โข Commands โข Examples
โจ Features
๐ฌ Interactive AI Chat
|
๐ Local LLM Support
|
๐จ Beautiful Terminal UI
|
๐ Secure Configuration
|
๐ Session Management
|
๐ฏ Smart Provider Switching
|
๐๏ธ Architecture
graph TD
A[๐ฅ๏ธ Terminal] --> B[enkaliprime CLI]
B --> C{Commands}
C --> D[๐ฌ chat]
C --> E[โ๏ธ config]
C --> F[๐ session]
D --> G[Interactive Chat]
D --> H[Single Message]
D --> I[History View]
E --> J[API Key Config]
E --> K[Ollama Config]
E --> L[Test Connection]
E --> M[Show Config]
F --> N[Create Session]
F --> O[End Session]
F --> P[Session Info]
B --> Q[๐ Keyring]
B --> R[๐ฆ SDK]
R --> S{Provider Router}
S --> T[๐ค EnkaliPrime API]
S --> U[๐ Local Ollama]
Q --> V[(API Keys)]
Q --> W[(Ollama Models)]
๐ฆ Installation
From PyPI (Recommended)
pip install enkaliprime-cli
From Source
git clone https://github.com/enkaliprime/enkaliprime-cli.git
cd enkaliprime-cli
pip install -e .
Requirements
- Python 3.8+
enkaliprimeSDK (automatically installed)- System keyring support (built-in on most systems)
- Optional: Ollama for local LLM support
๐ Local LLM Support (Ollama)
EnkaliPrime CLI supports local AI models through Ollama integration, allowing you to run AI conversations without API costs and with complete privacy.
Quick Local Setup
-
Install Ollama:
# Download from https://ollama.ai/ # Or use package manager: # Linux: curl -fsSL https://ollama.ai/install.sh | sh # macOS: brew install ollama # Windows: winget install Ollama.Ollama
-
Start Ollama:
ollama serve -
Pull a model:
ollama pull llama2 # General purpose ollama pull codellama # Code assistant ollama pull mistral # Fast and capable
-
Configure CLI:
enkaliprime config set-ollama-model # Interactive model selection
-
Start using local AI:
enkaliprime chat interactive --local enkaliprime chat ask "Hello local AI!" --local
Local vs Remote Comparison
| Feature | Remote (EnkaliPrime) | Local (Ollama) |
|---|---|---|
| Cost | API usage fees | Free (one-time setup) |
| Privacy | Cloud processing | Local processing |
| Speed | Network dependent | Local inference |
| Models | Curated selection | Any Ollama model |
| Setup | API key only | Ollama installation |
| Offline | โ Requires internet | โ Works offline |
๐ Quick Start
Option A: Remote AI (EnkaliPrime API)
1. Configure API Key
enkaliprime config set-api-key
# Follow the secure prompt to enter your API key
2. Test Connection
enkaliprime config test-connection
# Verify everything is working
3. Start Chatting
enkaliprime chat interactive
# Begin your AI conversation!
Option B: Local AI (Ollama)
1. Install and Setup Ollama
# Install Ollama (visit https://ollama.ai/)
ollama serve
ollama pull llama2
2. Configure Default Model
enkaliprime config set-ollama-model
# Interactive model selection from available Ollama models
3. Start Local Chat
enkaliprime chat interactive --local
# Chat with your local AI model!
Hybrid Usage
You can use both remote and local AI:
# Remote AI (default)
enkaliprime chat interactive
# Local AI (when configured)
enkaliprime chat interactive --local
# Check available providers
enkaliprime chat providers
๐ Commands
Main Commands
| Command | Description |
|---|---|
enkaliprime --help |
Show help and available commands |
enkaliprime info |
Show CLI information and features |
enkaliprime --version |
Show version information |
๐ฌ Chat Commands
| Command | Description |
|---|---|
enkaliprime chat interactive |
Start interactive chat session (remote AI) |
enkaliprime chat interactive --local |
Start interactive chat with local Ollama model |
enkaliprime chat ask "message" |
Send single message and get response |
enkaliprime chat ask "message" --local |
Send message to local Ollama model |
enkaliprime chat providers |
List available AI providers and models |
enkaliprime chat history |
Show conversation history |
โ๏ธ Configuration Commands
| Command | Description |
|---|---|
enkaliprime config set-api-key |
Set your EnkaliPrime API key securely |
enkaliprime config get-api-key |
Show masked API key |
enkaliprime config remove-api-key |
Remove stored API key |
enkaliprime config test-connection |
Test EnkaliPrime API connection |
enkaliprime config set-ollama-model |
Configure default Ollama model |
enkaliprime config get-ollama-model |
Show current Ollama model setting |
enkaliprime config remove-ollama-model |
Remove Ollama model configuration |
enkaliprime config show-ollama |
Show Ollama status and available models |
enkaliprime config show |
Show current configuration |
๐ Session Commands
| Command | Description |
|---|---|
enkaliprime session create |
Create new chat session |
enkaliprime session current |
Show current session info |
enkaliprime session end |
End current session |
enkaliprime session list |
List all sessions |
enkaliprime session clear-history |
Clear conversation history |
๐ก Examples
Interactive Chat Session
# Remote AI with custom agent
enkaliprime chat interactive --agent "Code Assistant"
# Local AI with configured Ollama model
enkaliprime chat interactive --local
# Local AI with specific model override
enkaliprime chat interactive --local --model codellama
# Remote AI without loading animations
enkaliprime chat interactive --no-loading
Single Message Queries
# Remote AI - quick question
enkaliprime chat ask "What is the capital of France?"
# Local AI - private, no-cost query
enkaliprime chat ask "Explain quantum computing" --local
# Local AI with specific model
enkaliprime chat ask "Write a Python function" --local --model codellama
# Remote AI with custom agent
enkaliprime chat ask "Explain recursion" --agent "Programming Tutor"
Configuration Management
# EnkaliPrime API Configuration
enkaliprime config set-api-key
enkaliprime config test-connection
enkaliprime config show
# Ollama Local AI Configuration
enkaliprime config set-ollama-model # Interactive model selection
enkaliprime config get-ollama-model # Show current model
enkaliprime config show-ollama # Show Ollama status & models
enkaliprime config remove-ollama-model # Remove model config
# Provider Management
enkaliprime chat providers # List available AI providers
Session Management
# Create a new session with custom agent
enkaliprime session create --name "Math Tutor" --avatar "๐"
# Check current session
enkaliprime session current
# End the current session
enkaliprime session end
# Clear conversation history
enkaliprime session clear-history
๐ง Troubleshooting
Command Not Found Error
If you get "enkaliprime" command not found after installation:
Windows (PowerShell/Command Prompt)
Check if Python Scripts directory is in PATH:
where python
# This should show your Python installation directory
Add Python Scripts to PATH (run as Administrator):
setx PATH "%PATH%;C:\Python313\Scripts" # Replace with your Python version
Or use full path:
& "C:\Users\%USERNAME%\AppData\Roaming\Python\Python313\Scripts\enkaliprime.exe" --help
Linux/macOS
Check PATH:
echo $PATH
which python3
Add to PATH in ~/.bashrc or ~/.zshrc:
export PATH="$HOME/.local/bin:$PATH" # For user installations
# OR
export PATH="/usr/local/bin:$PATH" # For system installations
Alternative Usage
Use Python module directly (recommended for PowerShell):
python -m enkaliprime_cli info
python -c "from enkaliprime_cli.main import app; import sys; sys.argv = ['enkaliprime', 'chat', 'interactive']; app()"
Use pipx for isolated installation:
pip install pipx
pipx install enkaliprime-cli
# Now enkaliprime command works globally
PowerShell Compatibility
If you experience glitches with loading animations in PowerShell:
-
Disable progress display:
$ProgressPreference = "SilentlyContinue" enkaliprime chat ask "Hello"
-
Use Python directly:
python -c "from enkaliprime_cli.main import app; import sys; sys.argv = ['enkaliprime', 'chat', 'ask', 'Hello']; app()"
-
Loading animations are disabled by default in CLI commands to avoid PowerShell conflicts. The SDK still shows its internal brain animation.
Ollama Setup Issues
"Ollama not available" error:
-
Install Ollama:
# Visit https://ollama.ai/ for installation instructions # Windows: winget install Ollama.Ollama # macOS: brew install ollama # Linux: curl -fsSL https://ollama.ai/install.sh | sh
-
Start Ollama service:
ollama serve # Keep this running in a separate terminal
-
Pull a model:
ollama pull llama2 # General purpose model ollama pull codellama # Code-focused model
-
Configure CLI:
enkaliprime config set-ollama-model # Select your preferred model
Test Ollama connection:
enkaliprime config show-ollama
# Should show available models and โ
status
Common Ollama issues:
- Port conflict: Default port 11434 may be in use
- Memory: Large models need sufficient RAM
- Storage: Models require disk space (2-7GB each)
API Key Issues
"No API key configured" error:
enkaliprime config set-api-key
# Enter your API key when prompted
Test connection:
enkaliprime config test-connection
๐ Security
- Encrypted Storage: API keys are stored securely using your system's keyring
- No Plain Text: Keys are never displayed in full, only masked
- Secure Prompts: Password-style input for sensitive information
- Validation: Automatic format checking for API keys
- Local AI Privacy: Ollama models process conversations locally with zero data transmission
Best Practices
# โ
Good: Use interactive setup
enkaliprime config set-api-key
# โ Bad: Expose key in command history
enkaliprime config set-api-key --key ek_bridge_secret_key
๐จ Terminal Features
Rich Formatting
- Markdown rendering for AI responses
- Syntax highlighting for code blocks
- Colored output for better readability
- Unicode emojis for visual appeal
Loading Animations
๐ง Thinking... 1.2s
๐ง Thinking... 2.8s
๐ญ Thinking... 3.1s
๐ก Thinking... 3.7s
โจ Thinking... 4.2s
Interactive Prompts
- Auto-completion for commands and options
- Input validation with helpful error messages
- Confirmation prompts for destructive operations
๐ ๏ธ Development
Setup for Development
git clone https://github.com/enkaliprime/enkaliprime-cli.git
cd enkaliprime-cli
pip install -e ".[dev]"
Running Tests
pytest
Code Quality
# Format code
black enkaliprime_cli
# Sort imports
isort enkaliprime_cli
# Type checking
mypy enkaliprime_cli
# Linting
ruff enkaliprime_cli
๐ License
This project is licensed under the MIT License โ see the LICENSE file for details.
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
๐ Links
| Resource | Link |
|---|---|
| ๐ Documentation | api.enkaliprime.com/docs |
| ๐ Website | api.enkaliprime.com |
| ๐ฆ PyPI | pypi.org/project/enkaliprime-cli |
| ๐ GitHub | github.com/enkaliprime/enkaliprime-cli |
Built with โค๏ธ by the EnkaliPrime Team
ยฉ 2024 EnkaliPrime. All rights reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enkaliprime_cli-0.6.0.tar.gz.
File metadata
- Download URL: enkaliprime_cli-0.6.0.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6362f7d1a729996823a88bd260e652c8f48938a767de05d4a8e213e86afef2e4
|
|
| MD5 |
3c0b1fc20b8b7c6656f2ee8d92490db9
|
|
| BLAKE2b-256 |
6a5e68e1b20236c8bea49f6502e96e8308ca5b94161ff773c576ac7158114856
|
File details
Details for the file enkaliprime_cli-0.6.0-py3-none-any.whl.
File metadata
- Download URL: enkaliprime_cli-0.6.0-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7022aaa5e1507c37ff1a9ef097bfb8fb8916613a61bcc733daa7610c3708750d
|
|
| MD5 |
6c39ebe8d873b7b3b930693da069e760
|
|
| BLAKE2b-256 |
2527ef6a0904965dece65c045613d462e0d274e2e818c09166ee3bad69727eb0
|