fix(reddit): install rdt-cli from GitHub source pinned to 0.4.2 (#326)

PyPI still only has rdt-cli 0.4.1 while the doctor hint required >=0.4.2, so the suggested install command always failed. Installs from the upstream GitHub repo pinned to the 0.4.2 commit instead, and syncs all four docs that still taught the PyPI path. Verified locally: clean-venv install from the pinned source yields rdt 0.4.2 and rdt status works. 86 tests pass. Fixes #294.
This commit is contained in:
Andrew Barnes
2026-06-10 02:59:16 -04:00
committed by GitHub
parent 5b07d95e7e
commit 9045fee67e
8 changed files with 53 additions and 14 deletions
+6 -3
View File
@@ -13,6 +13,8 @@ import subprocess
from .base import Channel
_CREDENTIAL_FILE = "~/.config/rdt-cli/credential.json"
# Pinned to the 0.4.2 state — PyPI still only has 0.4.1 (upstream issue #10).
_RDT_GIT_SOURCE = "git+https://github.com/public-clis/rdt-cli.git@5e4fb3720d5c174e976cd425ccc3b879d52cac66"
class RedditChannel(Channel):
@@ -31,9 +33,10 @@ class RedditChannel(Channel):
rdt = shutil.which("rdt")
if not rdt:
return "off", (
"需要安装 rdt-cli(推荐使用最新版 v0.4.2+\n"
" pip install 'rdt-cli>=0.4.2'\n"
"\n"
"需要安装 rdt-cli。PyPI 版本可能暂时落后,推荐直接从 GitHub 安装\n"
f" pipx install '{_RDT_GIT_SOURCE}'\n"
"如已确认 PyPI 版本已更新,也可使用\n"
" pipx install rdt-cli\n"
" uv tool install rdt-cli\n"
"最新源码:https://github.com/public-clis/rdt-cli\n"
"安装后运行 `rdt login` 登录(需先在浏览器登录 reddit.com)"
+10 -4
View File
@@ -17,6 +17,9 @@ import time
from agent_reach import __version__
# Pinned to the 0.4.2 state — PyPI still only has 0.4.1 (upstream issue #10).
_RDT_GIT_SOURCE = "git+https://github.com/public-clis/rdt-cli.git@5e4fb3720d5c174e976cd425ccc3b879d52cac66"
def _ensure_utf8_console():
"""Best-effort Windows console UTF-8 setup for CLI runtime only."""
@@ -706,8 +709,10 @@ def _install_reddit_deps():
if shutil.which("rdt"):
print(" ✅ rdt-cli already installed")
return
for tool, cmd in [("pipx", ["pipx", "install", "rdt-cli"]),
("uv", ["uv", "tool", "install", "rdt-cli"])]:
for tool, cmd in [
("pipx", ["pipx", "install", _RDT_GIT_SOURCE]),
("uv", ["uv", "tool", "install", "--from", _RDT_GIT_SOURCE, "rdt-cli"]),
]:
if shutil.which(tool):
try:
subprocess.run(cmd, capture_output=True, encoding="utf-8",
@@ -717,7 +722,7 @@ def _install_reddit_deps():
return
except Exception:
pass
print(" [!] rdt-cli install failed. Run: pipx install rdt-cli")
print(f" [!] rdt-cli install failed. Run: pipx install '{_RDT_GIT_SOURCE}'")
def _install_bili_deps():
@@ -1495,7 +1500,8 @@ def _cmd_setup():
# Step 3: Reddit — rdt-cli
print("【信息】Reddit — 通过 rdt-cli 搜索和阅读,无需配置")
print(" 安装:pipx install rdt-cli")
print(f" 安装:pipx install '{_RDT_GIT_SOURCE}'")
print(" 然后运行:rdt login")
print()
# Step 4: Groq (Whisper)
+2 -2
View File
@@ -17,9 +17,9 @@ Agent Reach 通过 **rdt-cli** 实现 Reddit 的搜索和阅读功能:
which rdt && echo "installed" || echo "not installed"
```
2. 如果未安装,自动安装:
2. 如果未安装,自动安装(PyPI 版本暂时落后,从 GitHub 安装最新版)
```bash
pipx install rdt-cli
pipx install 'git+https://github.com/public-clis/rdt-cli.git'
```
或一键安装:
+1 -1
View File
@@ -223,6 +223,6 @@ rdt popular --limit 10
rdt all --limit 10
```
> **安装**: `pipx install rdt-cli`(确保 v0.4.2+)。需要先登录(`rdt login`)才能搜索和阅读。
> **安装**: `pipx install 'git+https://github.com/public-clis/rdt-cli.git'`PyPI 版本暂时落后,需从 GitHub 装 v0.4.2+)。需要先登录(`rdt login`)才能搜索和阅读。
> 需要登录的功能:`rdt feed --subs-only`(订阅列表)、`rdt saved`(收藏)。
> 建议使用 `--yaml` 输出,对 AI agent 更友好。