ai-news-digest
v1.0.4
Published
AI-powered news aggregator & digest generator — supports Gemini Browser/API modes, multi-source RSS/Sitemap/DOM/URL extraction, scheduled delivery via email.
Maintainers
Readme
ai-news-digest
AI-powered news aggregator & daily digest generator.
AI 驱动的新闻聚合与每日摘要生成工具。
Features / 功能特性
- Dual AI Engine — Gemini API (recommended) or Gemini Browser (Playwright)
- Multi-source Extraction — RSS, Sitemap, DOM scraping, direct URL
- 智能去重 — SQLite-based deduplication across runs
- Email Delivery — Auto-send daily digest via SMTP (QQ/Gmail/163/Outlook/Yahoo)
- Scheduled Automation — Built-in
node-cronscheduler (cross-platform) - Bilingual — Full zh/en i18n support
- CLI-first — Interactive setup, one-command operation
Quick Start / 快速开始
Install / 安装
npm install -g ai-news-digestInitialize / 初始化
ai-news initInteractive setup will guide you through:
- AI engine selection (API key or Browser login)
- Email delivery configuration
- Language preference
Run / 运行
# Full pipeline: scrape + generate + email
ai-news run
# Scrape only
ai-news scrape
# Generate digest only
ai-news generateSchedule / 定时运行
# Start scheduler (runs in foreground)
ai-news start
# Stop scheduler
ai-news stopCommands / 命令
| Command | Description |
|---------|-------------|
| ai-news init | Interactive setup / 交互式初始化 |
| ai-news auth status | Check Gemini Browser login status / 检查登录态 |
| ai-news login | Browser login for Gemini (Browser mode only) |
| ai-news run | Full pipeline: scrape → generate → email |
| ai-news scrape | Scrape sources only |
| ai-news generate | Generate digest from saved articles |
| ai-news start | Start scheduled daemon |
| ai-news stop | Stop daemon |
| ai-news sources list | List all sources / 列出数据源 |
| ai-news sources add <url> | Add a source |
| ai-news sources remove <id> | Remove a source |
| ai-news sources enable <id> | Enable a source |
| ai-news sources disable <id> | Disable a source |
| ai-news health | System health check / 健康检查 |
| ai-news config | View config |
| ai-news config get <key> | Get config value |
| ai-news config set <key> <value> | Set config value |
Engine Modes / 引擎模式
Gemini API (Recommended / 推荐)
Uses the official Gemini API with an API key. No browser required.
# Get an API key from:
# https://aistudio.google.com/app/apikey
ai-news config set GEMINI_API_KEY your_key_hereGemini Browser
Uses Playwright to control a real browser session with Gemini Web UI. Requires Google login.
ai-news auth status # Preflight-check the saved login session
ai-news login # Opens browser for manual login
ai-news scrape # Uses saved sessionai-news auth status is intended for scripts and preflight checks:
ai-news auth status
ai-news auth status --json
if ai-news auth status >/dev/null 2>&1; then
echo "session is valid"
else
echo "login required"
fiExit codes:
0: session is valid1: session is missing or login is required2: check failed due to setup or runtime error
Email Configuration / 邮件配置
Supported providers with presets:
| Provider | SMTP Host | |----------|-----------| | QQ Mail | smtp.qq.com | | Gmail | smtp.gmail.com | | 163 Mail | smtp.163.com | | Outlook | smtp.office365.com | | Yahoo | smtp.mail.yahoo.com |
Set via ai-news init or manually:
ai-news config set email.smtp.host smtp.gmail.com
ai-news config set email.smtp.port 465
ai-news config set SMTP_USER [email protected]
ai-news config set SMTP_PASS your_app_password
ai-news config set email.recipient [email protected]Configuration / 配置
Config is stored at ~/.ai-news-digest/:
~/.ai-news-digest/
├── config.json # Main config
├── sources.json # Data sources
├── .env # Secrets (API keys, SMTP credentials)
├── data/
│ ├── articles/ # Saved article analyses
│ ├── dedup/ # Deduplication database
│ └── state/ # Task state
├── output/
│ ├── html/ # Generated HTML digests
│ └── markdown/ # Generated markdown
└── logs/ # Scheduler logsSchedule Configuration / 定时配置
Default schedule (cron expressions):
{
"schedule": {
"scrape": "0 * * * *", // Every hour
"generate": "0 8 * * *", // Daily at 8am
"cleanup": "0 2 * * 0" // Weekly Sunday 2am
}
}Requirements / 系统要求
- Node.js >= 18
- OS: macOS, Linux, Windows
- Gemini API Key (API mode) or Google account (Browser mode)
- SMTP credentials (for email delivery)
License
MIT
