Skip to content

About

Turn an RSS feed or Markdown folder into a newsletter: curate in a browser studio and send with SMTPfast.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Feedletter

Generate clean email digests from RSS feeds, local Markdown content or daily.dev.

Feedletter Studio: pick a source, curate items, live-preview the email, and send with SMTPfast

Feedletter is a small open source CLI for teams that publish content and want a fast path from "new posts exist" to "sent newsletter." It can read an RSS/Atom feed, a local Markdown/MDX directory or a daily.dev feed, select recent items, and write email-safe HTML, plain text, and structured JSON.

The feedletter studio command opens a local browser tool where you pick which items to include, reorder and edit them, tweak the subject and intro, watch a live preview, and send the result with SMTPfast. No hosting, no account required to build; you only need an SMTPfast key when you want to send.

Optional AI enrichment can improve the subject, preheader, and intro using any OpenAI-compatible chat completions API. You can also plug in a local/editor agent command such as Claude Code, Codex, or your own script.

Features

  • browser studio: click-ops curation, inline editing, live preview, one-click send
  • RSS 2.0, RSS 1.0 (RDF), and Atom feeds, plus Markdown/MDX folders
  • daily.dev feeds: popular posts, the most discussed, a tag, a search, your For You feed or your bookmarks
  • feed autodiscovery: paste a blog's home page and Feedletter follows the feed it links to
  • polished email-safe HTML and plain-text output
  • per-recipient unsubscribe links via SMTPfast ({{unsubscribe_url}})
  • send to your SMTPfast contacts or one segment as a broadcast, or to a list of addresses through the batch API (100 per request)
  • SQLite history tracking so the same post is not included twice
  • custom editorial instructions from a Markdown file
  • OpenAI-compatible enrichment
  • external writer command support for Claude/Codex-style workflows

Install

npm install -g feedletter

Or try the studio without installing anything:

npx feedletter studio

For local development:

npm install
npm run build
npm run dev -- build --content examples/content --base-url https://example.com

Usage

Build from RSS:

feedletter build \
  --rss https://example.com/feed.xml \
  --title "This week's product updates" \
  --out dist/newsletter

--rss also accepts a site's home page (or a URL without https://) when the page advertises its feed with <link rel="alternate">. Feed text is cleaned for email: HTML entities are decoded, the feed's declared character encoding is respected, and full-text posts are shortened to a summary of about 300 characters.

Build from a Markdown content directory:

feedletter build \
  --content ./content/blog \
  --base-url https://example.com \
  --title "Latest from the blog" \
  --description "A short digest of the newest posts." \
  --limit 5

Build from daily.dev, with a personal access token:

export DAILY_DEV_TOKEN="dda_..."
feedletter build \
  --dailydev popular:kubernetes,docker \
  --title "This week in Kubernetes" \
  --limit 6

--dailydev takes one of these feeds:

Feed What you get
popular or popular:<tags> Popular posts, optionally for comma-separated tags
discussed or discussed:<tag> The posts with the most comments in the last 7 days
tag:<tag> The latest posts for a tag
search:<words> Posts from the last 7 days that match the words
foryou Your personal For You feed
bookmarks Your bookmarks

Each item links to the original article. Use --dailydev-link discussion to link to the daily.dev discussion instead. Posts shared in a squad have no title in the public API, so Feedletter leaves them out. The token is sent only to api.daily.dev, and Feedletter does not follow redirects from it.

Preview the generated email:

feedletter preview --dir dist/feedletter --port 4173

Then open http://127.0.0.1:4173.

CLI Reference

Every command also supports --help. The top-level command supports --version.

feedletter build

Flag Default Description
--rss <url> — RSS or Atom feed URL. Provide one of --rss, --content or --dailydev.
--content <dir> — Local Markdown/MDX content directory.
--dailydev <feed> — A daily.dev feed (see above). Needs DAILY_DEV_TOKEN.
--dailydev-link <target> article Link daily.dev items to the article or the discussion.
--base-url <url> — Base URL for relative Markdown slugs.
--out <dir> dist/feedletter Output directory for the generated issue.
--limit <number> 5 Number of items to include.
--title <title> Latest updates Digest subject and title.
--description <text> — Intro copy displayed before the item list.
--source-label <label> source hostname or Local content Small label displayed above the title.
--instructions <file> — Markdown file with voice, audience, sponsor, or editorial instructions.
--history-db <path> .feedletter/feedletter.sqlite SQLite file used to skip previously included items.
--no-history history enabled Do not read or write item history.
--include-seen off Allow items already present in the history database.
--no-record-history history is recorded Do not mark generated items as included after a successful build.
--ai off Use an OpenAI-compatible API to improve the subject, preheader, and intro.
--ai-base-url <url> AI_BASE_URL, or https://api.openai.com/v1 AI API base URL.
--ai-model <model> AI_MODEL AI model name.
--agent-command <command> — External writer command that receives the editorial prompt on stdin and prints JSON. Cannot be used with --ai.
--agent-timeout <ms> 120000 Timeout for the external writer command.
--agent-env <names> — More environment variables to pass to the writer, by name (for example ANTHROPIC_API_KEY). See AI and agent writers.
--tone <tone> clear, useful, developer-friendly Writing tone used by AI or the external writer.

feedletter preview

Flag Default Description
--dir <dir> dist/feedletter Directory containing email.html, email.txt, and issue.json.
--host <host> 127.0.0.1 Host address for the preview server.
--port <number> 4173 Port for the preview server.

feedletter studio

Flag Default Description
--host <host> 127.0.0.1 Host address for the studio server.
--port <number> 4180 Port for the studio server.
--content <dir> — Default local Markdown/MDX content directory.
--base-url <url> — Default base URL for relative Markdown slugs.
--from <email> — Default sender address in the send panel.
--history-db <path> .feedletter/feedletter.sqlite SQLite file used to flag and skip previously sent items.
--no-history history enabled Do not track or flag previously sent items.
--agent-command <command> — Use an external writer, such as claude -p or codex, for Improve instead of the AI API.
--agent-timeout <ms> 120000 Timeout for the external writer command.
--agent-env <names> — More environment variables to pass to the writer, by name.

feedletter send

Flag Default Description
--from <email> required Verified sender, for example Weekly <[email protected]>.
--dir <dir> dist/feedletter Build output directory containing issue.json.
--to <list> — Recipients separated by commas, spaces, or newlines.
--to-file <path> — File containing one recipient per line; lines beginning with # are ignored.
--footer <text> issue footer Footer note displayed above the unsubscribe link.
--api-key-file <path> SMTPFAST_API_KEY File that holds the SMTPfast API key.
--api-key <key> — Deprecated: other users on the machine can read a command-line value in the process list. Use SMTPFAST_API_KEY or --api-key-file. Still works, with a warning.
--api-url <url> SMTPFAST_API_URL, or SMTPfast default SMTPfast API base URL.
--test off Send only to the first recipient and do not record history.
--resend off Send to every recipient, even ones an earlier run of this exact issue reached or may have reached.
--history-db <path> .feedletter/feedletter.sqlite SQLite file used to record sent items and send progress.
--no-history history enabled Do not record sent items or send progress.

feedletter broadcast

Flag Default Description
--from <email> required Verified sender, for example Weekly <[email protected]>.
--dir <dir> dist/feedletter Build output directory containing issue.json.
--segment <id-or-name> all contacts Send to one SMTPfast segment instead of all contacts.
--name <name> the subject Broadcast name shown in SMTPfast.
--footer <text> issue footer Footer note displayed above the unsubscribe link.
--send off Send now. Without it, Feedletter creates a draft to review and send in SMTPfast.
--resend off Create a new broadcast even if this exact issue was already broadcast.
--api-key-file <path> SMTPFAST_API_KEY File that holds the SMTPfast API key.
--api-key <key> — Deprecated: other users on the machine can read a command-line value in the process list. Use SMTPFAST_API_KEY or --api-key-file. Still works, with a warning.
--api-url <url> SMTPFAST_API_URL, or SMTPfast default SMTPfast API base URL.
--history-db <path> .feedletter/feedletter.sqlite SQLite file used to record sent items and the broadcast id.
--no-history history enabled Do not record sent items or the broadcast id.

Studio

The studio is the fastest way to go from a feed to a sent issue. Start it and open the printed link:

feedletter studio
# Feedletter Studio running at http://127.0.0.1:4180/#token=...
# or preload a source: feedletter studio --content ./content/blog --base-url https://example.com

The link carries a token that is new every time the studio starts. The page keeps it for that browser tab and sends it with every request, and the studio answers no request without it. A bookmark of http://127.0.0.1:4180/ without the token opens the page, but it cannot load or send anything: open the link the studio printed.

To use daily.dev in the studio, start it with DAILY_DEV_TOKEN set. The token stays on the local server; the page never sees it. You can also open /?dailydev=popular:kubernetes to load a feed straight away.

In the studio you can:

  • load items from an RSS/Atom feed, a Markdown directory or a daily.dev feed
  • start from a filled-in draft: the subject, preheader, and intro are written for you the moment items load
  • include or drop each item, reorder by drag or arrows, and edit titles and summaries inline
  • see an already sent badge on items from a previous issue, so you never send the same post twice (tracked in the same SQLite history as build)
  • edit the subject, preheader, intro, and an optional footer note
  • polish the copy with Improve (uses your own AI key server-side, or an external writer like claude -p or codex when you start studio with --agent-command, so you can skip the API entirely)
  • watch a live email and plain-text preview as you go, at desktop or phone width (375px), with an inbox row that shows the sender, subject, and preheader the way a reader sees them, plus length hints for the subject and preheader
  • set a From name and pull each post's cover image into the email
  • save a draft to JSON and open it later to pick up where you left off
  • send with SMTPfast: paste an API key and a verified sender, and Feedletter checks the sender domain is verified and lets you send a test to yourself first. Then pick where it goes:
    • SMTPfast contacts: all contacts or one segment, as a broadcast. The panel shows how many contacts it reaches and how many broadcasts your plan has left this month. Save as draft puts it in SMTPfast to review and send there; Send sends it now.
    • A list of addresses: one message per recipient in batches of 100, so nobody sees the list. The panel counts the list as you type, removes duplicates, and flags addresses SMTPfast would reject.
  • every send asks for a second click that states the count, so nothing goes out by accident. Changing the API key, the segment, or the list cancels a pending click, and only one send runs at a time
  • sending the same email again skips the people it already reached, and the same broadcast is never created or sent twice

You can deep-link a source: http://127.0.0.1:4180/?feed=https://example.com/rss.xml#token=... or ?dir=./content/blog&base=https://example.com#token=.... In a tab that already opened the printed link, the token can be left out.

The studio's API only answers the studio page itself. Every request needs this start's token, which is printed only in the terminal and never written into the page, so another program or user on the same machine cannot use the API. The studio also rejects requests with another site's Origin, requests that are not JSON, and, when bound to 127.0.0.1 (the default), any Host header other than a loopback name, and the page cannot be framed by another site. If you bind it to another interface with --host, keep it on a trusted network: the token travels in plain HTTP there.

Automation

For a hands-off recurring newsletter, build and send from the command line, no browser required. The send command reads a build output directory and sends the issue with SMTPfast, re-rendering it with a per-recipient unsubscribe link:

feedletter build --rss https://your-blog.example.com/rss.xml --limit 6 --out dist/newsletter

SMTPFAST_API_KEY=sf_... feedletter send \
  --dir dist/newsletter \
  --from "Weekly <[email protected]>" \
  --to-file recipients.txt

Add --test to send only to the first recipient. Pass the key in SMTPFAST_API_KEY or in a file with --api-key-file, not on the command line, where other users on the machine can read it in the process list.

GitHub Actions

Pair the two commands with a scheduled GitHub Action to send every week automatically. A ready-to-copy workflow is in examples/github-actions-newsletter.yml. It builds on a cron schedule, sends with SMTPfast, and commits the history file back so the same post is never sent twice:

  • Run it in a private repository. The history file it commits records who was sent each issue, and Actions logs can name addresses that failed. Git keeps every commit, so making a repository private later does not take back what was pushed. History files from Feedletter 0.5 and older, or written without FEEDLETTER_HISTORY_KEY, hold the addresses themselves.
  • No addresses in the repository. The recipient list comes from the NEWSLETTER_RECIPIENTS secret and is written to a temp file outside the checkout. The history file stores each recipient as a keyed hash (HMAC-SHA256 with the FEEDLETTER_HISTORY_KEY secret), not the address. For a list too big for a secret (48 KB), use feedletter broadcast with your SMTPfast contacts.
  • History is saved after every send attempt, a failed or cancelled one included (if: always()): it is the only record of who was already reached and which batches had an unknown outcome.
  • A failed send is resumed, not rebuilt. The job also commits the issue in dist/newsletter when the send fails. The next run, "Re-run failed jobs" included, sends that same issue again, which skips everyone already reached and replays batches with an unknown outcome with their saved keys. Checkout uses ref: ${{ github.ref }}, because a re-run otherwise checks out the first run's commit, which has no record of what that run sent. To drop an unfinished issue instead, delete dist/newsletter from the repository.
  • One run at a time, through a concurrency: group, so two runs never send the same issue.
  • A pinned Feedletter version (FEEDLETTER_VERSION), so a new release never runs with your SMTPfast key before you choose it.
  • If pushing the history fails three times, the job fails and says so. Do not rerun it until the history is in the repository, or people who already have the email get it again.

Sending with SMTPfast

Sending is powered by SMTPfast. It handles verified sending domains, per-recipient unsubscribe, and deliverability, which is the part Feedletter deliberately does not try to reinvent. Create a free account and an API key in the dashboard, verify a sending domain, and paste the key into the studio's send panel.

From the command line, feedletter send sends to a recipient list and feedletter broadcast sends to your SMTPfast contacts:

# Create a draft broadcast for all contacts, then review and send it in SMTPfast
SMTPFAST_API_KEY=sf_... feedletter broadcast --dir dist/newsletter --from "Weekly <[email protected]>"

# Send now to one segment (by name or id)
SMTPFAST_API_KEY=sf_... feedletter broadcast --dir dist/newsletter \
  --from "Weekly <[email protected]>" --segment "Newsletter" --send

A broadcast reaches subscribed contacts only: SMTPfast skips unsubscribed and suppressed addresses and tracks opens and clicks. Each plan includes a number of broadcasts a month, and broadcast --send checks that before it creates anything. Checking the audience needs an API key with the email:read scope.

send skips addresses that are not valid and reports addresses SMTPfast suppressed (unsubscribed, bounced, or complained before) as skipped, not failed, so a scheduled job does not fail when a subscriber leaves. A 429 rate limit is retried after Retry-After, up to three times.

Reruns never send the same email twice. When Feedletter cannot tell what happened, it stops and says so:

  • send gives each batch a new random Idempotency-Key and records the batch, with its key, in the history file as uncertain before it goes out, then marks it sent when SMTPfast accepts it. SMTPfast queues a batch all or nothing and refuses it with a 4xx before it queues anything, so a refused batch is removed from the record. A 5xx or a lost answer is retried twice with the same key: SMTPfast answers a repeated key with its first answer, so a retry never sends twice. A refusal that follows such an attempt does not count as "not sent". If the outcome is still unknown (or the process crashes), the batch stays uncertain and the send stops. Run the same command again: it replays each uncertain batch with its key, so a batch that went out is marked sent and one that never did is sent now, then it continues with the rest. SMTPfast answers a repeated key for 24 hours, so Feedletter replays a batch only while its first attempt (or its latest --resend) is less than 23 hours old; the hour in between allows for clock differences. A batch it cannot replay (it is older than that, the recipient list changed, or the replay was refused) stays uncertain and is skipped, and send says so; check the SMTPfast logs, then use --resend only if those addresses did not get it. --resend uses new keys, so it really sends again. With --no-history there is no record, so a rerun sends to everyone.
  • broadcast records the id of the broadcast it creates and reuses it only while it is a draft whose audience, sender, and subject still match this run (a draft can be edited in the dashboard). If SMTPfast shows it as sent, sending, or scheduled, a rerun stops. If it was canceled or failed, some contacts may already have it, so a rerun also stops; --resend creates a new broadcast. If the answer to a send is lost, Feedletter reads the broadcast's status before it reports. If the answer to creating a draft is lost, it stops and asks you to check your broadcasts in SMTPfast.
  • SMTPfast calls never follow a redirect, so the API key and the email only go to the API URL you set. A redirect stops the send as "not sent" and names where it pointed.
  • A send holds a lock file next to the history file (<history>.lock), so two processes that share it cannot send at once, and the history file is only written while the lock is held. If a send stops without removing its lock (a crash, or a killed process), the next send stops and reports it: check the SMTPfast logs, then remove the lock file if no other Feedletter is running.

History Tracking

By default, build writes a real SQLite file at:

.feedletter/feedletter.sqlite

Each generated item is recorded by URL when possible, with a hash fallback for local content. Future builds skip previously included items.

send also records send progress in the same file: each recipient of an issue with its state (sent, or uncertain with the batch's Idempotency-Key), so a rerun skips people who already have it. Set FEEDLETTER_HISTORY_KEY to a long random value (openssl rand -hex 32) to store each recipient as a keyed hash (HMAC-SHA256) instead of the address. With it set, Feedletter turns any plain addresses already in the file into hashes the next time it writes the file. Use the same key on every run: without it, or with another key, send cannot tell who already has an issue, so it stops instead of sending. Without the key, send and the studio warn that addresses are stored in plain text. A file with hashes cannot be read by Feedletter 0.5 or older, which would send to everyone again, so do not downgrade. Treat the history file as private data either way, and never commit it to a public repository.

Useful flags:

# Use a custom history location
feedletter build --content ./content/blog --history-db ./newsletter.sqlite

# Build from old items anyway
feedletter build --content ./content/blog --include-seen

# Generate a draft without recording it as included
feedletter build --content ./content/blog --no-record-history

# Disable history completely
feedletter build --content ./content/blog --no-history

Custom Instructions

Create a Markdown file with voice, audience, sponsor, product, or formatting guidance:

# Newsletter Instructions

Write for senior backend engineers.
Keep the intro practical and avoid hype.
Mention that the digest is curated from our engineering blog.

Use it during generation:

feedletter build \
  --content ./content/blog \
  --instructions ./newsletter-instructions.md \
  --ai

Instructions are passed to AI or external writer commands and stored in issue.json for traceability.

AI And Agent Writers

Use optional AI enrichment:

OPENAI_API_KEY=sk_... AI_MODEL=your-model \
feedletter build \
  --rss https://example.com/feed.xml \
  --ai \
  --tone "concise, practical, founder-led"

The AI path uses AI_BASE_URL when set, otherwise it calls https://api.openai.com/v1/chat/completions. Any compatible provider can be used by setting AI_BASE_URL, AI_API_KEY, and AI_MODEL.

Use an external writer command:

feedletter build \
  --content ./content/blog \
  --agent-command "claude -p" \
  --instructions ./newsletter-instructions.md

The command receives the full editorial prompt on stdin and must print a JSON object:

{
  "subject": "A sharper subject line",
  "preheader": "A concise inbox preview.",
  "intro": "A short editorial intro.",
  "items": [
    {
      "title": "Optional rewritten item title",
      "summary": "Optional rewritten item summary."
    }
  ]
}

If a command needs the prompt as an argument instead of stdin, include {prompt} in the command string:

feedletter build --rss https://example.com/feed.xml --agent-command "my-writer --prompt {prompt}"

The prompt holds feed text that you do not control, so the writer runs with less than Feedletter itself has:

  • It runs in a new, empty temporary folder, not where you started Feedletter, and the folder is removed afterwards. A relative path to a script in the command is made absolute first. Codex needs --skip-git-repo-check there: --agent-command "codex exec --skip-git-repo-check".
  • It gets only the variables it needs to run and to find its own login and settings: PATH, HOME, the user and locale variables, temp and proxy settings, and CLAUDE_CONFIG_DIR and CODEX_HOME. Feedletter's own keys (SMTPFAST_API_KEY, DAILY_DEV_TOKEN, OPENAI_API_KEY, AI_API_KEY, FEEDLETTER_HISTORY_KEY) never reach it. If the writer takes its API key from the environment, name it with --agent-env, for example --agent-env ANTHROPIC_API_KEY.

Output

Feedletter writes:

  • email.html - email-safe HTML with inline styles
  • email.txt - plain-text fallback
  • issue.json - structured issue data for custom rendering or API use

Markdown Frontmatter

Feedletter understands common frontmatter keys:

---
title: "Shipping better status pages"
description: "What changed in our incident workflow."
date: "2026-05-31"
slug: "shipping-better-status-pages"
author: "Team"
---

Supported URL fields: url, canonical, canonicalUrl, or slug combined with --base-url. Only http(s) links reach the email; other link schemes in front matter (such as javascript:) are dropped.

Front matter is read as data only: YAML (---) or JSON (---json). A file whose front matter starts with ---js or ---javascript is refused with an error naming the file, because that format runs the block as code.

Roadmap

  • Custom template files
  • Multiple layout presets
  • GitHub Action example
  • Direct export for common email providers
  • Content deduping by previously sent URLs
  • Optional image extraction
  • In-browser issue editing before export

License

MIT

About

Turn an RSS feed or Markdown folder into a newsletter: curate in a browser studio and send with SMTPfast.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages