tuzi-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 |
重要提示: 所有脚本都位于本技能的 子目录下。
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/tuzi-skills/gemini-web/consent.json - Linux:
~/.local/share/tuzi-skills/gemini-web/consent.json - Windows:
%APPDATA%\tuzi-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/tuzi-skills/gemini-web/consent.json - Linux:
~/.local/share/tuzi-skills/gemini-web/consent.json - Windows:
%APPDATA%\tuzi-skills\gemini-web\consent.json
流程:
- 检查是否存在同意书文件,且文件中 、
accepted: truedisclaimerVersion: "1.0" - 如果存在有效同意书 → 打印包含日期的提示,继续执行
acceptedAt - 如果不存在同意书 → 展示免责声明,通过询问用户:
AskUserQuestion- "是的,我同意" → 创建带有ISO时间戳的同意书文件,继续执行
- "不,我拒绝" → 输出拒绝信息,停止执行
- 同意书文件格式:
{"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 .tuzi-skills/tuzi-danger-gemini-web/EXTEND.md && echo "project"
test -f .tuzi-skills/tuzi-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/.tuzi-skills/tuzi-danger-gemini-web/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────┬───────────────────┐
│ Path │ Location │
├──────────────────────────────────────────────────────────┼───────────────────┤
│ .tuzi-skills/tuzi-danger-gemini-web/EXTEND.md │ Project directory │
├──────────────────────────────────────────────────────────┼───────────────────┤
│ $HOME/.tuzi-skills/tuzi-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/.tuzi-skills/tuzi-danger-gemini-web/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────┬───────────────────┐
│ 路径 │ 位置 │
├──────────────────────────────────────────────────────────┼───────────────────┤
│ .tuzi-skills/tuzi-danger-gemini-web/EXTEND.md │ 项目目录 │
├──────────────────────────────────────────────────────────┼───────────────────┤
│ $HOME/.tuzi-skills/tuzi-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-3-flash
npx -y bun ${SKILL_DIR}/scripts/main.ts "Your prompt"
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Your prompt" --model gemini-3-flash
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 "A cute cat" --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 "Describe this" --reference image.png
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Create variation" --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 "Remember: 42" --sessionId session-abc
npx -y bun ${SKILL_DIR}/scripts/main.ts "What number?" --sessionId session-abc
JSON output
JSON格式输出
npx -y bun ${SKILL_DIR}/scripts/main.ts "Hello" --json
undefinednpx -y bun ${SKILL_DIR}/scripts/main.ts "Hello" --json
undefinedOptions
参数选项
| Option | Description |
|---|---|
| Prompt text |
| Read prompt from files (concatenated) |
| Model: gemini-3-pro (default), gemini-3-flash, gemini-3-flash-thinking, gemini-3.1-pro-preview |
| 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-3-flash, gemini-3-flash-thinking, gemini-3.1-pro-preview |
| 生成图片(默认保存为generated.png) |
| 视觉输入的参考图片 |
| 多轮对话的会话ID |
| 列出已保存的会话 |
| 以JSON格式输出 |
| 刷新cookie后退出 |
| 自定义cookie文件路径 |
| Chrome配置文件目录 |
Models
支持模型
| Model | Description |
|---|---|
| Default, latest 3.0 Pro |
| Fast, lightweight 3.0 Flash |
| 3.0 Flash with thinking |
| 3.1 Pro preview (empty header, auto-routed) |
| 模型 | 描述 |
|---|---|
| 默认,最新3.0 Pro版本 |
| 快速轻量的3.0 Flash版本 |
| 具备思考能力的3.0 Flash版本 |
| 3.1 Pro预览版(空请求头,自动路由) |
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自定义配置,路径和支持的配置项见偏好设置章节。