Droid
Email checker with Droid CLI. Verify emails in Droid AI assistant.
Droid is an AI-powered terminal assistant for developers. Learn how to integrate EmailVerify for email verification in your Droid workflows.
What is Droid?
Droid is a modern AI terminal assistant that provides:
- Intelligent command suggestions
- Code generation and explanation
- Shell automation
- Multi-model support (GPT-4, Claude, local models)
Setup
Install EmailVerify CLI
npm install -g @emailverify/cli
bv config set api-key YOUR_API_KEYEnvironment Setup
export EMAILVERIFY_API_KEY=your-api-keyUsage with Droid
Quick Verification
You: verify john@example.com with emailverify
Droid:
Running: bv verify john@example.com --json
{
"email": "john@example.com",
"status": "valid",
"score": 0.88,
"result": {
"deliverable": true,
"disposable": false,
"role": false
}
}
✅ Email is valid (88% confidence)Batch Operations
You: verify all emails in contacts.csv and create a report
Droid:
I'll process the CSV and verify each email.
Reading contacts.csv... 250 entries found.
Progress: ████████████████████ 100%
Summary Report:
┌──────────────┬───────┬────────┐
│ Status │ Count │ % │
├──────────────┼───────┼────────┤
│ Valid │ 198 │ 79.2% │
│ Invalid │ 32 │ 12.8% │
│ Unknown │ 12 │ 4.8% │
│ Disposable │ 8 │ 3.2% │
└──────────────┴───────┴────────┘
Generated files:
- contacts_valid.csv (198 emails)
- contacts_invalid.csv (32 emails)
- contacts_review.csv (20 emails)
Would you like me to explain any of the invalid emails?Code Generation
You: create a Node.js API endpoint for email verification
Droid:
// routes/verify.ts
import { Router } from 'express';
import rateLimit from 'express-rate-limit';
const router = Router();
// Rate limit: 100 requests per minute
const limiter = rateLimit({
windowMs: 60 * 1000,
max: 100,
message: { error: 'Too many requests' }
});
router.post('/verify', limiter, async (req, res) => {
const { email } = req.body;
if (!email) {
return res.status(400).json({ error: 'Email is required' });
}
try {
const response = await fetch('https://api.emailverify.ai/v1/verify', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.EMAILVERIFY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ email }),
});
const result = await response.json();
return res.json({
email,
isValid: result.status === 'valid',
score: result.score,
flags: {
disposable: result.result.disposable,
role: result.result.role,
}
});
} catch (error) {
return res.status(500).json({ error: 'Verification service unavailable' });
}
});
export default router;Saved to routes/verify.ts
Shell Automation
You: create a cron job that verifies new signups daily
Droid:
# Create the verification script
cat > /usr/local/bin/verify-daily-signups.sh << 'EOF'
#!/bin/bash
set -e
LOG_FILE="/var/log/email-verification.log"
DB_HOST="${DB_HOST:-localhost}"
DB_NAME="${DB_NAME:-myapp}"
echo "$(date): Starting daily email verification" >> $LOG_FILE
# Get unverified emails from database
emails=$(psql -h $DB_HOST -d $DB_NAME -t -c \
"SELECT email FROM users WHERE email_verified IS NULL AND created_at > NOW() - INTERVAL '1 day'")
count=0
invalid=0
for email in $emails; do
result=$(bv verify "$email" --json 2>/dev/null)
status=$(echo "$result" | jq -r '.status')
if [ "$status" = "valid" ]; then
psql -h $DB_HOST -d $DB_NAME -c \
"UPDATE users SET email_verified = true WHERE email = '$email'"
else
psql -h $DB_HOST -d $DB_NAME -c \
"UPDATE users SET email_verified = false, email_status = '$status' WHERE email = '$email'"
((invalid++))
fi
((count++))
sleep 0.1 # Rate limiting
done
echo "$(date): Verified $count emails, $invalid invalid" >> $LOG_FILE
EOF
chmod +x /usr/local/bin/verify-daily-signups.sh
# Add to crontab (runs at 2 AM daily)
(crontab -l 2>/dev/null; echo "0 2 * * * /usr/local/bin/verify-daily-signups.sh") | crontab -
echo "✅ Cron job created. Will run daily at 2 AM."Integration Testing
You: write integration tests for email verification
Droid:
// __tests__/email-verification.test.ts
import { describe, it, expect, beforeAll } from 'vitest';
describe('Email Verification Integration', () => {
const API_URL = 'https://api.emailverify.ai/v1/verify';
let apiKey: string;
beforeAll(() => {
apiKey = process.env.EMAILVERIFY_API_KEY!;
if (!apiKey) {
throw new Error('EMAILVERIFY_API_KEY not set');
}
});
async function verifyEmail(email: string) {
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ email }),
});
return response.json();
}
it('returns valid for known good email', async () => {
const result = await verifyEmail('test@gmail.com');
expect(result.status).toBe('valid');
expect(result.score).toBeGreaterThan(0.5);
});
it('detects disposable emails', async () => {
const result = await verifyEmail('test@mailinator.com');
expect(result.result.disposable).toBe(true);
});
it('detects role-based emails', async () => {
const result = await verifyEmail('info@example.com');
expect(result.result.role).toBe(true);
});
it('handles invalid domains', async () => {
const result = await verifyEmail('user@thisisnotarealdomain12345.xyz');
expect(result.status).toBe('invalid');
});
it('returns proper structure', async () => {
const result = await verifyEmail('user@example.com');
expect(result).toHaveProperty('email');
expect(result).toHaveProperty('status');
expect(result).toHaveProperty('score');
expect(result).toHaveProperty('result');
expect(result.result).toHaveProperty('deliverable');
expect(result.result).toHaveProperty('disposable');
expect(result.result).toHaveProperty('role');
});
});Droid Aliases
Add these to your Droid configuration:
# ~/.droid/aliases.yml
aliases:
vmail:
description: "Verify an email address"
command: "bv verify $1 --color"
vmail-json:
description: "Verify an email and output JSON"
command: "bv verify $1 --json | jq ."
vmail-batch:
description: "Verify emails from a file"
command: "bv verify --file $1 --output results.csv"
vmail-check:
description: "Quick check if email is valid (returns 0 or 1)"
command: "bv verify $1 --quiet"Usage:
droid vmail user@example.com
droid vmail-batch contacts.txt