Skip to content

Commit 7eae6c7

Browse files
atopos31claude
andcommitted
docs: add best practices for AI agents and Chinese README
- Add section on handling output size limits in agent environments - Recommend writing to file then using Read tool - Add README_CN.md with full Chinese translation - Add cross-links between EN and CN docs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5840d7d commit 7eae6c7

2 files changed

Lines changed: 161 additions & 0 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# agent-rss
22

3+
[中文文档](./README_CN.md)
4+
35
CLI RSS tool for AI agents. Subscribe to feeds, fetch RSS/Atom content, and filter by time or keywords.
46

57
## Installation
@@ -82,6 +84,25 @@ agent-rss fetch --all --since 2026-03-12 --title "Go" --title "Rust"
8284
agent-rss --file /path/to/feeds.txt list
8385
```
8486

87+
## Best Practices for AI Agents
88+
89+
Many AI agent environments (like Claude Code, OpenClaw, etc.) have **output size limits** for bash commands. When fetching RSS feeds with lots of content, the output may be truncated.
90+
91+
**Recommended approach:** Write output to a file, then use the agent's file reading capability to access the full content.
92+
93+
```bash
94+
# Write RSS output to a temporary file
95+
agent-rss fetch --all --since 2026-03-12 > /tmp/rss-output.json
96+
97+
# Then use the agent's Read tool to access the complete content
98+
# The agent can read /tmp/rss-output.json without size limitations
99+
```
100+
101+
This pattern ensures:
102+
- No truncation of RSS content
103+
- Full access to all fetched items
104+
- Better handling of large feeds
105+
85106
## Feeds File Format
86107

87108
Feeds are stored in `~/.config/agent-rss/feeds.txt`:

README_CN.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# agent-rss
2+
3+
[English](./README.md)
4+
5+
面向 AI Agent 的 CLI RSS 工具。订阅 RSS 源,拉取 RSS/Atom 内容,支持按时间和关键字过滤。
6+
7+
## 安装
8+
9+
### npm
10+
11+
```bash
12+
npm install -g @atopos31/agent-rss
13+
```
14+
15+
### Go
16+
17+
```bash
18+
go install github.com/atopos31/agent-rss/cmd/agent-rss@latest
19+
```
20+
21+
### 从源码构建
22+
23+
```bash
24+
git clone https://github.com/atopos31/agent-rss.git
25+
cd agent-rss
26+
go build -o agent-rss ./cmd/agent-rss
27+
```
28+
29+
## 使用方法
30+
31+
### 订阅管理
32+
33+
```bash
34+
# 添加订阅
35+
agent-rss add hn https://news.ycombinator.com/rss
36+
37+
# 列出所有订阅
38+
agent-rss list
39+
40+
# 获取指定订阅
41+
agent-rss get hn
42+
43+
# 更新订阅
44+
agent-rss update hn --src https://news.ycombinator.com/rss
45+
46+
# 删除订阅
47+
agent-rss remove hn
48+
```
49+
50+
### 拉取 RSS
51+
52+
```bash
53+
# 拉取指定订阅
54+
agent-rss fetch --name hn
55+
56+
# 拉取所有订阅
57+
agent-rss fetch --all
58+
59+
# 输出为 JSON 数组(默认为 NDJSON)
60+
agent-rss fetch --all --format json
61+
```
62+
63+
### 过滤
64+
65+
```bash
66+
# 按时间范围过滤
67+
agent-rss fetch --all --since 2026-03-12
68+
agent-rss fetch --all --since 2026-03-12T08:00:00+08:00 --until 2026-03-12T18:00:00+08:00
69+
70+
# 按标题关键字过滤
71+
agent-rss fetch --all --title "AI"
72+
73+
# 按内容关键字过滤
74+
agent-rss fetch --all --content "机器学习"
75+
76+
# 组合过滤
77+
agent-rss fetch --all --since 2026-03-12 --title "Go" --title "Rust"
78+
```
79+
80+
### 全局选项
81+
82+
```bash
83+
# 使用自定义订阅文件
84+
agent-rss --file /path/to/feeds.txt list
85+
```
86+
87+
## AI Agent 使用最佳实践
88+
89+
许多 AI Agent 环境(如 Claude Code、OpenClaw 等)对 bash 命令的**输出大小有限制**。当拉取包含大量内容的 RSS 时,输出可能会被截断。
90+
91+
**推荐做法:** 将输出写入文件,然后使用 Agent 的文件读取功能获取完整内容。
92+
93+
```bash
94+
# 将 RSS 输出写入临时文件
95+
agent-rss fetch --all --since 2026-03-12 > /tmp/rss-output.json
96+
97+
# 然后使用 Agent 的 Read 工具读取完整内容
98+
# Agent 可以无限制地读取 /tmp/rss-output.json
99+
```
100+
101+
这种方式可以确保:
102+
- RSS 内容不会被截断
103+
- 完整访问所有拉取的条目
104+
- 更好地处理大型订阅源
105+
106+
## 订阅文件格式
107+
108+
订阅存储在 `~/.config/agent-rss/feeds.txt`
109+
110+
```
111+
# 以 # 开头的是注释
112+
hn https://news.ycombinator.com/rss
113+
golang https://blog.golang.org/feed.atom
114+
```
115+
116+
## 输出格式
117+
118+
### NDJSON(默认)
119+
120+
```json
121+
{"name":"hn","src":"https://...","time":"2026-03-12T15:30:00+08:00","title":"...","content":"...","link":"...","id":"..."}
122+
{"name":"hn","src":"https://...","time":"2026-03-12T14:20:00+08:00","title":"...","content":"...","link":"...","id":"..."}
123+
```
124+
125+
### JSON
126+
127+
```json
128+
[
129+
{"name":"hn","src":"https://...","time":"2026-03-12T15:30:00+08:00","title":"...","content":"...","link":"...","id":"..."},
130+
{"name":"hn","src":"https://...","time":"2026-03-12T14:20:00+08:00","title":"...","content":"...","link":"...","id":"..."}
131+
]
132+
```
133+
134+
## 寻找 RSS 源
135+
136+
想找 RSS 源订阅?查看 [awesome-rsshub-routes](https://github.com/JackyST0/awesome-rsshub-routes),这里有各类 RSS 源的精选列表。
137+
138+
## 许可证
139+
140+
MIT

0 commit comments

Comments
 (0)