Gemini CLI
Email checker with Google Gemini CLI. Verify emails in Gemini automation.
Gemini CLI is Google's AI assistant for the terminal. Learn how to use EmailVerify for email verification in your Gemini CLI workflows.
What is Gemini CLI?
Gemini CLI brings Google's Gemini AI models to your terminal for:
- Code generation and debugging
- Shell command execution
- File operations and analysis
- API interactions
Setup
Install EmailVerify CLI
First, install the EmailVerify CLI tool:
npm install -g @emailverify/cli
bv config set api-key YOUR_API_KEYEnvironment Variable
Alternatively, set the environment variable:
export EMAILVERIFY_API_KEY=your-api-keyUsage with Gemini CLI
Verify Single Email
You: Use the bv command to verify john@google.com
Gemini:
I'll run the EmailVerify CLI to check that email.
$ bv verify john@google.com --json
{
"email": "john@google.com",
"status": "valid",
"result": {
"deliverable": true,
"disposable": false,
"role": false
},
"score": 0.95
}
The email john@google.com is valid with a 95% confidence score.
It's deliverable and not a disposable or role-based address.Batch Verification
You: Verify all emails in my newsletter-subscribers.txt file
Gemini:
I'll verify each email in your subscriber list.
$ cat newsletter-subscribers.txt | head -5
alice@gmail.com
bob@company.org
test@mailinator.com
jane@outlook.com
invalid@asdfgh.xyz
$ bv verify --file newsletter-subscribers.txt --json > results.json
Processing 500 emails...
Summary:
- Valid: 423 (84.6%)
- Invalid: 52 (10.4%)
- Unknown: 25 (5.0%)
Would you like me to:
1. Create a cleaned list with only valid emails?
2. Generate a report of invalid addresses?
3. Show the emails that need manual review?Scripting with Gemini
You: Write a bash script that verifies emails from stdin and outputs only valid ones
Gemini:
#!/bin/bash
# verify-emails.sh - Filter valid emails from stdin
while IFS= read -r email; do
# Skip empty lines
[ -z "$email" ] && continue
# Verify the email
result=$(bv verify "$email" --quiet 2>/dev/null)
exit_code=$?
# Output only valid emails (exit code 0)
if [ $exit_code -eq 0 ]; then
echo "$email"
fi
done
# Usage:
# cat emails.txt | ./verify-emails.sh > valid-emails.txtLet me save this script for you.
### Integration with Google Workspace
**You:** Help me verify the email addresses I'm about to add to my Google Contacts
**Gemini:**I'll verify the emails before you import them.
Please provide the emails (paste them or give me a file path).
[User pastes emails]
Verifying 10 email addresses...
Results:
| Status | Safe to Add? | |
|---|---|---|
| john.doe@gmail.com | Valid | ✅ Yes |
| sales@tempmail.io | Invalid | ❌ No (disposable) |
| info@company.com | Valid | ⚠️ Role-based |
| test@invalid.xyz | Invalid | ❌ No (domain error) |
| ... |
Recommendations:
- 7 emails are safe to add
- Remove 2 invalid emails
- Consider if you want role-based addresses (info@, support@)
## Shell Functions
Add these to your shell configuration:
```bash
# Quick verify with Gemini
gverify() {
gemini "Use bv to verify this email and explain the result: $1"
}
# Batch verify with summary
gverify-batch() {
gemini "Verify all emails in $1 using the bv CLI and provide a summary report"
}
# Check email before sending
email-check() {
local result=$(bv verify "$1" --quiet 2>/dev/null)
if [ $? -eq 0 ]; then
echo "✅ $1 is valid"
else
echo "❌ $1 may have issues - running detailed check..."
gemini "Verify $1 with bv and explain why it might be problematic"
fi
}Automation Examples
Pre-send Verification
# Before sending a campaign, verify the list
gemini "Read marketing-list.csv, verify all emails in the 'email' column using bv,
and create a new file with only the valid ones"Data Cleanup
# Clean up a database export
gemini "Process exported-users.json, verify each email field,
and generate a report of users with invalid emails"CI Integration
# .github/workflows/verify-emails.yml
- name: Verify test emails
run: |
npm install -g @emailverify/cli
gemini "Find all email addresses in test/fixtures/ and verify them with bv.
Fail if any real emails are found in test data."Best Practices
1. Structured Output
Ask Gemini for structured results:
"Verify these emails and output as CSV: email,status,score"2. Explanations
Get context on results:
"Why might test@mailinator.com be flagged as invalid?"3. Batch Processing
For large lists, use file input:
"Verify the emails in large-list.csv in batches of 100"