Quick Start

This guide will get you up and running with DrGPT in just a few minutes.

Prerequisites

Before starting, make sure you have:

  1. Python 3.8+ installed

  2. DrGPT installed (pip install drgpt)

  3. At least one AI provider API key configured

Your First Query

Once you have DrGPT installed and API keys configured, try your first query:

drgpt "What is artificial intelligence?"

You should see a beautifully formatted response with markdown rendering.

Choosing a Provider

DrGPT supports multiple AI providers. You can specify which one to use:

# Use OpenAI GPT-4
drgpt --provider openai --model gpt-4 "Explain quantum computing"

# Use Anthropic Claude
drgpt --provider anthropic --model claude-3-sonnet-20240229 "Write a poem"

# Use Google Gemini
drgpt --provider google --model gemini-pro "Solve this math problem"

List available providers and models:

drgpt --list-providers

The Four Modes

DrGPT offers four specialized modes for different use cases:

  1. Standard Mode (default) General AI assistant for questions, explanations, and discussions:

    drgpt "Explain how photosynthesis works"
    
  2. Code Mode (--code or -c) Pure code generation with no explanations:

    drgpt --code "Create a Python function to calculate fibonacci numbers"
    drgpt -c "Create a Python function to calculate fibonacci numbers"  # Short form
    
  3. Shell Mode (--shell or -s) System administration and command generation:

    drgpt --shell "Find all files larger than 100MB"
    drgpt -s "Find all files larger than 100MB"  # Short form
    
  4. Interactive Mode (--interface or -i) Conversational AI interface with special commands:

    drgpt --interface
    drgpt -i  # Short form
    

Configuration

CLI Shortcuts

DrGPT provides convenient shortcuts for frequently used options:

Available Shortcuts

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:

# Code generation
drgpt -c "Create a Python function"

# Shell commands
drgpt -s "List all processes"

# Editor mode
drgpt -e

# Interactive mode
drgpt -i

# Save output
drgpt -o result.md "Explain AI"

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

Configuration

DrGPT automatically uses sensible defaults, but you can customize its behavior:

Default Provider: Set your preferred provider and model:

# Always use these settings unless overridden
export DRGPT_DEFAULT_PROVIDER="openai"
export DRGPT_DEFAULT_MODEL="gpt-4"

Debug Mode: See detailed information about requests:

drgpt --debug "Your question here"

Common Use Cases

Here are some common ways to use DrGPT:

Learning and Research:

drgpt "Explain the difference between REST and GraphQL APIs"
drgpt "What are the benefits of using Docker containers?"

Code Generation:

drgpt --code "Create a REST API endpoint in Flask for user authentication"
drgpt -c "Create a REST API endpoint in Flask for user authentication"  # Short form
drgpt --code "Write a JavaScript function to debounce user input"
drgpt -c "Write a JavaScript function to debounce user input"  # Short form

System Administration:

drgpt --shell "Show disk usage by directory"
drgpt -s "Show disk usage by directory"  # Short form
drgpt --shell "Kill all processes using port 8080"
drgpt -s "Kill all processes using port 8080"  # Short form
drgpt --shell "Create a backup of my home directory"
drgpt -s "Create a backup of my home directory"  # Short form

Writing and Editing:

drgpt --editor  # Opens vi editor for longer prompts
drgpt -e       # Short form
drgpt "Improve this text: [your text here]"

Interactive Sessions:

drgpt --interface
drgpt -i  # Short form
# Then use ! before questions in the interactive mode
> !What is machine learning?
> code: Create a neural network in PyTorch
> shell: Show system information

Next Steps

Now that you’re familiar with the basics:

  1. Standard Mode - Learn about standard mode features

  2. Code Mode - Master code generation

  3. Shell Mode - Become a shell command expert

  4. Interactive Mode - Explore interactive features

  5. AI Providers - Configure different AI providers

  6. Use Cases and Examples - See real-world examples

Getting Help

If you need help:

# Built-in help
drgpt --help

# Interactive mode help
drgpt --interface
> help

For more detailed information, continue reading the documentation sections.