Skip to content

feat(doubao): add Doubao AI desktop app CLI adapter#250

Open
yunluoxin wants to merge 1 commit intojackwener:mainfrom
yunluoxin:feat/doubao-adapter
Open

feat(doubao): add Doubao AI desktop app CLI adapter#250
yunluoxin wants to merge 1 commit intojackwener:mainfrom
yunluoxin:feat/doubao-adapter

Conversation

@yunluoxin
Copy link

Summary

Add a CLI adapter for Doubao (豆包) AI desktop app - an Electron-based chat application.

Motivation

Doubao is ByteDance's AI assistant desktop application with significant user base. Adding support enables:

  • CLI control of the Doubao AI chat
  • Automation of AI conversations
  • Integration with AI agent workflows

Commands

Command Description
doubao status Check CDP connection status
doubao send <text> Send a message
doubao read Read chat history
doubao new Start a new chat
doubao ask <text> Send and wait for AI response
doubao screenshot Capture window screenshot
doubao dump Dump DOM to /tmp/doubao-dom.html

Technical Details

  • Uses Chrome DevTools Protocol (CDP) to control the Electron app
  • Requires Doubao to be launched with --remote-debugging-port=9226
  • Key selectors discovered: [data-testid="chat_input_input"], [data-testid="chat_input_send_button"], [data-testid="message_content"]

Testing

# Start Doubao with debug port
"/Applications/Doubao.app/Contents/MacOS/Doubao" --remote-debugging-port=9226

# Set env and test
export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9226"
export OPENCLI_CDP_TARGET="doubao-chat"
opencli doubao status
opencli doubao ask "Hello!"

Files

  • src/clis/doubao/status.ts - Connection check
  • src/clis/doubao/send.ts - Send message via textarea + send button click
  • src/clis/doubao/read.ts - Read messages via [data-testid="message_content"]
  • src/clis/doubao/ask.ts - Send + poll for AI response
  • src/clis/doubao/new.ts - New chat via [data-testid="new_chat_button"]
  • src/clis/doubao/screenshot.ts - CDP screenshot
  • src/clis/doubao/dump.ts - DOM dump for debugging
  • src/clis/doubao/README.md - English documentation
  • src/clis/doubao/README.zh-CN.md - Chinese documentation

- Add CDP-based adapter for Doubao AI chat app (豆包)
- Commands: status, send, read, new, ask, screenshot, dump
- Supports Chrome DevTools Protocol control via --remote-debugging-port
- Works on macOS with Doubao.app

Closes jackwener#247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant