-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_gmail_setup.py
More file actions
71 lines (61 loc) · 2.5 KB
/
Copy pathtest_gmail_setup.py
File metadata and controls
71 lines (61 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python3
"""
Test script to verify Gmail integration setup
"""
import os
import sys
from pathlib import Path
def check_setup():
print("Checking SILVER Tier Gmail Integration Setup...")
print("="*50)
# Check required files exist
required_files = [
"gmail_watcher.py",
"secure/credentials.json",
"triage-email/SKILL.md",
"send-approved-email/SKILL.md",
"mcp/email-mcp/index.js",
"mcp/email-mcp/package.json"
]
print("1. Checking required files:")
all_good = True
for file_path in required_files:
exists = os.path.exists(file_path)
status = "[OK]" if exists else "[MISSING]"
print(f" {status} {file_path}")
if not exists:
all_good = False
print("\n2. Checking environment variables:")
gmail_creds_path = os.getenv('GMAIL_CREDENTIALS_PATH', 'secure/credentials.json')
dry_run = os.getenv('DRY_RUN', 'true')
print(f" GMAIL_CREDENTIALS_PATH: {gmail_creds_path} {'[OK]' if os.path.exists(gmail_creds_path) else '[MISSING]'}")
print(f" DRY_RUN: {dry_run}")
print("\n3. Checking required directories:")
dirs_to_check = ["secure", "Logs", "Needs_Action", "Approved", "Pending_Approval", "Done", "Plans"]
for dir_path in dirs_to_check:
exists = os.path.exists(dir_path)
status = "[OK]" if exists else "[MISSING]"
print(f" {status} {dir_path}")
if not exists:
all_good = False
print("\n4. Checking .gitignore security:")
with open('.gitignore', 'r') as f:
gitignore_content = f.read()
secure_entries = ['secure/', 'secure/*', 'credentials.json', 'token.json']
secure_gitignore = any(entry in gitignore_content for entry in secure_entries)
print(f" Security entries in .gitignore: {'[OK]' if secure_gitignore else '[MISSING]'}")
if not secure_gitignore:
all_good = False
print("\n" + "="*50)
if all_good:
print("[OK] All checks passed! Gmail integration is properly set up.")
print("\nTo run the system:")
print("1. python gmail_watcher.py (or in background: python gmail_watcher.py &)")
print("2. Set up MCP: claude mcp add --scope user email -- node ./mcp/email-mcp/index.js")
print("3. Send test email to see workflow in action")
else:
print("[ERROR] Some checks failed. Please review the issues above.")
return all_good
if __name__ == "__main__":
success = check_setup()
sys.exit(0 if success else 1)