/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.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install zhihu-publish-attach - After installation, invoke the skill by name or use
/zhihu-publish-attach - Provide required inputs per the skill's parameter spec and get structured output
What is 知乎发帖-谷歌浏览器?
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... It is an AI Agent Skill for Claude Code / OpenClaw, with 72 downloads so far.
How do I install 知乎发帖-谷歌浏览器?
Run "/install zhihu-publish-attach" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is 知乎发帖-谷歌浏览器 free?
Yes, 知乎发帖-谷歌浏览器 is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does 知乎发帖-谷歌浏览器 support?
知乎发帖-谷歌浏览器 is cross-platform and runs anywhere OpenClaw / Claude Code is available (linux).
Who created 知乎发帖-谷歌浏览器?
It is built and maintained by M-Lemon (@m-lemon); the current version is v0.0.2.