matcha README

项目的 README,来自 github.com/piqoni/matcha。合并为一个 markdown 文件:README.md。

🍵 Matcha

Latest release Last commit License Stars

Matcha is a daily digest generator for your RSS feeds and interested topics/keywords. By using any markdown file viewer (such as Obsidian) or directly from terminal (-t option), you can read your RSS articles whenever you want at your pace, thus avoiding FOMO throughout the day.

In Obsidian

image

On the terminal

image

On the Web

Read more here how to setup the web version

image

Features

Installation & Usage

  1. Since Matcha generates markdown, any markdown reader should do the job. Currently it has been tested on Obsidian so you need a markdown reader before moving on, unless you will use terminal mode (-t option), then a markdown reader is not needed.
  2. Download the pre-built Matcha binary based on your OS and after executing (if on mac/linux run chmod +x matcha-darwin-amd64 to make it executable), a sample config.yml will be generated, which you can add in your rss feeds, keywords and the markdown_dir_path where you want the markdown files to be generated (if left empty, it will generate the daily digest on current dir).
  3. You can either execute matcha on-demand (a terminal alias) or set a cron to run matcha as often as you want. Even if you set it to execute every hour, matcha will still generate daily digests, one file per day, and will add more articles to it if new articles are published throughout the day.

Other ways to install

Homebrew (macOS)

brew install matcha

Go devs

go install github.com/piqoni/matcha@latest

Configuration

On first execution, Matcha will generate the following config.yaml and a markdown file on the same directory as the application. Change the 'feeds' to your actual RSS feeds, and google_news_keywords to the keywords you are interested in. And if you want to change where the markdown files are generated, set the full directory path in markdown_dir_path.

markdown_dir_path:
feeds:
  - http://hnrss.org/best 10
  - https://waitbutwhy.com/feed
  - http://tonsky.me/blog/atom.xml
  - http://www.joelonsoftware.com/rss.xml
  - https://www.youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA
google_news_keywords: George Hotz,ChatGPT,Copenhagen
instapaper: true
weather_latitude: 37.77
weather_longitude: 122.41
terminal_mode: false
opml_file_path:
markdown_file_prefix:
markdown_file_suffix:
reading_time: false
sunrise_sunset: false
openai_api_key:
openai_base_url:
openai_model:
summary_feeds:

Analyst LLM Feature

The Analyst feature enables you to gather articles from specified feeds and analyze them using a prompt sent to a language model like GPT-4o (default). The result is included in the daily digest under an Analysis section. You write on your analyst_prompt setting what do you want the analyst to do on your behalf, for example picking relevant news to your liking (example: a cybersecurity expert interested only in certain type of attack), or having an investing analyst suggesting investment opportunities, etc.

Configuration Example of an analyst finding investment opportunities:

openai_api_key: sk-xxxxxxxxxxxxxxxxx
analyst_feeds:
  - https://feeds.bbci.co.uk/news/business/rss.xml
analyst_prompt: You are a world-class investing expert. Analyze the provided list of articles for potential investment opportunities. If no direct opportunities are found, identify industries, regions, or trends that could have indirect impacts on the investment landscape.

How it Works: The RSS feeds specified in analyst_feeds are fetched, and the titles along with their rss descriptions are attached to the analyst_prompt to form a single input prompt. Then the prompt is sent to the specified language model (analyst_model), and the response is included in the daily markdown file under the Analysis section.

Snippet of sample output (as an investment analyst): image

Default model is OpenAI's gpt-4o but to override model add configuration:

analyst_model: o1-preview

Analyst Notifications

The analyst feature supports notifications (Slack hooks or ntfy.sh). See a working example below:

analyst_prompt: "Check the news titles below and if you see that airbus flights are returned to normal please respond with \"FLIGHTS BACK TO NORMAL\" and nothing else, no explanations."
analyst_feeds:
  - https://feeds.bbci.co.uk/news/business/rss.xml
analyst_model: qwen3:4b
openai_base_url: http://localhost: 11434/v1
notification_trigger: "FLIGHTS BACK TO NORMAL"
notification _webhook_url: https://ntfy.sh/myuniquetopic

Summarization of Articles using ChatGPT

In order to use the summarization feature, you'll first need to set up an OpenAI account. If you haven't already done so, you can sign up here. Once registered, you'll need to acquire an OpenAI API key which can be found here.

Alternatively, you may use LocalAI (see the "LocalAI Support" section below for more information).

Next, update the configuration file with the desired feeds you want to summarize. This can be done under the "summary_feeds" section. Here is an example configuration:

openai_api_key: sk-xxxxxxxxxxxxxxxxx
summary_feeds:
    - http://hnrss.org/best 10

Replace sk-xxxxxxxxxxxxxxxxx with your OpenAI API key and include the RSS feeds under summary_feeds for articles you're interested in summarizing.

You can also customize which model you use for summarization by changing the openai_model to one of the values here which defaults to 'gpt-3.5-turbo' for now. 'gpt-4' is also a valid model name.

openai_model: gpt-3.5-turbo

LocalAI Support

For those interested in using LocalAI for summarization, whether for cost-efficiency or privacy reasons, you'll first need to set it up and run it. For setup instructions, please visit the LocalAI repository on GitHub here.

After setting up LocalAI, you'll need to direct Matcha to the openai-compatible base URL of LocalAI. This is done by updating the "openai_base_url" in the configuration file. For instance, if your LocalAI server is running locally on port 8080, your configuration would look like this:

openai_base_url: http://localhost:8080/v1
openai_model: openllama-3b

In this case, 'http://localhost:8080/v1' represents the base URL where your LocalAI server is running. 'openai_model' could be any model compatible with LocalAI. You can also replace the openai_base_url with another hosted url like the Azure openai endpoint. Please note in case of errors that you may need to change the openai_model to match the model you downloaded in LocalAI.

Command line Options

Run matcha with --help option to see current cli options:

  -c filepath
    	Config file path (if you want to override the current directory config.yaml)
  -o filepath
    	OPML file path to append feeds from opml files
  -t	Run Matcha in Terminal Mode, no markdown files will be created

OPML Import

To use OPML files (exported from other services), rename your file to config.opml and leave it in the directory where matcha is located. The other option is to run the command with -o option pointing to the opml filepath.

matcha (piqoni/matcha)

正在搜索数据库…

753 ·GitHub
这是什么?Matcha 是一个每日摘要生成工具,它会把你的 RSS 订阅源以及基于关键词的 Google 新闻搜索结果汇总到一个 markdown 文件中,你可以用 markdown 阅读器或终端查看。
这是独立应用,还是必须依赖 Obsidian?它是一个 Go 命令行工具,会生成纯 markdown 文件;Obsidian 只是查看这些文件的方式之一,终端模式(-t)无需任何 markdown 阅读器即可使用。
我该如何让它运行起来?下载适用于你操作系统的预编译 Matcha 二进制文件(macOS 可用 Homebrew 安装,Go 开发者可用 go install),在 mac/linux 上为其添加可执行权限,然后运行一次,即可生成一个示例 config.yml,你可以在其中添加订阅源和关键词。
使用它需要 OpenAI API 密钥吗?只有可选的摘要和 Analyst 功能才需要。普通的摘要生成不需要 API 密钥;而摘要和分析则需要 OpenAI API 密钥,或者改用自托管的 LocalAI 端点。
它只能配合 Obsidian 使用,还是能用于任何 markdown 应用?Matcha 目前只在以 Obsidian 作为 markdown 查看器的情况下测试过,理论上任何 markdown 阅读器都应该可以使用;终端模式则完全不受此限制。
它能在 Linux 和 Windows 上运行,还是只支持 macOS?我们为各个操作系统(darwin、linux 等)提供了预编译二进制文件,并为 macOS 提供了专门的 Homebrew formula,因此它可以作为命令行二进制文件跨平台运行。
我能让文章数据不发送给 OpenAI 吗?可以,你可以通过 openaibaseurl 设置让 Matcha 指向自托管的 LocalAI 服务器,而不是把数据发送到 OpenAI。
Analyst 功能究竟是做什么的?它会抓取你指定的订阅源中的标题和描述,将其输入到自定义提示词中(例如“告诉我是否看到任何投资机会”),再发送给 GPT-4o 等模型,并把返回的结果放入每日摘要的 Analysis 部分。
Matcha 能否主动提醒我,而不是等我自己去看摘要?可以,LLM Notifications 功能会监视自定义提示词条件(例如“当 X 公司被收购时通知我”),并可通过 Slack webhook 或 ntfy.sh 推送提醒。
我能从其他 RSS 阅读器导入订阅源吗?可以,把导出的 OPML 文件重命名为 config.opml,并放在 Matcha 二进制文件旁边,或者用 -o 参数显式指定该文件。
除了 RSS 摘要,它还有其他功能吗?它还会显示 12 小时天气预报,可以快速将文章收藏到 Instapaper,并突出显示讨论热烈的 Hacker News 帖子。
作者
piqoni
大小
0.2 MB
星标
753
时长
3年
提交 · 90 天