scripts/generate-newsletter_README.md
This script generates a weekly Beads newsletter based on the changelog, git commits, and code changes.
Set the appropriate API key for your chosen model:
# For Claude
export ANTHROPIC_API_KEY="your-api-key"
# For OpenAI
export OPENAI_API_KEY="your-api-key"
# Optionally set the model (defaults to claude-sonnet-4-20250514)
export AI_MODEL="claude-sonnet-4-20250514"
# or
export AI_MODEL="gpt-4o"
# Optional: Auto-commit and push
export AUTO_COMMIT="true"
git checkout main
git pull
uv run scripts/generate-newsletter.py
uv run scripts/generate-newsletter.py --days 30
# Since an absolute date
uv run scripts/generate-newsletter.py --since 2025-12-15
# Or use relative format (last 14 days)
uv run scripts/generate-newsletter.py --since 14d
# From v0.39 to v0.48
uv run scripts/generate-newsletter.py --from-release v0.39.0 --to-release v0.48.0
# From v0.39 to present
uv run scripts/generate-newsletter.py --from-release v0.39.0
# Up to v0.48.0
uv run scripts/generate-newsletter.py --to-release v0.48.0
uv run scripts/generate-newsletter.py --model gpt-4o
uv run scripts/generate-newsletter.py --dry-run
uv run scripts/generate-newsletter.py --output my-newsletter.md
uv run scripts/generate-newsletter.py --help
Add to your crontab for weekly generation:
# Run every Monday at 9 AM
0 9 * * 1 cd /path/to/beads && uv run scripts/generate-newsletter.py
The newsletter generator creates a deeper dive beyond the changelog with workflow-impacting content:
CHANGELOG.mdcmd/ directory between versions, parses cobra command definitions to identify new CLI commands with descriptionsREADME.md and docs/ for relevant command documentationNEWSLETTER.mdThe AI prompt specifically requests narrative paragraphs to help users understand workflow impacts and new features worth exploring, rather than just listing changes.
| Provider | Example Models |
|---|---|
| Anthropic | claude-sonnet-4-20250514, claude-opus-4-20250514 |
| OpenAI | gpt-4o, gpt-4o-mini, o1-preview, o3-mini |
The script auto-detects the provider from the model name.