Environment variables are loaded from a .env file in your project root. This keeps sensitive credentials like API keys out of version control.
1
Create .env file
Create a .env file in your project root:
touch .env
2
Add required variables
Add your Gemini API key and X username:
.env
# Required: Your Gemini API key from https://aistudio.google.com/app/apikeyGEMINI_API_KEY=your_api_key_here# Required: Your X (Twitter) usernameX_USERNAME=your_x_username
3
Configure optional settings
Add optional configuration for performance tuning:
.env
# Optional: Gemini model to use (default: gemini-2.5-flash)GEMINI_MODEL=gemini-2.5-flash# Optional: Seconds to wait between API calls (default: 1.0)RATE_LIMIT_SECONDS=1.0# Optional: Logging verbosity (default: INFO)# Options: DEBUG, INFO, WARNING, ERROR, CRITICALLOG_LEVEL=INFO
{ "criteria": { "forbidden_words": ["damn", "wtf", "hell"], "topics_to_exclude": [ "Profanity or unprofessional language", "Personal attacks or insults", "Outdated political opinions" ], "tone_requirements": [ "Professional language only", "Respectful communication" ], "additional_instructions": "Flag any content that could harm professional reputation" }}
Exact words that trigger deletion (case-insensitive).Example:
"forbidden_words": ["damn", "crypto", "wtf"]
Used in prompt construction in analyzer.py:113-115:
if settings.criteria.forbidden_words: words = ", ".join(settings.criteria.forbidden_words) criteria_parts.append(f"Contains any of these words: {words}")
Forbidden words match exact words only. “crypto” matches “Crypto is great” but not “cryptocurrency”.
If config.json doesn’t exist, these defaults are used from config.py:51-64:
def _default_criteria() -> Criteria: return Criteria( forbidden_words=[], topics_to_exclude=[ "Profanity or unprofessional language", "Personal attacks or insults", "Outdated political opinions", ], tone_requirements=[ "Professional language only", "Respectful communication", ], additional_instructions="Flag any content that could harm professional reputation", )