xpai-doubao-web by hunduncn/xpai-doubao-web
npx skills add https://github.com/hunduncn/xpai-doubao-web --skill xpai-doubao-web此技能通过复用浏览器登录 cookie,使用豆包网页版生成图像或文本。它提供了一个带有提示文件、可选参考图像、预设、会话和 JSON 输出的 CLI 封装器。
所有脚本都位于此技能的 scripts/ 子目录中。
脚本参考:
scripts/main.ts: CLI 入口点(图像/文本)scripts/doubao-webapi/*: TypeScript 客户端和辅助工具此技能依赖于逆向工程的网页行为,并将访问/存储您的豆包网页版 cookie。在运行自动化之前,请获取用户的明确同意。
同意文件位置:
~/Library/Application Support/xpai-skills/doubao-web/consent.json~/.local/share/xpai-skills/doubao-web/consent.json%APPDATA%\\xpai-skills\\doubao-web\\consent.json广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
同意文件格式:{"version":1,"accepted":true,"acceptedAt":"<ISO>","disclaimerVersion":"1.0"}
按以下顺序检查可选的 EXTEND.md 覆盖项:
# 项目级优先
test -f .xpai-skills/xpai-doubao-web/EXTEND.md && echo "project"
# 然后是用户级
test -f "$HOME/.xpai-skills/xpai-doubao-web/EXTEND.md" && echo "user"
支持的设置(如果您添加了相应的解析逻辑):默认模型、代理设置、自定义数据目录。
# 文生图
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts "您的提示词"
# 纯文本
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --mode text --prompt "总结这篇文章"
# 指定模型
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --prompt "您的提示词" --model doubao-default
# 生成图像文件
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --prompt "一只可爱的猫" --image out.png
# 从文件读取提示词
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --promptfiles system.md content.md --image out.png
# 视觉输入(参考图像)
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --prompt "创建变体" --reference a.png --image out.png
# 预设(通过提示词前缀/后缀设置宽高比)
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --preset xiaohongshu_cover --prompt "极简海报" --image out.png
# 列出预设
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --list-presets
# 多轮会话
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts "记住:42" --sessionId session-abc
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts "什么数字?" --sessionId session-abc
# JSON 输出
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts "你好" --json
--prompt, -p: 提示词文本--promptfiles: 从文件读取提示词(拼接)--model, -m: 模型字符串(透传)--mode: image(默认)或 text--preset: 预设名称(应用提示词前缀/后缀;默认 xiaohongshu_cover)--image [path]: 生成图像(默认:generated.png)--reference, --ref: 用于视觉输入的参考图像--sessionId: 用于多轮对话的会话 ID--list-sessions: 列出已保存的会话--list-presets: 列出预设名称和配置路径--json: 输出为 JSON--login: 刷新 cookie,然后退出--cookie-path: 自定义 cookie 文件路径--profile-dir: Chrome 配置文件目录登录使用浏览器 cookie。CLI 支持:
--login 触发基于浏览器的刷新(使用 Playwright 实现)。--cookie-path 或 DOUBAO_WEB_COOKIE_PATH 指向导出的 cookie 文件。流程说明:
--login 会打开一个可见的浏览器窗口并保存 cookie。DOUBAO_WEB_HEADLESS=0 以显示浏览器。--login。对于 --login 和图像生成,请安装 Playwright 及其浏览器:
npm i -D playwright
npx playwright install
支持的浏览器(Playwright):Chromium/Chrome/Edge。通过 DOUBAO_WEB_CHROME_PATH 覆盖浏览器路径。如果传递了 --profile-dir,它将被用作 Playwright 用户数据目录。
预设配置路径优先级:
DOUBAO_WEB_PRESETS_PATH.xpai-skills/xpai-doubao-web/presets.json(项目级)$HOME/.xpai-skills/xpai-doubao-web/presets.json(用户级)格式:
{
"default": "xiaohongshu_cover",
"presets": {
"xiaohongshu_cover": { "prefix": "...", "suffix": "..." }
}
}
示例文件:references/presets.example.json
DOUBAO_WEB_DATA_DIR: 数据目录DOUBAO_WEB_COOKIE_PATH: Cookie 文件路径DOUBAO_WEB_HEADLESS: 设置为 0 以有头模式运行浏览器(默认:无头模式)DOUBAO_WEB_MAX_IMAGES: 最大保存图像数(默认:1)DOUBAO_WEB_LOGIN_URL: 在浏览器中打开的登录 URL(默认:https://www.doubao.com/)DOUBAO_WEB_COOKIE_DOMAIN: 按域名过滤 cookie(默认:doubao.com)DOUBAO_WEB_PRESETS_PATH: 预设配置文件路径DOUBAO_WEB_INPUT_SELECTOR: 提示词输入框的自定义选择器DOUBAO_WEB_OUTPUT_SELECTOR: 最新助手消息的自定义选择器DOUBAO_WEB_CHROME_PROFILE_DIR: Chrome 配置文件目录DOUBAO_WEB_CHROME_PATH: Chrome 可执行文件路径HTTP_PROXY, HTTPS_PROXY: 用于网络访问的代理会话文件存储在数据目录下的 sessions/<id>.json 中。
包含:id、conversationUrl、messages、时间戳。当设置 --sessionId 时,一个持久的 Playwright 配置文件将存储在 profiles/<id>/ 下以保持登录状态。
每周安装量
103
代码仓库
GitHub 星标数
1
首次出现
2026年2月4日
安全审计
安装于
kimi-cli99
codex99
gemini-cli98
opencode98
github-copilot98
amp98
Use this skill to generate images or text from Doubao Web by reusing browser login cookies. It provides a CLI wrapper with prompt files, optional reference images, presets, sessions, and JSON output.
All scripts are located in the scripts/ subdirectory of this skill.
Script reference:
scripts/main.ts: CLI entry point (image/text)scripts/doubao-webapi/*: TypeScript client and helpersThis skill relies on reverse-engineered web behavior and will access/store your Doubao Web cookies. Obtain explicit user consent before running automation.
Consent file locations:
~/Library/Application Support/xpai-skills/doubao-web/consent.json~/.local/share/xpai-skills/doubao-web/consent.json%APPDATA%\\xpai-skills\\doubao-web\\consent.jsonConsent file format: {"version":1,"accepted":true,"acceptedAt":"<ISO>","disclaimerVersion":"1.0"}
Check for optional EXTEND.md overrides in this order:
# Project-level first
test -f .xpai-skills/xpai-doubao-web/EXTEND.md && echo "project"
# Then user-level
test -f "$HOME/.xpai-skills/xpai-doubao-web/EXTEND.md" && echo "user"
Supported settings (if you add parsing for them): default model, proxy settings, custom data directory.
# Text-to-image
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts "Your prompt"
# Text-only
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --mode text --prompt "Summarize this article"
# Specify model
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --prompt "Your prompt" --model doubao-default
# Generate an image file
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --prompt "A cute cat" --image out.png
# Prompt from files
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --promptfiles system.md content.md --image out.png
# Vision input (reference images)
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --prompt "Create variation" --reference a.png --image out.png
# Preset (aspect ratio via prompt prefix/suffix)
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --preset xiaohongshu_cover --prompt "Minimalist poster" --image out.png
# List presets
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts --list-presets
# Multi-turn sessions
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts "Remember: 42" --sessionId session-abc
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts "What number?" --sessionId session-abc
# JSON output
npx -y bun /Users/aqxp/Aicodingmac/test2/xpai-doubao-web/scripts/main.ts "Hello" --json
--prompt, -p: Prompt text--promptfiles: Read prompt from files (concatenated)--model, -m: Model string (pass-through)--mode: image (default) or text--preset: Preset name (applies prompt prefix/suffix; default xiaohongshu_cover)--image [path]: Generate image (default: )Login uses browser cookies. The CLI supports:
--login to trigger a browser-based refresh (implemented with Playwright).--cookie-path or DOUBAO_WEB_COOKIE_PATH to point at an exported cookie file.Flow notes:
--login opens a visible browser window and saves cookies.DOUBAO_WEB_HEADLESS=0 to show the browser.--login again.For --login and image generation, install Playwright and its browsers:
npm i -D playwright
npx playwright install
Supported browsers (Playwright): Chromium/Chrome/Edge. Override browser path via DOUBAO_WEB_CHROME_PATH. If you pass --profile-dir, it is used as a Playwright user data directory.
Preset config path priority:
DOUBAO_WEB_PRESETS_PATH.xpai-skills/xpai-doubao-web/presets.json (project)$HOME/.xpai-skills/xpai-doubao-web/presets.json (user)Format:
{
"default": "xiaohongshu_cover",
"presets": {
"xiaohongshu_cover": { "prefix": "...", "suffix": "..." }
}
}
Example file: references/presets.example.json
DOUBAO_WEB_DATA_DIR: Data directoryDOUBAO_WEB_COOKIE_PATH: Cookie file pathDOUBAO_WEB_HEADLESS: Set to 0 to run browser in headed mode (default: headless)DOUBAO_WEB_MAX_IMAGES: Max images to save (default: 1)DOUBAO_WEB_LOGIN_URL: Login URL to open in the browser (default: https://www.doubao.com/)DOUBAO_WEB_COOKIE_DOMAIN: Filter cookies by domain (default: doubao.com)Session files are stored in the data directory under sessions/<id>.json.
Contains: id, conversationUrl, messages, timestamps. When --sessionId is set, a persistent Playwright profile is stored under profiles/<id>/ to keep login state.
Weekly Installs
103
Repository
GitHub Stars
1
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykWarn
Installed on
kimi-cli99
codex99
gemini-cli98
opencode98
github-copilot98
amp98
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
67,500 周安装
generated.png--reference, --ref: Reference images for vision input--sessionId: Session ID for multi-turn conversation--list-sessions: List saved sessions--list-presets: List preset names and config paths--json: Output as JSON--login: Refresh cookies, then exit--cookie-path: Custom cookie file path--profile-dir: Chrome profile directoryDOUBAO_WEB_PRESETS_PATH: Preset config file pathDOUBAO_WEB_INPUT_SELECTOR: Custom input selector for the prompt boxDOUBAO_WEB_OUTPUT_SELECTOR: Custom selector for the latest assistant messageDOUBAO_WEB_CHROME_PROFILE_DIR: Chrome profile directoryDOUBAO_WEB_CHROME_PATH: Chrome executable pathHTTP_PROXY, HTTPS_PROXY: Proxy for web access