Create a .env file in the project root with your credentials:
.env
# Required: Your Gemini API keyGEMINI_API_KEY=AIzaSyD_example_key_here_abc123# Required: Your X usernameX_USERNAME=yourhandle# Optional: Rate limiting (default: 1.0)RATE_LIMIT_SECONDS=1.0# Optional: Log level (default: INFO)LOG_LEVEL=INFO
Start with the default RATE_LIMIT_SECONDS=1.0 setting. This processes ~3,600 tweets per hour while staying well within Gemini’s free tier limits (1,500 requests per day).
Create a config.json file with your deletion criteria:
config.json
{ "criteria": { "forbidden_words": ["damn", "wtf", "crypto", "NFT"], "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" }}
If you don’t create config.json, the tool uses sensible defaults focused on maintaining professional content.
The tool processes tweets in batches of 10 and saves progress automatically. If interrupted, simply run the command again to resume where you left off.