/install zhihu-publish-attach
Zhihu publish (Chrome attach / Linux VNC)
This skill is self-contained: everything runs from {baseDir}/scripts/. No other repository files are required.
Publish column articles (专栏) by attaching to Chrome on 127.0.0.1:9222 after the user logged in via VNC.
Uses exec + bash {baseDir}/scripts/zhihu_publish.sh — not Browser Relay (see ClawHub zhihu-post for Windows).
First-time setup (after ClawHub install)
Run once on the Linux server:
bash {baseDir}/scripts/setup.sh
bash {baseDir}/scripts/install_chromedriver.sh
bash {baseDir}/scripts/start_chrome_debug.sh
In VNC: log in to Zhihu in that Chrome window.
Verify:
bash {baseDir}/scripts/zhihu_publish.sh --check --json
Expect: "ok": true, "logged_in": true.
Details: {baseDir}/references/linux-vnc-setup.md
When to use
- Linux server + VNC, Chrome started with debug port 9222
- Zhihu already logged in (or user can log in after
start_chrome_debug.sh) - User wants to publish with title + body
Scripts in {baseDir}/scripts/
| Script | Purpose |
|---|---|
setup.sh |
pip install selenium + chmod (after skill install) |
install_chromedriver.sh |
Install chromedriver (once) |
start_chrome_debug.sh |
Start Chrome (VNC window) |
ensure_chrome_debug.sh |
Restart Chrome if closed (keeps login profile) |
zhihu_publish.sh |
Agent entry — always use this |
zhihu_attach_standalone.py |
Called by zhihu_publish.sh |
Title and body (parameters)
| Parameter | How |
|---|---|
--title "..." |
Required |
--body-file /path |
Preferred for long text — write file first, then pass path |
--body "..." |
Short text only |
--publish |
Open editor and fill |
--submit |
Click 发布 (real post; omit for dry-run) |
--json |
JSON result for the agent |
--no-ensure-chrome |
Skip auto-start (only if Chrome is already running) |
Auto-start: Every zhihu_publish.sh run automatically calls ensure_chrome_debug.sh first. If the user closed the browser, Chrome restarts in the background with the same profile (~/.chrome-zhihu-automation) — login usually persists. No need to pass a separate flag unless debugging.
Never put user content inside one shell string. Use separate exec args or --body-file.
Agent workflow
0. Check login (Chrome auto-starts if closed)
bash {baseDir}/scripts/zhihu_publish.sh --check --json
1. Dry-run (fill draft, do not publish)
Write body to e.g. /tmp/zhihu_body.txt, then:
bash {baseDir}/scripts/zhihu_publish.sh \
--publish \
--title "USER_TITLE" \
--body-file /tmp/zhihu_body.txt \
--json
Confirm with user (VNC or chat). JSON has dry_run: true without --submit.
2. Real publish (only after user confirms)
bash {baseDir}/scripts/zhihu_publish.sh \
--publish \
--title "USER_TITLE" \
--body-file /tmp/zhihu_body.txt \
--submit \
--json
Success: "ok": true, "submitted": true.
Exec examples
command: bash
args: ["{baseDir}/scripts/zhihu_publish.sh", "--check", "--json"]
command: bash
args: [
"{baseDir}/scripts/zhihu_publish.sh",
"--publish",
"--title", "\x3Ctitle>",
"--body-file", "/tmp/zhihu_post_body.txt",
"--submit",
"--json"
]
Chromedriver (version must match Chrome)
Selenium attach requires chromedriver even when Chrome is already running.
Install to /usr/local/bin/chromedriver (or set CHROMEDRIVER_PATH).
bash {baseDir}/scripts/install_chromedriver.sh
bash {baseDir}/scripts/verify_chrome_stack.sh
If you installed Chrome via dnf RPM (e.g. 148.0.7778.215), chromedriver must be the same build from Chrome for Testing — see {baseDir}/references/linux-vnc-setup.md.
Troubleshooting
| Symptom | Action |
|---|---|
chromedriver not in PATH |
install_chromedriver.sh or export CHROMEDRIVER_PATH=/usr/local/bin/chromedriver |
| Version mismatch | verify_chrome_stack.sh; re-download driver for your google-chrome-stable --version |
| Cannot connect to 9222 | Usually auto-fixed on next zhihu_publish.sh run; or ensure_chrome_debug.sh |
| Browser closed | Auto-restart on publish; re-login in VNC only if --check returns 401 |
| Chrome starts but no window on VNC | Set DISPLAY for the OpenClaw/exec user (e.g. export DISPLAY=:1) |
| No selenium module | bash {baseDir}/scripts/setup.sh |
| API 401 | Re-login in VNC |
Safety
- Without
--submit= draft only. - Use
--submitonly when the user explicitly asks to publish. - Wait ≥ 3 minutes between posts if publishing repeatedly.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install zhihu-publish-attach - 安装完成后,直接呼叫该 Skill 的名称或使用
/zhihu-publish-attach触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
知乎发帖-谷歌浏览器 是什么?
Publish Zhihu column articles on Linux via Chrome remote debugging (VNC login). After setup, use exec with zhihu_publish.sh and --title/--body-file. Triggers... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 72 次。
如何安装 知乎发帖-谷歌浏览器?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install zhihu-publish-attach」即可一键安装,无需额外配置。
知乎发帖-谷歌浏览器 是免费的吗?
是的,知乎发帖-谷歌浏览器 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
知乎发帖-谷歌浏览器 支持哪些平台?
知乎发帖-谷歌浏览器 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux)。
谁开发了 知乎发帖-谷歌浏览器?
由 M-Lemon(@m-lemon)开发并维护,当前版本 v0.0.2。