@bsbofmusic/cdper-chatgpt
v1.1.9
Published
Standalone ChatGPT CLI controlled through a user's real Chrome/Edge via CDP Bridge
Downloads
1,952
Maintainers
Readme
cdper-chatgpt
Standalone ChatGPT workflow CLI for the user's real logged-in Chrome over CDP. It is not a general browser automation framework; use official playwright-core directly for arbitrary page control after Chrome is available.
Install
npm install -g @bsbofmusic/cdper-chatgptRequirements:
- Node.js 18+
- A real Chrome/Edge profile with ChatGPT logged in
- Local Chrome DevTools on
127.0.0.1:9222from your launcher/bridge;CDP_WSremains an optional explicit override
Use
cdper-chatgpt "What is 2+2?"
cdper-chatgpt "请详细解释 TCP keepalive" --json --wait normal
cdper-chatgpt doctor --json
cdper-chatgpt status --json
cdper-chatgpt session --jsonSave a CDP WebSocket URL locally:
cdper-chatgpt config set --ws "ws://<host>:<port>/devtools/browser?token=<token>" --jsonQuery options
--json- structured JSON output--mode default|instant|thinking|pro- ChatGPT mode path--allow-mode-switch- allow mode switching--session <id>- continue a known session--conversation-policy auto|fresh|followup--wait short|normal|long|very_long--max-wait-ms <ms>--progress-every-ms <ms>--max-extends <n>--no-check- skip preflight check
Programmatic API
const { queryChatGPT } = require('@bsbofmusic/cdper-chatgpt');
const result = await queryChatGPT('What is 2+2?', {
conversationPolicy: 'fresh',
expectedDuration: 'short',
});Release notes — 1.0.1
- Depends on
@bsbofmusic/cdper-core@^1.2.7, sostatus --jsoncorrectly reports healthy local CDP (bridge=local,browser=ready,ws=alive) asok=true. - Fresh ChatGPT queries use the homepage composer path: switch Thinking through the visible UI, insert the prompt via CDP
Input.insertText, click the visible send button, and verify a new user turn. The old?q=/hints=searchURL-entrypoint naming was removed from the live path because it drifted in headless Chrome. - Pack/install smoke was verified from the generated tarball in an isolated npm prefix before publish.
Design note: avoid clever URL shortcuts when the product UI is the stable contract. The durable invariant is “one full prompt inserted atomically, one real send click, one verified user turn.”
Security
All ChatGPT workflow control happens through the user's real browser via local CDP. Tokens are redacted from diagnostic output. Do not commit CDP_WS or full WebSocket URLs containing token=. For arbitrary page automation, use playwright-core directly instead of expanding cdper's product surface.
