{"slug": "i-built-a-daily-news-newsletter-bot-with-hermes-agent-here-s-everything-that-and", "title": "I Built a Daily News Newsletter Bot with Hermes Agent — Here's Everything That Went Wrong (and Right)", "summary": "A developer built a daily news newsletter bot using Hermes Agent, TypeScript, and Nodemailer, but encountered multiple failures including a typo that caused a 30-minute debugging session and a container rebuild that deleted all configuration. The bot, designed to deliver top news from Canada, India, and the AI/tech space along with a motivational quote and health tip, required fixes for SMTP spam filtering and TypeScript module conflicts. The project ultimately succeeded using GitHub Codespaces, OpenRouter's free LLM API, and the tsx runtime instead of ts-node.", "body_md": "*Submitted for the Hermes Agent Challenge*\n\nI wanted one simple thing: a daily email that lands in my inbox every morning with the top news from Canada, the world, India, and the AI/tech space — plus a motivational quote and a health tip. One email. Everything in one place. No scrolling through five different apps before my coffee.\n\nSounds simple. It wasn't.\n\nThis is the honest story of building a daily briefing bot using Hermes Agent — including every wall I hit, every config I lost, and every moment where it finally clicked.\n\nHermes Agent — the brain that fetches news and generates the newsletter\n\nGitHub Codespaces — free cloud dev environment (no touching my personal Mac)\n\nTypeScript + Nodemailer — sends the email via Gmail SMTP\n\nOpenRouter — free LLM API for Hermes to use\n\nNo paid services. No cloud bills. Just open source tooling wired together.\n\nI specifically didn't want this running on my personal Mac. I wanted it isolated — something I could destroy and rebuild without affecting my machine. GitHub Codespaces gave me a free Linux environment in the browser. Perfect.\n\nOr so I thought.\n\n**Problem 1:** The Typo That Took 30 Minutes\n\nAfter getting Nodemailer set up and running my send script, the terminal just... hung. No error. No output. Just silence.\n\nI thought it was a firewall issue in Codespaces blocking SMTP port 587. I switched to port 465. Still hanging on some runs. I added verbose logging. I tried verify() calls.\n\nThen I spotted it:\n\n`hostname: 'smpt.gmail.com'`\n\nsmpt instead of smtp. One transposed letter. Thirty minutes of debugging.\n\nLesson: Always print your env vars before debugging the code.\n\n**Problem 2:** Rebuilding the Container Deleted Everything\n\nThis one hurt. I had Hermes installed, my .env configured, my SMTP secrets set up, everything working. Then I rebuilt my Codespace container to fix an unrelated issue.\n\nGone. All of it.\n\nHermes was uninstalled. My environment variables vanished. My .env file disappeared. I had to reinstall everything from scratch and reconfigure all my secrets.\n\nThe fix was two things:\n\nFirst, create a .devcontainer/devcontainer.json so Hermes auto-installs on every rebuild:\n\n```\n{\n  \"name\": \"daily-brief-hermes\",\n  \"postCreateCommand\": \"pip install hermes-agent && npm install\"\n}\n```\n\nSecond, keep secrets in ~/.hermes/.env and your project .env committed to a safe location — not just floating in your shell session.\n\nLesson: Never trust your shell session. Anything not written to a file is gone the moment the container rebuilds.\n\n**Problem 3:** ts-node Fighting with \"type\": \"module\"\n\nMy package.json had \"type\": \"module\" in it, which made ts-node throw:\n\nTypeError: Unknown file extension \".ts\"\n\nThree different error messages, two config changes, one Stack Overflow rabbit hole. The fix was switching from ts-node to tsx — a drop-in replacement that handles both ESM and CommonJS without any config:\n\n```\nnpm install --save-dev tsx\nnpx tsx send-newsletter.ts briefings/2026-05-26.md\n```\n\nLesson: Use tsx over ts-node for TypeScript in modern Node projects. It just works.\n\n**Problem 4: ** \"Newsletter Sent!\" But No Email\n\nThe most confusing moment. The script printed Newsletter sent! — Nodemailer was happy, no errors thrown. But my inbox was empty.\n\nThree possible culprits I had to rule out one by one:\n\nSpam folder — it was there. Gmail flagged it as spam.\n\nWrong app password — Gmail requires a 16-character App Password, not your regular login password. Easy to get wrong.\n\nEmpty file being sent — the file path resolved correctly but the content hadn't been written yet.\n\nThe spam issue was fixed by adding a proper sender name and dynamic subject line:\n\n```\nawait transporter.sendMail({\n  from: `\"Daily Brief 📰\" <${SMTP_USER}>`,\n  to: RECIPIENTS.join(\", \"),\n  subject: `Daily Brief — ${new Date().toLocaleDateString(\"en-CA\", {\n    weekday: \"long\",\n    year: \"numeric\",\n    month: \"long\",\n    day: \"numeric\"\n  })}`,\n  text: body,\n});\n```\n\nLesson: Always check spam. Always use Gmail App Passwords, not your account password. Always mark the first email as \"Not Spam\" to train Gmail.\n\n**Problem 5:** Hermes Had No Model Configured\n\nAfter getting email working, I opened hermes chat and pasted my newsletter prompt. Hermes responded with:\n\n```\nNo inference provider configured. Run 'hermes model' to choose a provider and model,\nor set an API key in ~/.hermes/.env\n```\n\nThen after adding the OpenRouter key:\n\n```\nHTTP 400: No models provided\n```\n\nThe API key was there but no model was set. The fix was adding HERMES_MODEL to ~/.hermes/.env:\n\n```\nOPENROUTER_API_KEY=sk-or-xxxxxxxxxxxxxxxx\nHERMES_MODEL=owlobot/owl-7b\n```\n\nLesson: Hermes needs both an API key AND a model specified. One without the other gives cryptic errors.\n\nOnce everything was configured, Hermes was genuinely impressive to use. I pasted a plain English prompt:\n\n```\nToday is 2026-05-26. Search the web for today's top 5 headlines for \nCanada news, World news, India news, and AI/tech news. Add one \nmotivational quote and one health tip. Format as Markdown and save to \n/workspaces/daily-brief-hermes/briefings/2026-05-26.md\n```\n\nAnd Hermes:\n\nThat's the part that made the whole painful setup worth it. I didn't write a single line of news-fetching code. No RSS parsers, no news APIs, no scraping. Hermes handled all of it through natural language.\n\n```\n~/.hermes/.env\n  └── OPENROUTER_API_KEY + HERMES_MODEL\n  └── SMTP credentials\n\nhermes chat (manual trigger or cron)\n  └── Reads skills/daily_brief.md prompt\n  └── Searches web for today's news\n  └── Generates Markdown newsletter\n  └── Saves to briefings/YYYY-MM-DD.md\n\nnpx tsx send-newsletter.ts briefings/YYYY-MM-DD.md\n  └── Reads ~/.hermes/.env for SMTP credentials\n  └── Sends email via Gmail SMTP port 465\n  └── Delivers to all recipients in the list\n```\n\n`hermes cron start`\n\nInside *hermes chat*:\n\n```\n/cron add \"0 8 * * *\" \"Read the skill at /workspaces/daily-brief-hermes/skills/daily_brief.md \nand generate today's newsletter. Save it to /workspaces/daily-brief-hermes/briefings/\n$(date +%Y-%m-%d).md then run: npx tsx /workspaces/daily-brief-hermes/send-newsletter.ts \n/workspaces/daily-brief-hermes/briefings/$(date +%Y-%m-%d).md\"\n```\n\nEvery day at 8am UTC, Hermes generates and sends the newsletter automatically.\n\nNote: Codespaces sleeps when idle, so for a truly always-on setup you'd move this to a small VPS. But for prototyping and learning, Codespaces works perfectly.\n\nThe setup friction is real — especially in a Codespaces environment where rebuilds wipe your state. But once Hermes is configured, the experience of writing plain English instructions and watching it search the web, reason about content, and produce structured output is genuinely different from anything I've built before.\n\nI didn't write a news aggregator. I didn't build a scraper. I wrote a prompt and a TypeScript email script, and I get a daily briefing in my inbox every morning.\n\nThat's the part that sticks with me.\n\n*Built for the Hermes Agent Challenge* | *GitHub: daily-brief-hermes*", "url": "https://wpnews.pro/news/i-built-a-daily-news-newsletter-bot-with-hermes-agent-here-s-everything-that-and", "canonical_source": "https://dev.to/hema_nambi_66c9/i-built-a-daily-news-newsletter-bot-with-hermes-agent-heres-everything-that-went-wrong-and-531m", "published_at": "2026-05-27 02:54:58+00:00", "updated_at": "2026-05-27 03:23:20.442797+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-products", "large-language-models", "generative-ai"], "entities": ["Hermes Agent", "GitHub Codespaces", "TypeScript", "Nodemailer", "Gmail SMTP", "OpenRouter", "LLM"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-daily-news-newsletter-bot-with-hermes-agent-here-s-everything-that-and", "markdown": "https://wpnews.pro/news/i-built-a-daily-news-newsletter-bot-with-hermes-agent-here-s-everything-that-and.md", "text": "https://wpnews.pro/news/i-built-a-daily-news-newsletter-bot-with-hermes-agent-here-s-everything-that-and.txt", "jsonld": "https://wpnews.pro/news/i-built-a-daily-news-newsletter-bot-with-hermes-agent-here-s-everything-that-and.jsonld"}}