Skip to main content
The Tweet Audit Tool provides a simple command-line interface with two main commands to help you analyze and audit your Twitter archive.

Basic usage

The CLI follows a simple command structure:
python src/main.py <command>
Where <command> is one of the available commands listed below.

Available commands

The tool provides two sequential commands:

extract-tweets

Extract tweets from your Twitter archive JSON file

analyze-tweets

Analyze extracted tweets using Gemini AI

Typical workflow

The commands are designed to be run in sequence:
  1. Extract: First, run extract-tweets to convert your Twitter archive from JSON to CSV format
  2. Analyze: Then, run analyze-tweets to process tweets with AI and generate deletion recommendations
# Step 1: Extract tweets from archive
python src/main.py extract-tweets

# Step 2: Analyze the extracted tweets
python src/main.py analyze-tweets

Command help

To see all available commands, run the CLI without any arguments:
python src/main.py
This displays the help message with a list of available commands.

Exit codes

The CLI uses standard exit codes to indicate success or failure:
0
Success
Command completed successfully
1
Error
Command failed due to an error (see error message for details)

Error handling

When a command fails, the CLI:
  • Prints a descriptive error message to stderr
  • Exits with code 1
  • Logs detailed error information (check logs for debugging)
The tool includes comprehensive error handling for common issues like missing files, permission errors, and invalid data formats.

Output format

All commands provide clear console output:
  • Progress messages: Displayed during execution
  • Success messages: Show counts and confirmation
  • Error messages: Include specific details about failures

Example output

$ python src/main.py extract-tweets
Extracting tweets from archive...
Successfully extracted 1247 tweets

$ python src/main.py analyze-tweets
Analyzing tweets...
Successfully analyzed 1247 tweets

Next steps

Extract tweets

Learn about the extract-tweets command

Analyze tweets

Learn about the analyze-tweets command

Build docs developers (and LLMs) love