-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·90 lines (74 loc) · 1.95 KB
/
setup.sh
File metadata and controls
executable file
·90 lines (74 loc) · 1.95 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# Claude Mail first-time setup
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
echo "Claude Mail Setup"
echo "================="
echo
# Check Node.js
if ! command -v node &> /dev/null; then
echo "Error: Node.js not found. Please install Node.js 18+."
exit 1
fi
echo "Node.js: $(node --version)"
# Check Go
if ! command -v go &> /dev/null; then
echo "Error: Go not found. Please install Go 1.21+."
exit 1
fi
echo "Go: $(go version | cut -d' ' -f3)"
echo
# Install backend dependencies
echo "Installing backend dependencies..."
cd backend
npm install
cd ..
echo
# Create .env if it doesn't exist
if [ ! -f backend/.env ]; then
echo "Setting up Gmail credentials..."
echo
echo "You need a Gmail App Password (not your regular password)."
echo "Get one at: https://myaccount.google.com/apppasswords"
echo
read -p "Gmail address: " EMAIL
read -sp "App password (16 characters): " PASSWORD
echo
cat > backend/.env << EOF
IMAP_HOST=imap.gmail.com
IMAP_PORT=993
IMAP_USER=$EMAIL
IMAP_PASSWORD=$PASSWORD
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=$EMAIL
SMTP_PASSWORD=$PASSWORD
# Optional: Anthropic API key for AI features
# ANTHROPIC_API_KEY=sk-ant-...
EOF
echo "Credentials saved to backend/.env"
else
echo "backend/.env already exists, skipping credential setup"
fi
echo
# Copy example config files if needed
if [ ! -f backend/config/user.json ]; then
cp backend/config/user.example.json backend/config/user.json
echo "Created backend/config/user.json (edit to customize)"
fi
if [ ! -f backend/config/user-preferences.json ]; then
cp backend/config/user-preferences.example.json backend/config/user-preferences.json
echo "Created backend/config/user-preferences.json (edit to customize)"
fi
echo
# Build TUI
echo "Building TUI..."
cd tui
go build -o claudemail ./cmd/claudemail
cd ..
echo
echo "Setup complete!"
echo
echo "To start Claude Mail, run:"
echo " ./start.sh"