-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrokAuto_Email_Guide.html
More file actions
310 lines (288 loc) · 12 KB
/
Copy pathGrokAuto_Email_Guide.html
File metadata and controls
310 lines (288 loc) · 12 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GrokAuto — Check Gmail & Draft Responses Every 10 Minutes</title>
<style>
:root {
--bg: #f8f9fa;
--surface: #ffffff;
--text: #212529;
--text-dim: #6c757d;
--accent: #0066cc;
--accent-dim: #e7f1ff;
--border: #dee2e6;
--code-bg: #f4f4f4;
--success: #198754;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.65;
padding-bottom: 60px;
}
.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }
header {
background: var(--surface);
border-bottom: 1px solid var(--border);
padding: 40px 0 30px;
margin-bottom: 30px;
}
h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.subtitle { color: var(--text-dim); font-size: 16px; }
section {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
padding: 28px;
margin-bottom: 20px;
}
h2 {
font-size: 20px;
font-weight: 700;
margin-bottom: 16px;
color: var(--accent);
display: flex;
align-items: center;
gap: 10px;
}
.step-num {
background: var(--accent);
color: #fff;
width: 28px;
height: 28px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 700;
flex-shrink: 0;
}
h3 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; }
p { margin-bottom: 12px; }
ol { margin-left: 20px; margin-bottom: 14px; }
li { margin-bottom: 10px; }
.code-block {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px 18px;
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
font-size: 13.5px;
line-height: 1.6;
overflow-x: auto;
margin: 12px 0;
}
.code-block .comment { color: #6a737d; }
.code-block .cmd { color: var(--accent); font-weight: 600; }
.code-block .arg { color: #d73a49; }
.inline-code {
background: var(--code-bg);
padding: 2px 6px;
border-radius: 4px;
font-family: monospace;
font-size: 13px;
border: 1px solid var(--border);
}
.result-box {
background: var(--accent-dim);
border-left: 4px solid var(--accent);
padding: 16px 20px;
border-radius: 0 8px 8px 0;
margin: 16px 0;
}
.result-box strong { color: var(--accent); }
.check { color: var(--success); font-weight: 700; }
.prompt-box {
background: #f0f7ff;
border: 1px solid #cce0ff;
border-radius: 8px;
padding: 16px 20px;
margin: 12px 0;
font-style: italic;
}
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
footer {
text-align: center;
color: var(--text-dim);
font-size: 13px;
margin-top: 40px;
}
@media (max-width: 600px) {
h1 { font-size: 24px; }
section { padding: 20px; }
}
</style>
</head>
<body>
<header>
<div class="container">
<h1>📧 GrokAuto Email Assistant</h1>
<p class="subtitle">Ask Grok to check your connected Gmail every 10 minutes and draft responses</p>
</div>
</header>
<div class="container">
<section>
<h2><span class="step-num">1</span> SSH into your server</h2>
<div class="code-block">
<span class="cmd">ssh</span> your-server
</div>
</section>
<section>
<h2><span class="step-num">2</span> Edit the GrokAuto config</h2>
<p>Open the configuration file:</p>
<div class="code-block">
<span class="cmd">nano</span> ~/.config/grokauto/config.json
</div>
<p>Paste this configuration (or add the task to your existing config):</p>
<div class="code-block">
{<br>
<span class="arg">"chrome_profile_path"</span>: <span class="arg">"/home/user/.config/chromium/Default"</span>,<br>
<span class="arg">"chrome_binary"</span>: <span class="arg">"/usr/bin/chromium"</span>,<br>
<span class="arg">"debug_port"</span>: 9222,<br>
<span class="arg">"headless"</span>: <span class="cmd">true</span>,<br>
<span class="arg">"xvfb_display"</span>: <span class="arg">":99"</span>,<br>
<span class="arg">"output_dir"</span>: <span class="arg">"/home/user/grokauto_outputs"</span>,<br>
<span class="arg">"tasks"</span>: [<br>
{<br>
<span class="arg">"id"</span>: <span class="arg">"gmail_check"</span>,<br>
<span class="arg">"prompt"</span>: <span class="arg">"Check if there are any new emails received by my connected Google email address. If there are new emails, list them with sender and subject, and draft a polite response for each one. If there are no new emails, simply say 'No new emails at this time.'"</span>,<br>
<span class="arg">"wait_for_complete"</span>: <span class="cmd">true</span>,<br>
<span class="arg">"timeout_seconds"</span>: 120<br>
}<br>
]<br>
}
</div>
<p>Save and exit: <strong>Ctrl+X</strong>, then <strong>Y</strong>, then <strong>Enter</strong>.</p>
</section>
<section>
<h2><span class="step-num">3</span> Test it manually first</h2>
<p>Run the task once to make sure everything works:</p>
<div class="code-block">
<span class="cmd">cd</span> ~/grokauto && python3 main.py --run
</div>
<p>You should see output like:</p>
<ul>
<li><span class="check">✓</span> Dependencies OK</li>
<li><span class="check">✓</span> Logged in to grok.com</li>
<li><span class="check">✓</span> Browser connected</li>
<li><span class="check">✓</span> Results saved to: <span class="inline-code">~/grokauto_outputs/grok_response_gmail_check_...</span></li>
</ul>
</section>
<section>
<h2><span class="step-num">4</span> Schedule it every 10 minutes</h2>
<p>Use GrokAuto's built-in cron installer. If you have <strong>only one task</strong> in your config:</p>
<div class="code-block">
python3 ~/grokauto/main.py --setup-cron <span class="arg">"0,10,20,30,40,50 * * * *"</span>
</div>
<p>If you have <strong>multiple tasks</strong> and only want to run the Gmail check:</p>
<div class="code-block">
python3 ~/grokauto/main.py --setup-cron <span class="arg">"0,10,20,30,40,50 * * * *"</span> --task-id gmail_check
</div>
<p>Or manually edit crontab:</p>
<div class="code-block">
<span class="cmd">crontab</span> -e<br><br>
<span class="comment"># Run all tasks every 10 minutes:</span><br>
0,10,20,30,40,50 * * * * <span class="cmd">cd</span> /home/user/grokauto && /usr/bin/python3 /home/user/grokauto/main.py --run --config /home/user/.config/grokauto/config.json <span class="cmd">>></span> /home/user/.config/grokauto/cron.log <span class="cmd">2>&1</span><br><br>
<span class="comment"># OR run only a specific task:</span><br>
0,10,20,30,40,50 * * * * <span class="cmd">cd</span> /home/user/grokauto && /usr/bin/python3 /home/user/grokauto/main.py --run --config /home/user/.config/grokauto/config.json --task-id gmail_check <span class="cmd">>></span> /home/user/.config/grokauto/cron.log <span class="cmd">2>&1</span>
</div>
<p>Verify the cron job is installed:</p>
<div class="code-block">
<span class="cmd">crontab</span> -l | grep GrokAuto
</div>
</section>
<section>
<h2><span class="step-num">5</span> Where to look at the results</h2>
<div class="result-box">
<strong>📄 Drafted Responses (the main output)</strong><br>
Location: <span class="inline-code">~/grokauto_outputs/</span><br><br>
Files are named like:<br>
<span class="inline-code">grok_response_gmail_check_20260523_143022.md</span><br><br>
Each file contains:
<ul>
<li>Timestamp of when Grok was asked</li>
<li>Your prompt (check for new emails + draft responses)</li>
<li>Grok's reply — either drafted email responses or "No new emails at this time."</li>
</ul>
</div>
<div class="result-box">
<strong>📋 Cron Execution Log</strong><br>
Location: <span class="inline-code">~/.config/grokauto/cron.log</span><br><br>
Shows whether each scheduled run succeeded or failed.<br>
Follow live: <span class="inline-code">tail -f ~/.config/grokauto/cron.log</span>
</div>
<div class="result-box">
<strong>🔍 Detailed Debug Log</strong><br>
Location: <span class="inline-code">~/.config/grokauto/grokauto.log</span><br><br>
Full execution details including browser launch, login check, and task status.
</div>
<div class="result-box">
<strong>📑 List all outputs quickly</strong><br>
Command: <span class="inline-code">python3 ~/grokauto/main.py --list-outputs</span>
</div>
</section>
<section>
<h2><span class="step-num">6</span> Read the latest response</h2>
<p>Quick commands to view results:</p>
<div class="code-block">
<span class="comment"># See the newest response file</span><br>
<span class="cmd">ls</span> -lt ~/grokauto_outputs/ | head -5<br><br>
<span class="comment"># Read the latest response</span><br>
<span class="cmd">cat</span> $(<span class="cmd">ls</span> -t ~/grokauto_outputs/grok_response_gmail_check_*.md | head -1)<br><br>
<span class="comment"># Or open with less</span><br>
<span class="cmd">less</span> $(<span class="cmd">ls</span> -t ~/grokauto_outputs/grok_response_gmail_check_*.md | head -1)
</div>
</section>
<section>
<h2><span class="step-num">7</span> Useful commands</h2>
<table style="width:100%; border-collapse:collapse;">
<tr style="border-bottom:1px solid var(--border);">
<td style="padding:10px 0; font-weight:600;">Run manually now</td>
<td style="padding:10px 0;"><span class="inline-code">python3 ~/grokauto/main.py --run</span></td>
</tr>
<tr style="border-bottom:1px solid var(--border);">
<td style="padding:10px 0; font-weight:600;">Check system health</td>
<td style="padding:10px 0;"><span class="inline-code">python3 ~/grokauto/main.py --diagnose</span></td>
</tr>
<tr style="border-bottom:1px solid var(--border);">
<td style="padding:10px 0; font-weight:600;">Follow cron log live</td>
<td style="padding:10px 0;"><span class="inline-code">tail -f ~/.config/grokauto/cron.log</span></td>
</tr>
<tr style="border-bottom:1px solid var(--border);">
<td style="padding:10px 0; font-weight:600;">Run a specific task only</td>
<td style="padding:10px 0;"><span class="inline-code">python3 ~/grokauto/main.py --run --task-id gmail_check</span></td>
</tr>
<tr style="border-bottom:1px solid var(--border);">
<td style="padding:10px 0; font-weight:600;">List all saved outputs</td>
<td style="padding:10px 0;"><span class="inline-code">python3 ~/grokauto/main.py --list-outputs</span></td>
</tr>
<tr>
<td style="padding:10px 0; font-weight:600;">Remove cron job</td>
<td style="padding:10px 0;"><span class="inline-code">python3 ~/grokauto/main.py --remove-cron</span></td>
</tr>
</table>
</section>
<section>
<h2>✅ Summary</h2>
<ol>
<li>Edit <span class="inline-code">~/.config/grokauto/config.json</span> and set the Gmail-check prompt.</li>
<li>Test once with <span class="inline-code">python3 ~/grokauto/main.py --run</span>.</li>
<li>Install the 10-minute cron job with <span class="inline-code">--setup-cron</span>.</li>
<li>Read drafted responses in <span class="inline-code">~/grokauto_outputs/</span>.</li>
<li>Monitor runs in <span class="inline-code">~/.config/grokauto/cron.log</span>.</li>
</ol>
<p>Grok will check your connected Gmail every 10 minutes and draft responses for any new emails it finds.</p>
</section>
</div>
<footer>
<div class="container">
<p>GrokAuto Email Assistant</p>
</div>
</footer>
</body>
</html>