- Add 'agent-reach skill --install/--uninstall' command for explicit skill management
- Make 'agent-reach doctor' auto-install skill if not present (fixes#154)
- Add format_xhs_result() to strip bloated XHS JSON to essential fields (fixes#134)
- Add 'agent-reach format xhs' CLI command (pipe mcporter output to clean it)
- Update SKILL.md with XHS formatter usage tip
- Add tests for both features (11 new tests, 73/73 total pass)
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
* feat: add Xueqiu (雪球) channel for stock quotes and community posts
Add a Tier 0 (zero-config) channel for Xueqiu, China's popular stock
market and investment community platform. Uses auto-generated session
cookies via http.cookiejar — no login required.
Supported methods:
- get_stock_quote(symbol) — real-time quotes (A/HK/US markets)
- search_stock(query) — search by name or code
- get_hot_posts(limit) — trending community posts
- get_hot_stocks(limit, stock_type) — popular stocks leaderboard
Inspired by https://github.com/jackwener/opencli xueqiu implementation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add Xueqiu to README platform tables, remove stale Instagram ref
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: fernando_jacob <f.jacob1996@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat: use rich text formatting for doctor UI
* fix: remove unrelated cli formatting changes
* fix: keep cli diff focused on doctor rich output
---------
Co-authored-by: Yuki9814 <Yuki9814@users.noreply.github.com>
miku_ai is installed inside the agent-reach Python environment (pipx venv
or user venv). Using bare 'python3' fails when agent-reach was installed
via pipx, because system python3 cannot import miku_ai.
Fix: detect the correct interpreter at runtime via:
$(python3 -c "import agent_reach, sys; print(sys.executable)")
This resolves the interpreter transparently for pipx, venv, and plain pip
installs without hardcoding paths.
Closes#187
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
- Add 10 mcporter command examples for Weibo channel
- Cover: trending, search (users/content/topics), profile, feeds, comments, fans/followers
- Note: zero config, no login needed, uses mobile API with auto visitor cookies
- Completes documentation for mcp-server-weibo integration
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
- Replace xreach CLI with bird (@steipete/bird) as Twitter/X backend
- bird uses AUTH_TOKEN/CT0 env vars (simpler than xreach's session.json)
- Accept both 'bird' and 'birdx' binary names
- Remove version detection logic (bird v0.8.0 is the baseline)
- Write credentials.env to ~/.config/bird/ for easy sourcing
- Keep xfetch session.json sync for backward compatibility
- Update SKILL.md commands: bird search/read/user-tweets/thread
- Update install/uninstall to use npm @steipete/bird
- All 52 tests pass
- Change fallback cookie path from relative 'cookies.json' to absolute
'/app/cookies.json' so docker cp works correctly when COOKIES_PATH env
var is not set in older container images
- Also fix except branch to use the same absolute fallback
- Auto-restart container after writing cookies so the upstream MCP
reloads them from disk without requiring manual intervention
Fixes#175
Reddit API requires a non-empty User-Agent header per its API rules.
Without it, the JSON endpoint returns 403 even when Reddit is reachable,
causing doctor to falsely report the channel as unavailable.
Changes:
- Add _reddit_reachable() helper that probes Reddit JSON API with UA
- doctor check() now distinguishes 'actually unreachable' from 'no proxy'
- Users on home IPs get 'ok' when Reddit is reachable; warn only on real failure
Fixes#168
The description field was 1204 characters, exceeding the 1024-character
maximum enforced by Codex and other MCP clients. This caused
'invalid description: exceeds maximum length of 1024 characters'
errors that prevented the skill from loading.
Changes:
- Removed star count (changes frequently, not essential for matching)
- Removed Chinese aliases in parentheses (redundant with trigger list)
- Consolidated 'Use when' into a single concise sentence
- Deduplicated trigger keywords (kept most distinctive ones)
New length: 661 chars (well within 1024 limit).
- Replace brittle '"status": "ok"' string match with proper JSON parsing
in _mcporter_status_ok(). Handles Windows BOM, CRLF line endings, and
whitespace variations that caused false negatives on Windows + mcporter 0.7.3.
- Fallback to normalised string matching for backward compatibility.
- Extend config-get timeout to 15 s and list timeout to 30 s on Windows
(unchanged on Linux/macOS: 5 s / 10 s).
Fixes#159
* feat(channels): add V2EX support via public API
V2EX provides a public JSON API that requires no authentication.
This PR adds:
- agent_reach/channels/v2ex.py: V2EXChannel (tier=0, zero-config)
- can_handle() matches v2ex.com URLs
- check() verifies API reachability via urllib (no extra deps)
- Register V2EXChannel in channels/__init__.py
- SKILL.md: add V2EX section with curl examples for hot topics,
node browsing, topic detail, replies, and user info
- tests/test_channels.py: URL matching + mocked ok/warn check tests
V2EX API endpoints used:
GET /api/v2/topics/hot — hot topics
GET /api/topics/show.json — node topics / topic detail
GET /api/replies/show.json — topic replies
GET /api/members/show.json — user info
* feat(channels): expand V2EX channel with data-fetching methods
Add get_hot_topics, get_node_topics, get_topic, get_user, and search
methods to V2EXChannel using stdlib urllib only (no new dependencies).
Update unit tests and SKILL.md with Python call examples.
* feat(v2ex): add data fetching methods to V2EXChannel
Upstream bzd6661/wechat-article-for-ai has a bug where Tag.new_tag
is None in BS4 4.12+. Our fork fixes this.
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
Config class writes YAML (config.yaml), but xiaoyuzhou.py, cli.py, and
transcribe.sh were hardcoded to read config.json (JSON format). Users who
configured groq-key via 'agent-reach configure' would not have their key
detected because the wrong file was being read.
Fixes#128 (related to config loading)
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
xreach-cli v0.3.2 added:
- extractTweetText() preferring note_tweet.text for long tweets
- X Article URL support (/article/ path)
Previously, doctor reported 'ok' even when the user had v0.3.0/v0.3.1
installed, silently failing to read longform tweets. Now check() reads
`xreach --version` and returns a warn with upgrade instructions if the
version is below 0.3.2.
Closes#126
Co-authored-by: neo_minion1 <minion@openclaw.ai>
Fixes#128
Two bugs:
1. doctor warn message said 'agent-reach configure groq-api-key' but the
actual CLI arg is 'groq-key' (see cli.py:75 choices list and :993 handler).
Same typo existed in cli.py _install_xiaoyuzhou_deps() output.
2. check() had a logic flaw: the inner 'if not has_key' was nested inside
'if not os.environ.get(...)', so when GROQ_API_KEY env var was absent but
config.json read succeeded, the outer condition never triggered the warning.
Refactored to a flat has_key variable — cleaner and correct.
Verified: 36/36 tests pass, manual unit tests confirm warn uses 'groq-key'
and ok is returned when groq_api_key is present in config.json.
Co-authored-by: 小白(Agent) <neo@agent-reach.dev>
Both _install_weibo_deps() and _install_xiaoyuzhou_deps() use
shutil.which() but didn't import shutil, causing NameError during
agent-reach install.
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
- Weibo now auto-installs during 'agent-reach install' (no login needed)
- Uses Panniantong/mcp-server-weibo fork with visitor passport auth fix
- Works from overseas servers without proxy or cookies
- Updated README (CN/EN), install.md, and channel check to point to fork
- 10 tools: trending, search content/users/topics, profile, feeds, comments
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
- YouTube: warn when only Node.js is installed but yt-dlp config file
is missing (previously returned "ok" incorrectly)
- Douyin: use `mcporter list` instead of calling with a hardcoded
invalid share URL that always fails
- cli: replace bare `except:` with `except Exception:` in
`_detect_environment` to avoid catching KeyboardInterrupt/SystemExit
- cli: fix unclosed file handle for cloud VM detection
- config: use `os.open()` with 0o600 mode to eliminate permission
race window when saving credentials
Adds a proper way for AI agents to import XiaoHongShu cookies into
the xiaohongshu-mcp Docker container. Previously agents had no clear
command to use, leading to confusion loops (issue #108).
Supports two input formats:
- Cookie-Editor JSON export (array of cookie objects)
- Header String format (key1=val1; key2=val2; ...)
The command:
1. Parses and validates the cookie input
2. Finds the running xiaohongshu-mcp container
3. Reads COOKIES_PATH from container env
4. Writes cookies via docker cp
5. Verifies login status via mcporter
Also updates install.md with the new command.
Closes#108
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
Previously, Extracting cookies from chrome...
✅ Twitter/X: auth_token + ct0
✅ Cookies configured! Run `agent-reach doctor` to see updated status. stored Twitter
cookies in ~/.agent-reach/config.yaml but did NOT write them to
~/.config/xfetch/session.json. This caused xreach CLI to report
'Not authenticated' even after a successful configure.
The xfetch bridge existed only in the manual
code path (cli.py:829). This commit extracts it into a shared helper
_sync_xfetch_session() in cookie_extract.py and calls it from
configure_from_browser() too, so both paths behave consistently.
Fix is non-fatal: if the xfetch dir/file cannot be written, the error
is swallowed silently (agent-reach config.yaml remains the source of truth).
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
The isatty() check skipped UTF-8 wrapping when agent-reach was called
as a subprocess by AI agents (non-TTY). On Windows with GBK encoding,
any remaining non-ASCII chars would crash with UnicodeEncodeError.
Now UTF-8 wrapping applies in all environments on Windows.
Closes#95
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
- Remove all decorative emoji (👁️🔍📦🍪💡🔧📥🧩🛡️📡💻🤖⭐🙏🆕ℹ️) from cli.py and doctor.py
- Replace ⚠️ with [!] and ❌ with [X] (ASCII-safe status markers)
- Replace ⬜ with -- (ASCII-safe)
- Keep ✅ only for final success confirmations
- Fixes Windows GBK encoding crash during 'agent-reach install' (issue #95)
Closes#95
A friendly, non-intrusive message after successful installation
asking users to star the repo.
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
* feat: auto-install WeChat article tools during agent-reach install
WeChat (微信公众号) deps are now auto-installed during 'agent-reach install':
- Python packages: camoufox[geoip], markdownify, beautifulsoup4, httpx, miku_ai
- Tool repo: wechat-article-for-ai cloned to ~/.agent-reach/tools/
No login or configuration needed — works out of the box like YouTube/RSS.
Updated README tables to reflect zero-config status.
Also covers safe mode and dry-run.
* feat: auto-install WeChat + add channel-setup reference to SKILL.md
1. WeChat auto-install during 'agent-reach install':
- pip install camoufox[geoip], markdownify, bs4, httpx, miku_ai
- clone wechat-article-for-ai to ~/.agent-reach/tools/
- covers safe mode and dry-run
- README tables: WeChat → zero-config
2. SKILL.md improvements:
- Added 'configure' triggers to description
- Added references/channel-setup.md with install steps for all
login-required platforms (Twitter, XHS, Douyin, LinkedIn, Boss)
- Principle: user only provides cookies, agent does everything else
* simplify: point to install.md URL instead of bundled reference
No need to maintain a separate channel-setup.md. Just tell agents
to fetch install.md when they need setup instructions.
---------
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
SKILL.md was mixing installation/configuration with usage commands.
Now it's a pure usage guide per skill-creator conventions:
- Description includes ALL platform trigger words (search, read,
browse for each of 13 channels) so agents load it when users
ask to search/read any platform
- Body is concise command reference only — no install/config
instructions (those belong in install.md)
- Removed duplicate workspace rules explanation
- Removed cookie setup, proxy config, and channel setup sections
- 324 → 160 lines (51% reduction in context tokens)
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
Two subprocess.run(["npm", ...]) calls in undici installation were
using bare command name, which fails on Windows where npm is
installed as npm.cmd. Now resolves full path via shutil.which()
first, consistent with all other subprocess calls.
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
Problem: After installing Agent Reach, agents may clone repos, create
files, or write output into the workspace directory, gradually polluting
the user's project. Over time this degrades the agent experience.
Fix:
- SKILL.md: add Workspace Rules section — never create files in workspace
- install.md: add Directory Rules table, explicit boundary about workspace
- install.md: all git clone commands now target ~/.agent-reach/tools/
- update.md: add workspace warning
- cli.py: install creates ~/.agent-reach/tools/ directory
All agent-facing docs now enforce: /tmp for temp, ~/.agent-reach/ for
persistent data, workspace stays untouched.
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
- wechat channel now supports both search and read
- Search: miku_ai (sogou weixin search) → article list with URLs
- Read: camoufox (stealth Firefox) → full Markdown content
- Doctor shows granular status (search only / read only / both)
- SKILL.md updated with search + read workflow examples
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
- Replace text=True with encoding='utf-8', errors='replace' in all
subprocess.run calls (channels + cli.py) to fix GBK decode errors
on Chinese Windows systems
- Use shutil.which() resolved paths in channel subprocess calls to
handle Windows .cmd wrappers (npm global installs)
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
- Remove dead '# ── read ──' placeholder comment in cli.py
- Reword SKILL.md to make it explicit that agent-reach is an
installer/config tool, not a content fetcher
- Addresses confusion from issue #58
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
When running 'agent-reach configure twitter-cookies', credentials are now
automatically written to ~/.config/xfetch/session.json so that 'xreach auth
check' works without manual intervention.
Preserves existing session.json fields if the file already exists.
Falls back gracefully if the sync fails (still saves to agent-reach config).
Fixes#50
yt-dlp now requires an external JS runtime (deno or Node.js) for YouTube.
Since agent-reach already installs Node.js, we configure yt-dlp to use it:
1. cli.py: install writes '--js-runtimes node' to ~/.config/yt-dlp/config
2. youtube.py: doctor checks JS runtime availability and config
3. SKILL.md: updated YouTube section with accurate troubleshooting
Bilibili note: 412 errors are IP-based (needs proxy), not cookie-related.
Fixes#47
YouTube may trigger 'Sign in to confirm you're not a bot' on server IPs.
Bilibili may return 412 on non-residential IPs.
Added --cookies-from-browser fallback examples for both channels.
Fixes#47