返回顶部
z

zhihu-cli

Command-line tool for searching, reading, and interacting with Zhihu (知乎). Supports hot topics, content search, article reading, user info, and Browser Relay-based voting/following.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
495
下载量
0
收藏
概述
安装方式
版本历史

zhihu-cli

# Zhihu CLI A CLI tool for interacting with Zhihu (知乎) content. ## Installation ```bash # Install globally npm install -g zhihu-cli # Or use npx npx zhihu-cli <command> ``` ## Commands | Command | Description | |---------|-------------| | `zhihu login` | Auto-extract cookies from Chrome | | `zhihu whoami` | Check login status | | `zhihu set-cookie <cookie>` | Set cookie manually | | `zhihu hot` | Get hot topics | | `zhihu search <keyword>` | Search content | | `zhihu topics <keyword>` | Search topics | | `zhihu read <url>` | Read answer/article | | `zhihu user <token>` | Get user info by url_token | | `zhihu vote <url>` | Browser Relay vote instructions | | `zhihu follow [url]` | Browser Relay follow instructions | | `zhihu post` | Browser Relay post instructions | ## Features - 🔍 Search Zhihu content - 🔥 Get hot topics - 📖 Read answers/articles - 👤 View user info - 👍 Vote (via Browser Relay) - 👣 Follow users (via Browser Relay) - 🔐 Auto cookie extraction from Chrome ## Cookie Setup ### Option 1: Auto (recommended) ```bash zhihu login ``` Opens Chrome and extracts cookies automatically. ### Option 2: Manual ```bash zhihu set-cookie "your_zhihu_cookie_string" ``` ## Browser Relay Operations Some operations (vote, follow, post) require Browser Relay due to API limitations. ### Setup 1. Ensure OpenClaw Browser Relay is connected 2. Use the respective command to get instructions ### Voting ```bash zhihu vote <answer_url> ``` Then click the vote button in browser or use JS: ```javascript const btn = document.querySelector('button[class*="VoteButton"]'); if (btn) btn.click(); ``` ### Following ```bash zhihu follow <user_url> ``` Or click the follow button in browser. ## API Limitations Zhihu has restricted API access for: - Vote/unvote (use Browser Relay) - Follow/unfollow (use Browser Relay) - Comments (partially available) Read operations (search, hot, read, user) work via API. ## Examples ```bash # Get hot topics zhihu hot # Search for Python tutorials zhihu search Python教程 # Read an answer zhihu read https://www.zhihu.com/question/123456/answer/789012 # Get user info zhihu user lightislost # Check login zhihu whoami ``` ## Notes - Cookie is stored in `~/.zhihu-cookie` - Some features require login (votes, follows) - Browser Relay provides more reliable write operations

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 zhihu-cli-1776128133 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 zhihu-cli-1776128133 技能

通过命令行安装

skillhub install zhihu-cli-1776128133

下载 Zip 包

⬇ 下载 zhihu-cli v1.0.0

文件大小: 1.72 KB | 发布时间: 2026-4-15 15:11

v1.0.0 最新 2026-4-15 15:11
Initial release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部