Configuration
OpenDraft stores configuration in ~/.opendraft/config.json. Here's how to customize it.
API Key Setup
OpenDraft requires a Google AI API key (free tier available).
Option 1: Interactive Setup
opendraft setupThis guides you through getting and saving your API key.
Option 2: Environment Variable
export GOOGLE_API_KEY=your_api_key_here
opendraft "Your Topic"Option 3: Config File
Edit ~/.opendraft/config.json:
{
"google_api_key": "your_api_key_here"
}Getting a Google AI API Key
- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the key and use it in OpenDraft
Free tier: Google offers a generous free tier with enough requests for personal use.
Configuration Options
Full config file example:
{
"google_api_key": "AIza...",
"default_level": "master",
"default_style": "apa",
"default_language": "en",
"output_dir": "~/Documents/OpenDraft",
"open_folder_on_complete": true
}| Setting | Description | Default |
|---|---|---|
google_api_key | Your Google AI API key | - |
default_level | Default academic level | research_paper |
default_style | Default citation style | apa |
default_language | Default output language | en |
output_dir | Where to save generated papers | ./opendraft_output |
open_folder_on_complete | Open folder when done | true |
Citation Styles
OpenDraft supports these citation formats:
- APA 7th Edition (
apa) - Psychology, education, social sciences - MLA 9th Edition (
mla) - Humanities, literature - Chicago (
chicago) - History, some humanities - IEEE (
ieee) - Engineering, computer science
Output Directory
By default, papers are saved to ./opendraft_output/exports/. Change this with:
opendraft "Topic" --output ~/Documents/PapersLanguage Support
Currently supported languages:
- English (
en) - Default - German (
de) - Full support
More languages coming soon!
Environment Variables
All settings can be overridden with environment variables:
GOOGLE_API_KEY=xxx
OPENDRAFT_DEFAULT_LEVEL=master
OPENDRAFT_DEFAULT_STYLE=ieee
OPENDRAFT_OUTPUT_DIR=~/papersReset Configuration
To reset all settings:
rm -rf ~/.opendraftThen run opendraft setup again.
Next Steps
Check the FAQ for common questions and troubleshooting.