Configuration Reference

All options in config.json.

File Structure

{
  "selectors": {
    "questionContainer": "CSS_SELECTOR",
    "answerButton": "CSS_SELECTOR",
    "confirmButton": "CSS_SELECTOR"
  },
  "ai": {
    "provider": "openai",
    "model": "MODEL_NAME"
  },
  "browser": {
    "debugPort": 9222
  }
}

Selectors

questionContainer

CSS selector for the element containing the question text.

Examples:

answerButton

CSS selector matching all answer buttons/links.

Examples:

confirmButton

CSS selector for the next/confirm button.

Examples:

AI Configuration

provider

Currently only "openai" is supported.

model

Which OpenAI model to use:

See OpenAI pricing for costs.

API Key

Set via environment variable (not in config for security):

echo "OPENAI_API_KEY=your-key" > .env

Browser Configuration

debugPort

Port Chrome listens on for debugging. Default: 9222

Must match the --remote-debugging-port value when starting Chrome.

Example

{
  "selectors": {
    "questionContainer": ".question-wrapper",
    "answerButton": "button.answer-choice",
    "confirmButton": "#next-btn"
  },
  "ai": {
    "provider": "openai",
    "model": "gpt-4o-mini"
  },
  "browser": {
    "debugPort": 9222
  }
}

Validation

Check your config:

npm test

This validates JSON structure and required fields, but doesn’t test if selectors work on your site.