Skip to main content

Comprehensive AI-powered CLI assistant with autonomous agent capabilities

Project description

Kritrima AI CLI - Comprehensive AI Assistant

A sophisticated, multi-layered AI-powered CLI assistant with autonomous agent capabilities, built with Python 3.13.

๐Ÿš€ One-Command Installation

Install Kritrima AI CLI on Windows 11 WSL, macOS, and Linux with a single command:

pip install kritrima-ai-cli

Quick Start

# Launch the AI assistant
kritrima-ai

# Or use the short alias
kai

# Get help
kritrima-ai --help

๐ŸŒŸ Features

Core AI Integration

  • Multi-Provider Support: OpenAI, Azure, Gemini, Ollama, Mistral, DeepSeek, xAI, Groq, ArceeAI, OpenRouter
  • Dynamic Model Discovery: Automatic model detection and switching
  • Autonomous Agent Loop: Sophisticated AI orchestration with tool calling
  • Multi-Modal Input: Text and image processing capabilities

Advanced Code Assistance

  • File Operations: Unified diff processing, patch application, conflict resolution
  • Shell Integration: Cross-platform command execution with sandboxing
  • Git Integration: Repository awareness, diff generation, change tracking
  • Project Analysis: Documentation discovery and context integration

Security & Safety

  • Multi-Platform Sandboxing: Linux Landlock, macOS Seatbelt, Windows restrictions
  • Approval Policies: Configurable command approval workflows
  • Path Validation: Directory traversal protection
  • Secure Storage: Encrypted configuration and session management

Rich User Interface

  • Terminal-Based UI: Rich console interface with real-time updates
  • Interactive Overlays: Model selection, history browsing, session management
  • Advanced Input: Multi-line editing, file suggestions, slash commands
  • Visual Feedback: Progress indicators, notifications, syntax highlighting

Session Management

  • Persistent Sessions: Save and resume conversations
  • Command History: Searchable command history with sensitive data filtering
  • Context Management: Intelligent context optimization and compression
  • Export/Import: Share sessions between instances

๐Ÿ“ฆ Installation

System Requirements

  • Python 3.13+ (Required)
  • pip (Python package manager)
  • Internet connection for AI provider APIs

Platform-Specific Setup

Windows 11 (WSL)

# Update system
sudo apt update && sudo apt upgrade -y

# Install Python 3.13+ if needed
sudo apt install python3.13 python3.13-pip -y

# Install Kritrima AI CLI
pip install kritrima-ai-cli

# Verify installation
kritrima-ai --version

macOS

# Install Python 3.13+ (using Homebrew)
brew install python@3.13

# Install Kritrima AI CLI
pip install kritrima-ai-cli

# Verify installation
kritrima-ai --version

Linux (Ubuntu/Debian)

# Update packages
sudo apt update

# Install Python 3.13+
sudo apt install python3.13 python3.13-pip -y

# Install Kritrima AI CLI
pip install kritrima-ai-cli

# Verify installation
kritrima-ai --version

๐Ÿ”ง Configuration

Environment Variables

# Primary AI Provider
export OPENAI_API_KEY="your-openai-key"
export ANTHROPIC_API_KEY="your-anthropic-key"
export GOOGLE_AI_KEY="your-gemini-key"

# Custom Providers
export CUSTOM_PROVIDER_API_KEY="your-custom-key"
export CUSTOM_PROVIDER_BASE_URL="https://api.custom.com/v1"

# Application Settings
export KRITRIMA_AI_APPROVAL_MODE="suggest"  # suggest, auto-edit, full-auto
export KRITRIMA_AI_MODEL="gpt-4"
export KRITRIMA_AI_PROVIDER="openai"

Configuration Files

  • Global: ~/.kritrima/config.json
  • Project: ./.kritrima/config.json

Example Configuration

{
  "model": "gpt-4",
  "provider": "openai",
  "approvalMode": "suggest",
  "providers": {
    "custom": {
      "name": "Custom Provider",
      "baseURL": "https://api.custom.com/v1",
      "envKey": "CUSTOM_API_KEY"
    }
  },
  "ui": {
    "theme": "dark",
    "notifications": true,
    "autoSave": true
  }
}

๐ŸŽฏ Usage

Basic Commands

# Start interactive session
kritrima-ai

# Single command mode
kritrima-ai "Explain this code file" --file main.py

# Full context mode
kritrima-ai --full-context "Refactor this project"

# Specific model
kritrima-ai --model gpt-4 --provider openai

Slash Commands

  • /help - Show help information
  • /model - Switch AI model/provider
  • /history - View command history
  • /sessions - Browse saved sessions
  • /clear - Clear conversation
  • /compact - Compress context
  • /bug - Generate bug report
  • /diff - Show git differences

File Operations

# Include file contents
@filename.py

# Create/edit files
Please create a new file called app.py with a Flask application

# Apply patches
Create a patch to fix the bug in utils.py

Approval Modes

  • Suggest: Manual approval for all actions
  • Auto-Edit: Automatic file edits, manual commands
  • Full-Auto: Automatic everything (with sandbox)

๐Ÿ”„ Package Management

Update to Latest Version

pip install --upgrade kritrima-ai-cli

Uninstall

# Remove package
pip uninstall kritrima-ai-cli

# Clean up configuration (optional)
rm -rf ~/.kritrima

Development Installation

# Clone repository
git clone https://github.com/kritrima/kritrima-ai-cli.git
cd kritrima-ai-cli

# Install in development mode
pip install -e .

# Install development dependencies
pip install -e ".[dev]"

๐Ÿ—๏ธ Architecture

System Components

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              CLI Entry Point            โ”‚
โ”‚            (kritrima_ai/cli.py)         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚            Application Core             โ”‚
โ”‚          (kritrima_ai/app.py)           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚            Agent Loop System           โ”‚
โ”‚     (kritrima_ai/agent/agent_loop.py)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚          Provider Integration          โ”‚
โ”‚      (kritrima_ai/providers/*.py)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Modules

  • Agent System: Autonomous AI orchestration
  • Provider Integration: Multi-provider AI access
  • Security Framework: Sandboxing and approval systems
  • Storage System: Session and configuration management
  • UI Components: Rich terminal interface
  • Tool System: File operations and shell execution

๐Ÿ”’ Security

Sandboxing

  • Linux: Landlock LSM for file system restrictions
  • macOS: Seatbelt for process sandboxing
  • Windows: Job objects and ACL restrictions
  • Fallback: Safe execution with permission checks

Approval Workflow

  1. Command validation against safe/dangerous lists
  2. Path validation for directory traversal protection
  3. Permission verification for file operations
  4. Resource limit enforcement
  5. User approval for potentially dangerous operations

Data Protection

  • Encrypted storage for sensitive configuration
  • Automatic sensitive data filtering in history
  • Secure API key management
  • Optional data anonymization

๐Ÿšจ Troubleshooting

Common Issues

Python Version Issues

# Check Python version
python3 --version

# If Python 3.13+ not available, install it
# Follow platform-specific instructions above

Permission Issues (Linux/macOS)

# Install for current user only
pip install --user kritrima-ai-cli

# Add to PATH if needed
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Windows PATH Issues

# Add Python Scripts to PATH
$env:Path += ";$env:USERPROFILE\AppData\Roaming\Python\Python313\Scripts"

๐Ÿ“š Resources

๐Ÿค Contributing

We welcome contributions! Please see our contributing guidelines and feel free to submit issues or pull requests.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Ready to get started?

pip install kritrima-ai-cli && kritrima-ai

๐ŸŽ‰ Welcome to the future of AI-powered development!

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

kritrima_ai_cli-1.0.6.tar.gz (251.4 kB view details)

Uploaded Source

Built Distribution

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

kritrima_ai_cli-1.0.6-py3-none-any.whl (279.8 kB view details)

Uploaded Python 3

File details

Details for the file kritrima_ai_cli-1.0.6.tar.gz.

File metadata

  • Download URL: kritrima_ai_cli-1.0.6.tar.gz
  • Upload date:
  • Size: 251.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for kritrima_ai_cli-1.0.6.tar.gz
Algorithm Hash digest
SHA256 8b679b110a0d909b2d3efb5d31174a578806dc9e1f74b9bbab8787a7a822a964
MD5 f22f6372c5dbe2ecafb66845f2edda92
BLAKE2b-256 3553667e222e06a768e81e310db537a1bac4ba86a9cd3962aafba2fba721e2c2

See more details on using hashes here.

File details

Details for the file kritrima_ai_cli-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for kritrima_ai_cli-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c2498c6f49eb8a9a3a88aa6153c59d89d3b105943761904dfe91c38f5e5db762
MD5 d2eb397a2a7ed37312b0e7b4dda97efa
BLAKE2b-256 326761c64b0ef801e20d6107c8d480256ff3e9394c0066c987dff08fdd32b618

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