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.
Run from the skill dir (bin/ scripts):
| Command | Description | ||
|---|---|---|---|
| --------- | ------------- | ||
status | List all tabs (JSON from CDP) | ||
tabs | Same as status | ||
new | Open new tab | ||
goto | Navigate tab to URL | ||
snapshot | Full-page screenshot (PNG) | ||
close-popup | Dismiss dialogs/modals | ||
`scroll | sel> [down\ | up]` | Scroll by pixels or selector | |
query | Return current page URL | ||
query | Return element text (or body) | ||
query | Return element HTML (or body) | ||
tweet-draft | Fill compose box only; does NOT post | ||
tweet-post | Post tweet (requires --confirm as second arg) | ||
tweet | Alias for tweet-draft (fills compose only) |
--confirm as second arg (strict). Use when user explicitly approves ("go ahead", "post it", or Telegram confirm button).tweet.confirmButton is enabled in config, the agent can run tweet-draft --save-pending to write pending state, then send a message with an inline "Confirm Post" button. On confirm, the agent runs tweet-post --confirm.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.
When tweet.confirmButton is true (config present) and you are in a Telegram session:
tweet-draft --save-pending "text" from the skill dir. This fills the compose box and writes ~/.openclaw/workspace/.cdp-browser/pending-tweet.json.```bash
./scripts/send-tweet-confirm.sh
```
Or use openclaw message send directly with --buttons '[[{"text":"Confirm Post","callback_data":"cdp:tweet:confirm"}]]'. Use the current session's reply target as .
callback_data: cdp:tweet:confirm. Or the user says "go ahead"/"post it". Treat either as approval. Then:~/.openclaw/workspace/.cdp-browser/pending-tweet.json for text and tabIdtweet-post --confirm "" /json, /json/list, /json/new); no shell.See SECURITY.md for mitigations and operational notes.
共 1 个版本