/install cdp-browser
cdp-browser
CLI for Chrome/Chromium at localhost:9222. Inspect tabs, take screenshots, navigate, scroll, post to X, or run JS in a persistent browser session.
Repo: https://github.com/gostlightai/cdp-browser
Prerequisites: Chromium running with --remote-debugging-port=9222. Docker Compose or a local Chrome with remote debugging enabled.
Commands
Run from the skill dir (bin/ scripts):
| Command | Description |
|---|---|
status |
List all tabs (JSON from CDP) |
tabs |
Same as status |
new \x3Curl> |
Open new tab |
goto \x3CtabId> \x3Curl> |
Navigate tab to URL |
snapshot \x3CtabId> |
Full-page screenshot (PNG) |
close-popup \x3CtabId> |
Dismiss dialogs/modals |
scroll \x3CtabId> \x3Cpx|sel> [down|up] |
Scroll by pixels or selector |
query \x3CtabId> getUrl |
Return current page URL |
query \x3CtabId> getText [selector] |
Return element text (or body) |
query \x3CtabId> getHtml [selector] |
Return element HTML (or body) |
tweet-draft \x3CtabId> "text" |
Fill compose box only; does NOT post |
tweet-post \x3CtabId> --confirm "text" |
Post tweet (requires --confirm as second arg) |
tweet \x3CtabId> "text" |
Alias for tweet-draft (fills compose only) |
Tweet flow
- tweet-draft (default): Fills the compose box; user reviews in browser and posts manually.
- tweet-post: Requires
--confirmas second arg (strict). Use when user explicitly approves ("go ahead", "post it", or Telegram confirm button). - Optional Telegram confirm: When
tweet.confirmButtonis enabled in config, the agent can runtweet-draft --save-pendingto write pending state, then send a message with an inline "Confirm Post" button. On confirm, the agent runstweet-post --confirm.
Config (required for Telegram confirm button)
The Telegram "Confirm Post" button only works if config exists. Copy the example and place it in your workspace:
# From the skill dir (e.g. ~/.openclaw/workspace/skills/cdp-browser):
cp .cdp-browser.json.example ~/.openclaw/workspace/.cdp-browser.json
Location: ~/.openclaw/workspace/.cdp-browser.json (or $OPENCLAW_WORKSPACE/.cdp-browser.json)
| Key | Default | Description |
|---|---|---|
tweet.confirmButton |
false |
When true, agent sends draft with inline "Confirm Post" button in Telegram. User clicks to approve or says "go ahead". |
Without this config, the agent uses plain tweet-draft (no button); user confirms via text only.
Telegram confirm button (agent instructions)
When tweet.confirmButton is true (config present) and you are in a Telegram session:
- Draft: Run
tweet-draft --save-pending \x3CtabId> "text"from the skill dir. This fills the compose box and writes~/.openclaw/workspace/.cdp-browser/pending-tweet.json. - Send with button: Run from the skill dir:
Or use./scripts/send-tweet-confirm.sh \x3Cchat_id> "\x3Ctweet_text>"openclaw message senddirectly with--buttons '[[{"text":"Confirm Post","callback_data":"cdp:tweet:confirm"}]]'. Use the current session's reply target as\x3Cchat_id>. - On confirm: When the user clicks the button, OpenClaw delivers
callback_data: cdp:tweet:confirm. Or the user says "go ahead"/"post it". Treat either as approval. Then:- Read
~/.openclaw/workspace/.cdp-browser/pending-tweet.jsonfortextandtabId - Run
tweet-post \x3CtabId> --confirm "\x3Ctext>" - Edit or delete the message with the button (optional)
- Delete the pending file
- Read
Scripts
- cdp.js — Fetch-only wrapper for CDP HTTP API (
/json,/json/list,/json/new); no shell. - pw.js — Playwright connect to browser; runs snapshot/goto/scroll/query/tweet-draft/tweet-post. Compose launcher: SideNav_NewTweet_Button, /compose/post, Post only (avoids reply buttons). Post button: tweetButton, tweetButtonInline.
Security
See SECURITY.md for mitigations and operational notes.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cdp-browser - 安装完成后,直接呼叫该 Skill 的名称或使用
/cdp-browser触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Cdp Browser 是什么?
CDP browser control at localhost:9222. Use when you need to inspect tabs, take screenshots, navigate, scroll, post to X, or run JS in a persistent browser se... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1010 次。
如何安装 Cdp Browser?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cdp-browser」即可一键安装,无需额外配置。
Cdp Browser 是免费的吗?
是的,Cdp Browser 完全免费(开源免费),可自由下载、安装和使用。
Cdp Browser 支持哪些平台?
Cdp Browser 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Cdp Browser?
由 gostlight(@gostlightai)开发并维护,当前版本 v2.0.1。