Skip to main content

Multi-Provider AI Assistant for developers and power users

Project description

DrGPT - Multi-Provider AI Assistant

Python Version License: MIT Code style: black

DrGPT is a powerful, extensible command-line AI assistant that supports multiple AI providers including OpenAI, Anthropic, Google, and custom APIs. It's designed for developers, system administrators, and power users who want intelligent assistance directly in their terminal.

โœจ Features

  • ๐Ÿค– Multi-Provider Support: OpenAI (GPT-4, GPT-4o-mini), Anthropic (Claude), Google (Gemini), and custom APIs
  • ๐Ÿ’ป Interactive Shell Commands: Generate and execute shell commands safely with confirmation
  • ๐Ÿ”ง Pure Code Generation: Generate clean code without explanations in markdown format
  • ๐Ÿ“ Text Editor Integration: Use your favorite editor for complex prompt composition
  • ๐Ÿ’ฌ Interactive AI Interface: Continuous chat mode with special commands and context
  • ๐ŸŽจ Rich Output: Beautiful markdown rendering, syntax highlighting, and formatted panels
  • โšก Streaming Responses: Real-time response streaming with live formatting
  • โš™๏ธ Highly Configurable: Extensive configuration options with elegant status displays
  • ๐Ÿ” Secure: Encrypted API key storage and safe command execution
  • ๐Ÿš€ Fast: Optimized for speed with animated loading indicators
  • ๐ŸŒ Cross-Platform: Full support for Windows, macOS, and Linux

๐Ÿš€ Quick Start

Installation

# Install from source
git clone https://github.com/DrDataYE/drgpt.git
cd drgpt
pip install -e .

Basic Setup

  1. Set your API key (choose your preferred provider):
# OpenAI (recommended for beginners)
drgpt --provider openai --api-key YOUR_OPENAI_API_KEY

# Anthropic (Claude)
drgpt --provider anthropic --api-key YOUR_ANTHROPIC_API_KEY

# Google (Gemini)
drgpt --provider google --api-key YOUR_GOOGLE_API_KEY
  1. Start using DrGPT:
drgpt "Explain how Python decorators work"

Environment Variables

# Windows (PowerShell)
$env:OPENAI_API_KEY = "your-api-key-here"

# Linux/macOS
export OPENAI_API_KEY="your-api-key-here"

๐Ÿ“– Usage Guide

๐Ÿค– Basic AI Queries

# General questions with beautiful markdown rendering
drgpt "What is quantum computing?"

# Get help with programming (formatted code blocks)
drgpt "How do I implement a binary search in Python?"

# System administration
drgpt "How to monitor disk usage on Linux?"

๐Ÿ’ป Pure Code Generation

Generate clean code without explanations:

# Generate Python function (code only)
drgpt --code "Create a function to calculate fibonacci numbers"
drgpt -c "Create a function to calculate fibonacci numbers"  # Short form

# Generate JavaScript code
drgpt --code "Create a React component for user authentication"
drgpt -c "Create a React component for user authentication"  # Short form

# Generate SQL query
drgpt --code "Write a query to find top 10 customers by revenue"
drgpt -c "Write a query to find top 10 customers by revenue"  # Short form

๐Ÿ› ๏ธ Interactive Shell Commands

Generate and execute shell commands safely:

# Generate shell command with execution options
drgpt --shell "Install Docker on Ubuntu"
drgpt -s "Install Docker on Ubuntu"  # Short form

# Output shows:
# Generated Command: sudo apt-get update && sudo apt-get install docker.io
# [E]xecute, [D]escribe, [A]bort (e/d/a):

Options:

  • [E]xecute: Run the command with confirmation
  • [D]escribe: Get detailed explanation
  • [A]bort: Cancel safely

๐Ÿ“ Text Editor Integration

Use your preferred text editor for complex prompts:

# Open editor for input composition
drgpt --editor
drgpt -e  # Short form

# Supports: VS Code, nano, vim, notepad, gedit
# Respects EDITOR and VISUAL environment variables

๐Ÿ’ฌ Interactive AI Interface

Start a continuous chat session:

# Launch interactive mode
drgpt --interface
drgpt -i  # Short form

# Interactive session:
! What is machine learning?
! code: Create a Python class for data processing
! shell: Find all Python files larger than 1MB
! help
! exit

Special Commands:

  • help - Show available commands
  • status - Current configuration
  • providers - List AI providers
  • clear - Clear screen
  • exit/quit - Exit interface

Special Modes:

  • code: [prompt] - Code-only responses
  • shell: [prompt] - Shell commands with execution

๐ŸŽ›๏ธ Output Options

# Disable streaming for immediate formatted output
drgpt --no-streaming "Explain machine learning concepts"

# Get plain text output (no markdown formatting)
drgpt --no-markdown "Simple explanation without formatting"

# Save response to file
drgpt --output response.md "Generate API documentation"
drgpt -o response.md "Generate API documentation"  # Short form

๐Ÿ”ง Provider Management

# List all available providers and models
drgpt --list-providers

# Switch providers and models
drgpt --provider anthropic --model claude-3-sonnet

# Check current status
drgpt --status

โš™๏ธ Advanced Usage

# Custom temperature (creativity level)
drgpt --temperature 0.8 "Write a creative story about AI"

# Limit response length
drgpt --max-tokens 500 "Summarize machine learning"

# Combine multiple options
drgpt --code --no-streaming --output functions.py "Create utility functions for file operations"
drgpt -c --no-streaming -o functions.py "Create utility functions for file operations"  # With shortcuts

# Chat session
drgpt --chat session_1 "Let's discuss Python programming"
drgpt -ch session_1 "Let's discuss Python programming"  # Short form

๐Ÿ›ก๏ธ Security Features

Safe Command Execution

  • Confirmation Required: All shell commands require user confirmation
  • Timeout Protection: Commands timeout after 5 minutes
  • Error Handling: Safe execution with proper error reporting
  • Abort Option: Easy cancellation for any command

Secure Configuration

  • Encrypted API Keys: Secure local storage
  • Environment Variables: Support for env-based configuration
  • No Data Logging: No transmission beyond chosen AI provider

๐ŸŒ Cross-Platform Support

Platform Editors Shell Commands
Windows notepad, VS Code, Notepad++ PowerShell, CMD Windows-specific
macOS VS Code, nano, vim, vi bash, zsh macOS-specific
Linux VS Code, nano, vim, gedit bash, zsh, fish Distribution-specific

โš™๏ธ Configuration

Configuration File

DrGPT stores configuration in ~/.config/drgpt/config.

Supported Providers

Provider Models API Key Required
OpenAI gpt-4, gpt-4o, gpt-4o-mini, gpt-3.5-turbo Yes
Anthropic claude-3-haiku, claude-3-sonnet, claude-3-opus Yes
Google gemini-pro, gemini-pro-vision Yes
Custom User-defined Optional

๐Ÿ”ง Development

Setting up Development Environment

# Clone the repository
git clone https://github.com/DrDataYE/drgpt.git
cd drgpt

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\\Scripts\\activate

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

# Run tests
python tests/test_basic.py

Project Structure

drgpt/
โ”œโ”€โ”€ drgpt/                  # Main package
โ”‚   โ”œโ”€โ”€ core/              # Core functionality
โ”‚   โ”‚   โ”œโ”€โ”€ config.py      # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ ai_interface.py # AI provider interface
โ”‚   โ”‚   โ””โ”€โ”€ manager.py     # Main manager class
โ”‚   โ”œโ”€โ”€ cli/               # Command-line interface
โ”‚   โ”‚   โ””โ”€โ”€ main.py        # CLI implementation
โ”‚   โ””โ”€โ”€ __init__.py        # Package initialization
โ”œโ”€โ”€ tests/                 # Test suite
โ”œโ”€โ”€ docs/                  # Documentation
โ”œโ”€โ”€ ADVANCED_FEATURES.md   # Detailed feature guide
โ”œโ”€โ”€ README.md              # This file
โ””โ”€โ”€ setup.py              # Package setup

๐Ÿ“š Documentation

๐ŸŽฏ Use Cases

โšก CLI Shortcuts

DrGPT provides convenient shortcuts for frequently used options:

Long Option Short Description
--code -c Generate code only (no explanations)
--shell -s Generate shell commands with execution options
--editor -e Open text editor for input composition
--interface -i Start interactive AI interface
--chat -ch Start or continue a chat session
--output -o Save response to file

Examples with shortcuts:

# Instead of: drgpt --code "Create a Python function"
drgpt -c "Create a Python function"

# Instead of: drgpt --shell "List all processes"
drgpt -s "List all processes"

# Instead of: drgpt --editor
drgpt -e

# Instead of: drgpt --interface
drgpt -i

# Instead of: drgpt --output result.md "Explain AI"
drgpt -o result.md "Explain AI"

# Combine shortcuts:
drgpt -c -o code.py "Create a web scraper"

๐ŸŽฏ Use Cases

For Developers

# Code generation workflow
drgpt --editor  # Compose complex requirements
drgpt -e        # Short form
drgpt --code "Implement user authentication with JWT"
drgpt -c "Implement user authentication with JWT"  # Short form
drgpt --code "Create database migration for user roles"
drgpt -c "Create database migration for user roles"  # Short form

For System Administrators

# System management workflow
drgpt --shell "Setup nginx with SSL certificate"
drgpt -s "Setup nginx with SSL certificate"  # Short form
drgpt --shell "Configure automatic backups"
drgpt -s "Configure automatic backups"      # Short form
drgpt --shell "Monitor system performance"
drgpt -s "Monitor system performance"       # Short form

For Learning and Exploration

# Interactive learning session
drgpt --interface
drgpt -i  # Short form
! What is Kubernetes?
! code: Show me a simple Kubernetes deployment
! shell: Install kubectl on my system

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

๐Ÿ“„ License

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

๐ŸŽ‰ What's New in v2.3.0

  • Enhanced Code Mode: Pure code generation without explanations
  • Interactive Shell: Safe command execution with confirmations
  • Editor Integration: Use any text editor for prompt composition
  • Interactive Interface: Continuous chat with special commands
  • Cross-Platform: Full Windows, macOS, and Linux support
  • Security Features: Safe command execution and secure configuration

DrGPT v2.3.0 - The most advanced command-line AI assistant for developers and power users! ๐Ÿš€

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

drgpt-2.3.0.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

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

drgpt-2.3.0-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file drgpt-2.3.0.tar.gz.

File metadata

  • Download URL: drgpt-2.3.0.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for drgpt-2.3.0.tar.gz
Algorithm Hash digest
SHA256 3b94f39f9fba617bc666c5062c79fcddab6433faa33895b137df1213ed45f1c0
MD5 9f3497ef1100666867a527a1d57460a2
BLAKE2b-256 c1f14cfb067c31b31ab4a302f4be0cd7d2306f921f3048ba34095fcd474c8776

See more details on using hashes here.

File details

Details for the file drgpt-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: drgpt-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for drgpt-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50203d9029e15a388279aad30ce81e6a73a65fd64e789ebb5a7df7a260de3885
MD5 f115a8056bc840ba86d6b402a4ca7505
BLAKE2b-256 9658b00b5baf82fcc2ee06dc419119b81cef1c20dd2c4201146d3e512ba5d540

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