baoyu-danger-gemini-web
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGemini Web Client
Gemini Web Client
Text/image generation via Gemini Web API. Supports reference images and multi-turn conversations.
通过Gemini Web API生成文本/图像。支持参考图像和多轮对话。
Script Directory
脚本目录
Important: All scripts are located in the subdirectory of this skill.
scripts/Agent Execution Instructions:
- Determine this SKILL.md file's directory path as
SKILL_DIR - Script path =
${SKILL_DIR}/scripts/<script-name>.ts - Replace all in this document with the actual path
${SKILL_DIR}
Script Reference:
| Script | Purpose |
|---|---|
| CLI entry point for text/image generation |
| TypeScript port of |
重要提示:所有脚本都位于此skill的子目录中。
scripts/Agent执行说明:
- 确定此SKILL.md文件的目录路径为
SKILL_DIR - 脚本路径 =
${SKILL_DIR}/scripts/<script-name>.ts - 将本文档中所有替换为实际路径
${SKILL_DIR}
脚本参考:
| 脚本 | 用途 |
|---|---|
| 文本/图像生成的CLI入口 |
| |
Consent Check (REQUIRED)
同意检查(必填)
Before first use, verify user consent for reverse-engineered API usage.
Consent file locations:
- macOS:
~/Library/Application Support/baoyu-skills/gemini-web/consent.json - Linux:
~/.local/share/baoyu-skills/gemini-web/consent.json - Windows:
%APPDATA%\baoyu-skills\gemini-web\consent.json
Flow:
- Check if consent file exists with and
accepted: truedisclaimerVersion: "1.0" - If valid consent exists → print warning with date, proceed
acceptedAt - If no consent → show disclaimer, ask user via :
AskUserQuestion- "Yes, I accept" → create consent file with ISO timestamp, proceed
- "No, I decline" → output decline message, stop
- Consent file format:
{"version":1,"accepted":true,"acceptedAt":"<ISO>","disclaimerVersion":"1.0"}
首次使用前,需验证用户是否同意使用逆向工程API。
同意文件位置:
- macOS:
~/Library/Application Support/baoyu-skills/gemini-web/consent.json - Linux:
~/.local/share/baoyu-skills/gemini-web/consent.json - Windows:
%APPDATA%\\baoyu-skills\\gemini-web\\consent.json
流程:
- 检查是否存在包含和
accepted: true的同意文件disclaimerVersion: "1.0" - 若存在有效同意 → 打印包含日期的警告信息,继续执行
acceptedAt - 若未同意 → 显示免责声明,通过询问用户:
AskUserQuestion- "Yes, I accept" → 创建包含ISO时间戳的同意文件,继续执行
- "No, I decline" → 输出拒绝信息,停止执行
- 同意文件格式:
{\"version\":1,\"accepted\":true,\"acceptedAt\":\"<ISO>\",\"disclaimerVersion\":\"1.0\"}
Preferences (EXTEND.md)
偏好设置(EXTEND.md)
Use Bash to check EXTEND.md existence (priority order):
bash
undefined使用Bash检查EXTEND.md是否存在(优先级顺序):
bash
undefinedCheck project-level first
先检查项目级
test -f .baoyu-skills/baoyu-danger-gemini-web/EXTEND.md && echo "project"
test -f .baoyu-skills/baoyu-danger-gemini-web/EXTEND.md && echo "project"
Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
然后检查用户级(跨平台:$HOME适用于macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-danger-gemini-web/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────┬───────────────────┐
│ Path │ Location │
├──────────────────────────────────────────────────────────┼───────────────────┤
│ .baoyu-skills/baoyu-danger-gemini-web/EXTEND.md │ Project directory │
├──────────────────────────────────────────────────────────┼───────────────────┤
│ $HOME/.baoyu-skills/baoyu-danger-gemini-web/EXTEND.md │ User home │
└──────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐
│ Result │ Action │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ Found │ Read, parse, apply settings │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ Not found │ Use defaults │
└───────────┴───────────────────────────────────────────────────────────────────────────┘
**EXTEND.md Supports**: Default model | Proxy settings | Custom data directorytest -f "$HOME/.baoyu-skills/baoyu-danger-gemini-web/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────┬───────────────────┐
│ 路径 │ 位置 │
├──────────────────────────────────────────────────────────┼───────────────────┤
│ .baoyu-skills/baoyu-danger-gemini-web/EXTEND.md │ 项目目录 │
├──────────────────────────────────────────────────────────┼───────────────────┤
│ $HOME/.baoyu-skills/baoyu-danger-gemini-web/EXTEND.md │ 用户主目录 │
└──────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐
│ 结果 │ 操作 │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ 找到 │ 读取、解析、应用设置 │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ 未找到 │ 使用默认设置 │
└───────────┴───────────────────────────────────────────────────────────────────────────┘
**EXTEND.md支持**:默认模型 | 代理设置 | 自定义数据目录Usage
使用方法
bash
undefinedbash
undefinedText generation
文本生成
npx -y bun ${SKILL_DIR}/scripts/main.ts "Your prompt"
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Your prompt" --model gemini-2.5-pro
npx -y bun ${SKILL_DIR}/scripts/main.ts "你的提示词"
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "你的提示词" --model gemini-2.5-pro
Image generation
图像生成
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cute cat" --image cat.png
npx -y bun ${SKILL_DIR}/scripts/main.ts --promptfiles system.md content.md --image out.png
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "一只可爱的猫" --image cat.png
npx -y bun ${SKILL_DIR}/scripts/main.ts --promptfiles system.md content.md --image out.png
Vision input (reference images)
视觉输入(参考图像)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Describe this" --reference image.png
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Create variation" --reference a.png --image out.png
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "描述这张图" --reference image.png
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "创建变体" --reference a.png --image out.png
Multi-turn conversation
多轮对话
npx -y bun ${SKILL_DIR}/scripts/main.ts "Remember: 42" --sessionId session-abc
npx -y bun ${SKILL_DIR}/scripts/main.ts "What number?" --sessionId session-abc
npx -y bun ${SKILL_DIR}/scripts/main.ts "记住:42" --sessionId session-abc
npx -y bun ${SKILL_DIR}/scripts/main.ts "那个数字是多少?" --sessionId session-abc
JSON output
JSON输出
npx -y bun ${SKILL_DIR}/scripts/main.ts "Hello" --json
undefinednpx -y bun ${SKILL_DIR}/scripts/main.ts "你好" --json
undefinedOptions
选项
| Option | Description |
|---|---|
| Prompt text |
| Read prompt from files (concatenated) |
| Model: gemini-3-pro (default), gemini-2.5-pro, gemini-2.5-flash |
| Generate image (default: generated.png) |
| Reference images for vision input |
| Session ID for multi-turn conversation |
| List saved sessions |
| Output as JSON |
| Refresh cookies, then exit |
| Custom cookie file path |
| Chrome profile directory |
| 选项 | 描述 |
|---|---|
| 提示词文本 |
| 从文件读取提示词(多个文件内容会拼接) |
| 模型:gemini-3-pro(默认)、gemini-2.5-pro、gemini-2.5-flash |
| 生成图像(默认输出:generated.png) |
| 作为视觉输入的参考图像 |
| 多轮对话的会话ID |
| 列出已保存的会话 |
| 以JSON格式输出 |
| 刷新Cookie,然后退出 |
| 自定义Cookie文件路径 |
| Chrome配置文件目录 |
Models
模型
| Model | Description |
|---|---|
| Default, latest |
| Previous pro |
| Fast, lightweight |
| 模型 | 描述 |
|---|---|
| 默认模型,最新版本 |
| 上一代专业版模型 |
| 快速、轻量版模型 |
Authentication
身份验证
First run opens browser for Google auth. Cookies cached automatically.
Supported browsers (auto-detected): Chrome, Chrome Canary/Beta, Chromium, Edge.
Force refresh: flag. Override browser: env var.
--loginGEMINI_WEB_CHROME_PATH首次运行时会打开浏览器进行Google身份验证。Cookie会自动缓存。
支持的浏览器(自动检测):Chrome、Chrome Canary/Beta、Chromium、Edge。
强制刷新:使用参数。指定浏览器:设置环境变量。
--loginGEMINI_WEB_CHROME_PATHEnvironment Variables
环境变量
| Variable | Description |
|---|---|
| Data directory |
| Cookie file path |
| Chrome profile directory |
| Chrome executable path |
| Proxy for Google access (set inline with command) |
| 变量 | 描述 |
|---|---|
| 数据目录 |
| Cookie文件路径 |
| Chrome配置文件目录 |
| Chrome可执行文件路径 |
| 访问Google的代理(可随命令一起设置) |
Sessions
会话
Session files stored in data directory under .
sessions/<id>.jsonContains: , (Gemini chat state), array, timestamps.
idmetadatamessages会话文件存储在数据目录的中。
sessions/<id>.json包含内容:、(Gemini对话状态)、数组、时间戳。
idmetadatamessagesExtension Support
扩展支持
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
通过EXTEND.md进行自定义配置。请查看偏好设置部分获取路径和支持的选项。