Skip to main content
OpenDraft

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 setup

This 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

  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. 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
}
SettingDescriptionDefault
google_api_keyYour Google AI API key-
default_levelDefault academic levelresearch_paper
default_styleDefault citation styleapa
default_languageDefault output languageen
output_dirWhere to save generated papers./opendraft_output
open_folder_on_completeOpen folder when donetrue

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/Papers

Language 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=~/papers

Reset Configuration

To reset all settings:

rm -rf ~/.opendraft

Then run opendraft setup again.

Next Steps

Check the FAQ for common questions and troubleshooting.