Skip to main content

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

Python 3.8+ PyPI MIT License

Interactive Chat Rich Formatting Secure Keyring


InstallationQuick StartCommandsExamples


✨ Features

💬 Interactive AI Chat

  • Real-time conversation with AI assistants
  • Rich markdown formatting for responses
  • Beautiful Unicode animations while thinking
  • Session persistence across chats

🔐 Secure Configuration

  • Encrypted API key storage using system keyring
  • Automatic validation of API keys
  • Connection testing to verify setup
  • Secure credential management

🎨 Beautiful Terminal UI

  • Rich console output with colors and formatting
  • Loading animations with brain emoji sequences
  • Interactive prompts with validation
  • Progress indicators and status displays

📝 Session Management

  • Create named sessions for different contexts
  • Session history and conversation tracking
  • Multiple agents support
  • Clean session lifecycle management

🏗️ 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[Set API Key]
    E --> K[Test Connection]
    E --> L[Show Config]

    F --> M[Create Session]
    F --> N[End Session]
    F --> O[Session Info]

    B --> P[🔐 Keyring]
    B --> Q[📦 SDK]
    Q --> R[🤖 EnkaliPrime API]

📦 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+
  • enkaliprime SDK (automatically installed)
  • System keyring support (built-in on most systems)

🚀 Quick Start

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!

📖 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
enkaliprime chat ask "message" Send single message and get response
enkaliprime chat history Show conversation history

⚙️ Configuration Commands

Command Description
enkaliprime config set-api-key Set your 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 API connection
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

# Start a conversation with a custom agent
enkaliprime chat interactive --agent "Code Assistant"

# Chat with default assistant, no loading animations
enkaliprime chat interactive --no-loading

Single Message Queries

# Ask a quick question
enkaliprime chat ask "What is the capital of France?"

# Ask with custom agent
enkaliprime chat ask "Explain recursion" --agent "Programming Tutor"

Configuration Management

# Set API key interactively
enkaliprime config set-api-key

# Set API key directly (not recommended for security)
enkaliprime config set-api-key --key ek_bridge_your_key_here

# Test your setup
enkaliprime config test-connection

# View current configuration
enkaliprime config show

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:

  1. Disable progress display:

    $ProgressPreference = "SilentlyContinue"
    enkaliprime chat ask "Hello"
    
  2. Use Python directly:

    python -c "from enkaliprime_cli.main import app; import sys; sys.argv = ['enkaliprime', 'chat', 'ask', 'Hello']; app()"
    
  3. Loading animations are disabled by default in CLI commands to avoid PowerShell conflicts. The SDK still shows its internal brain animation.

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

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


Built with ❤️ by the EnkaliPrime Team

© 2024 EnkaliPrime. All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enkaliprime_cli-0.1.7.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

enkaliprime_cli-0.1.7-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file enkaliprime_cli-0.1.7.tar.gz.

File metadata

  • Download URL: enkaliprime_cli-0.1.7.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for enkaliprime_cli-0.1.7.tar.gz
Algorithm Hash digest
SHA256 c1ad6f8b7e11e96f3e43c0a9a8c45a0c26aa2d6ad197a4bab9913d624bc67b70
MD5 ab73f2ca36682b1bfee8571aaef3a047
BLAKE2b-256 e1b7a4f0a4929071acac17efbd80081d593834555b98452f313589091a3b12ad

See more details on using hashes here.

File details

Details for the file enkaliprime_cli-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for enkaliprime_cli-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c456d8d9e8ce060b0f29e050eae7310bdf06d3fa9849842c736a6e664ebeceaf
MD5 8c95f4b6d802854506eb851d2fd35608
BLAKE2b-256 97a67850784548c5d9bd7dfaee7328838b09e9b17347372bc53e90085cf634e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page