← 返回
内容创作

Zhihu CLI

Command-line tool for searching, reading, and interacting with Zhihu (知乎). Supports hot topics, content search, article reading, user info, and Browser Relay...
Command-line tool for searching, reading, and interacting with Zhihu (知乎). Supports hot topics, content search, article reading, user info, and Browser Relay...
lightislost
内容创作 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 1,046
下载
💾 38
安装
1
版本
#latest

概述

Zhihu CLI

A CLI tool for interacting with Zhihu (知乎) content.

Installation

# Install globally
npm install -g zhihu-cli

# Or use npx
npx zhihu-cli <command>

Commands

CommandDescription
----------------------
zhihu loginAuto-extract cookies from Chrome
zhihu whoamiCheck login status
zhihu set-cookie Set cookie manually
zhihu hotGet hot topics
zhihu search Search content
zhihu topics Search topics
zhihu read Read answer/article
zhihu user Get user info by url_token
zhihu vote Browser Relay vote instructions
zhihu follow [url]Browser Relay follow instructions
zhihu postBrowser 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)

zhihu login

Opens Chrome and extracts cookies automatically.

Option 2: Manual

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

zhihu vote <answer_url>

Then click the vote button in browser or use JS:

const btn = document.querySelector('button[class*="VoteButton"]');
if (btn) btn.click();

Following

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

# 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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 13:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,090
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,517
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,995