Command Line Interface
The Email Deliverability library includes a full-featured command line interface (CLI) that provides access to all main functionality directly from your terminal.
Installation
When you install the library, the command line tool is automatically installed:
pip install email_deliverability
After installation, you can run the CLI using the email-deliverability command:
email-deliverability --help
Available Commands
Check Authentication
Check domain authentication setup including SPF, DKIM, and DMARC:
email-deliverability auth --domain example.com
Options:
--formator-f: Output format (textorjson, default: text)--outputor-o: Output file (default: stdout)
Check Reputation
Check IP or domain reputation against blacklists:
email-deliverability reputation --ip 192.0.2.1
email-deliverability reputation --domain example.com
Options:
--formator-f: Output format (textorjson, default: text)--outputor-o: Output file (default: stdout)
Validate Emails
Validate email addresses for format, domain, and more:
email-deliverability validate --email user@example.com
email-deliverability validate --file emails.txt
Options:
--check-mxor-m: Check MX records (slower but more accurate)--format: Output format (text,json, orcsv, default: text)--outputor-o: Output file (default: stdout)
Manage Resources
Update or list resources used by the library:
email-deliverability resources update
email-deliverability resources list
email-deliverability resources debug --resource dnsbl_list
Update options:
--resourceor-r: Specific resource to update (default: all)--force: Force update even if resource is current
List options:
--formator-f: Output format (textorjson, default: text)
Debug options:
--resourceor-r: Resource to debug (required)
Generate IP Warming Plan
Create an IP warming schedule for a new sending IP:
email-deliverability warm-ip --ip 192.0.2.1 --days 30 --target 100000
Options:
--daysor-d: Number of days for warming (default: 30)--targetor-t: Target daily email volume (required)--format: Output format (text,json, orcsv, default: text)--outputor-o: Output file (default: stdout)
Comprehensive Check
Run a comprehensive deliverability check:
email-deliverability check --domain example.com --ip 192.0.2.1
Options:
--formator-f: Output format (textorjson, default: text)--outputor-o: Output file (default: stdout)
Version Information
Display version information:
email-deliverability version
Output Formats
The CLI supports multiple output formats:
text: Human-readable formatted text (default)
json: JSON format for programmatic processing
csv: CSV format for commands that return tabular data
Examples
Save IP reputation check as JSON
email-deliverability reputation --ip 192.0.2.1 --format json --output reputation.json
Validate emails from a file and output as CSV
email-deliverability validate --file subscribers.txt --format csv --output validation_results.csv
Update all resources
email-deliverability resources update --force
Generate a warming plan as CSV
email-deliverability warm-ip --ip 192.0.2.1 --days 45 --target 500000 --format csv --output warming_plan.csv
Automation Tips
The CLI can be easily integrated into automated scripts, cron jobs, or CI/CD pipelines:
#!/bin/bash
# Daily email deliverability check
email-deliverability check --domain example.com --ip 192.0.2.1 --format json --output /var/log/deliverability/$(date +%F).json
# Update resources once a week
if [ $(date +%u) -eq 1 ]; then
email-deliverability resources update --force
fi