Installation
Install doctai on your system.
Prerequisites
- Python 3.8 or higher
- pip (Python package manager)
- Internet connection (for AI API access)
Check your Python version:
python3 --version
Installation
From Source
# Clone the repository
git clone https://github.com/dwertent/doctai.git
cd doctai
# Install in development mode
pip install -e .
Verify Installation
doctai --help
You should see the help message with available options.
Get an API Key
Choose one AI provider and get an API key:
OpenAI
- Go to https://platform.openai.com/api-keys
- Sign up or log in
- Click “Create new secret key”
- Copy your API key
Anthropic (Claude)
- Go to https://console.anthropic.com/
- Sign up or log in
- Navigate to API Keys
- Create a new key
- Copy your API key
Google Gemini
- Go to https://aistudio.google.com/app/apikey
- Sign in with your Google account
- Click “Create API Key”
- Copy your API key
Configure API Key
Option 1: Environment Variable
Add to your shell configuration (~/.bashrc, ~/.zshrc, etc.):
export DOCTAI_API_KEY=your-api-key-here
Or use provider-specific variables:
export ANTHROPIC_API_KEY=your-anthropic-key
export OPENAI_API_KEY=your-openai-key
export GEMINI_API_KEY=your-gemini-key
Option 2: Configuration File
Create .doctai.yml in your project:
provider: anthropic
model: claude-sonnet-4-20250514
api_key_env_var: ANTHROPIC_API_KEY
documentation_sources:
- README.md
Then set the environment variable:
export ANTHROPIC_API_KEY=your-key
Verify Setup
Test that everything works:
# Create a simple test file
echo "# Test\nRun: echo 'Hello World'" > test.md
# Run doctai
doctai --docs test.md --provider anthropic --api-key your-key
# Or if you set the environment variable:
doctai --docs test.md --provider anthropic
Troubleshooting
Command Not Found
If you get doctai: command not found:
# Make sure pip installed to a directory in your PATH
python3 -m pip install --user -e .
# Or add to PATH
export PATH="$HOME/.local/bin:$PATH"
Module Not Found
If you get module import errors:
# Reinstall dependencies
pip install -r requirements.txt
API Key Issues
If you get authentication errors:
- Verify your API key is correct
- Check that the environment variable is set:
echo $DOCTAI_API_KEY - Ensure you’re using the correct provider name
- Try passing the key directly with
--api-key
Next Steps
- Quick Start - Run your first test
- Configuration Guide - Set up
.doctai.yml - GitHub Actions - Automate testing