Skip to content
baoyu-danger-gemini-web logo

Gemini Web Client

baoyu-danger-gemini-web

Image generation skill using Gemini Web. Generates images from text prompts via Google Gemini. Also supports text generation. Use as the image generation backend for other skills like cover-image, xhs-images, article-illustrator.

aiskillstore/marketplace0installs430stars

SKILL.md

Full skill instructions

Gemini Web Client

Supports:

  • Text generation
  • Image generation (download + save)
  • Reference images for vision input (attach local images)
  • Multi-turn conversations via persisted --sessionId

Script Directory

Important: All scripts are located in the scripts/ subdirectory of this skill.

Agent Execution Instructions:

  1. Determine this SKILL.md file's directory path as SKILL_DIR
  2. Script path = ${SKILL_DIR}/​scripts/<script-name>.ts
  3. Replace all ${SKILL_DIR} in this document with the actual path

Script Reference:

ScriptPurpose
scripts/​main.tsCLI entry point for text/​image generation
scripts/​gemini-webapi/​*TypeScript port of gemini_webapi (GeminiClient, types, utils)

⚠️ Disclaimer (REQUIRED)

Before using this skill, the consent check MUST be performed.

Consent Check Flow

Step 1: Check consent file

# macOS
cat ~/​Library/​Application\ Support/​baoyu-skills/​gemini-web/​consent.json 2>/​dev/​null

# Linux
cat ~/​.local/​share/​baoyu-skills/​gemini-web/​consent.json 2>/​dev/​null

# Windows (PowerShell)
Get-Content "$env:APPDATA\baoyu-skills\gemini-web\consent.json" 2>$null

Step 2: If consent exists and accepted: true with matching disclaimerVersion: "1.0":

Print warning and proceed:

⚠️  Warning: Using reverse-engineered Gemini Web API (not official). Accepted on: <acceptedAt date>

Step 3: If consent file doesn't exist or disclaimerVersion mismatch:

Display disclaimer and ask user:

⚠️  DISCLAIMER

This tool uses a reverse-engineered Gemini Web API, NOT an official Google API.

Risks:
- May break without notice if Google changes their API
- No official support or guarantees
- Use at your own risk

Do you accept these terms and wish to continue?

Use AskUserQuestion tool with options:

  • Yes, I accept - Continue and save consent
  • No, I decline - Exit immediately

Step 4: On acceptance, create consent file:

# macOS
mkdir -p ~/​Library/​Application\ Support/​baoyu-skills/​gemini-web
cat > ~/​Library/​Application\ Support/​baoyu-skills/​gemini-web/​consent.json << 'EOF'
{
  "version": 1,
  "accepted": true,
  "acceptedAt": "<ISO timestamp>",
  "disclaimerVersion": "1.0"
}
EOF

# Linux
mkdir -p ~/​.local/​share/​baoyu-skills/​gemini-web
cat > ~/​.local/​share/​baoyu-skills/​gemini-web/​consent.json << 'EOF'
{
  "version": 1,
  "accepted": true,
  "acceptedAt": "<ISO timestamp>",
  "disclaimerVersion": "1.0"
}
EOF

Step 5: On decline, output message and stop:

User declined the disclaimer. Exiting.

Quick start

npx -y bun ${SKILL_DIR}/​scripts/​main.ts "Hello, Gemini"
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --prompt "Explain quantum computing"
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

# Multi-turn conversation (agent generates unique sessionId)
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "Remember this: 42" --sessionId my-unique-id-123
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "What number?" --sessionId my-unique-id-123

Commands

Text generation

# Simple prompt (positional)
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "Your prompt here"

# Explicit prompt flag
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --prompt "Your prompt here"
npx -y bun ${SKILL_DIR}/​scripts/​main.ts -p "Your prompt here"

# With model selection
npx -y bun ${SKILL_DIR}/​scripts/​main.ts -p "Hello" -m gemini-2.5-pro

# Pipe from stdin
echo "Summarize this" | npx -y bun ${SKILL_DIR}/​scripts/​main.ts

Image generation

# Generate image with default path (./​generated.png)
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --prompt "A sunset over mountains" --image

# Generate image with custom path
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --prompt "A cute robot" --image robot.png

# Shorthand
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "A dragon" --image=dragon.png

Vision input (reference images)

# Text + image -> text
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --prompt "Describe this image" --reference a.png

# Text + image -> image
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --prompt "Generate a variation" --reference a.png --image out.png

Output formats

# Plain text (default)
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "Hello"

# JSON output
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "Hello" --json

Options

OptionDescription
--prompt <text>, -pPrompt text
--promptfiles <files...>Read prompt from files (concatenated in order)
--model <id>, -mModel: gemini-3-pro (default), gemini-2.5-pro, gemini-2.5-flash
--image [path]Generate image, save to path (default: generated.png)
--reference <files...>, --ref <files...>Reference images for vision input
--sessionId <id>Session ID for multi-turn conversation (agent generates unique ID)
--list-sessionsList saved sessions (max 100, sorted by update time)
--jsonOutput as JSON
--loginRefresh cookies only, then exit
--cookie-path <path>Custom cookie file path
--profile-dir <path>Chrome profile directory
--help, -hShow help

CLI note: scripts/​main.ts supports text generation, image generation, reference images (--reference/​--ref), and multi-turn conversations via --sessionId.

Models

  • gemini-3-pro - Default, latest model
  • gemini-2.5-pro - Previous generation pro
  • gemini-2.5-flash - Fast, lightweight

Authentication

First run opens a browser to authenticate with Google. Cookies are cached for subsequent runs.

Supported browsers (auto-detected in order):

  • Google Chrome
  • Google Chrome Canary / Beta
  • Chromium
  • Microsoft Edge

Override with GEMINI_WEB_CHROME_PATH environment variable if needed.

# Force cookie refresh
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --login

Environment variables

VariableDescription
GEMINI_WEB_DATA_DIRData directory
GEMINI_WEB_COOKIE_PATHCookie file path
GEMINI_WEB_CHROME_PROFILE_DIRChrome profile directory
GEMINI_WEB_CHROME_PATHChrome executable path

Proxy Configuration

If you need a proxy to access Google services (e.g., in China), set HTTP_PROXY and HTTPS_PROXY environment variables before running:

# Example with local proxy
HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 npx -y bun ${SKILL_DIR}/​scripts/​main.ts "Hello"

# Image generation with proxy
HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 npx -y bun ${SKILL_DIR}/​scripts/​main.ts --prompt "A cat" --image cat.png

# Cookie refresh with proxy
HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 npx -y bun ${SKILL_DIR}/​scripts/​main.ts --login

Note: Environment variables must be set inline with the command. Shell profile settings (e.g., .bashrc) may not be inherited by subprocesses.

Examples

Generate text response

npx -y bun ${SKILL_DIR}/​scripts/​main.ts "What is the capital of France?"

Generate image

npx -y bun ${SKILL_DIR}/​scripts/​main.ts "A photorealistic image of a golden retriever puppy" --image puppy.png

Get JSON output for parsing

npx -y bun ${SKILL_DIR}/​scripts/​main.ts "Hello" --json | jq '.text'

Generate image from prompt files

# Concatenate system.md + content.md as prompt
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --promptfiles system.md content.md --image output.png

Multi-turn conversation

# Start a session with unique ID (agent generates this)
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "You are a helpful math tutor." --sessionId task-abc123

# Continue the conversation (remembers context)
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "What is 2+2?" --sessionId task-abc123
npx -y bun ${SKILL_DIR}/​scripts/​main.ts "Now multiply that by 10" --sessionId task-abc123

# List recent sessions (max 100, sorted by update time)
npx -y bun ${SKILL_DIR}/​scripts/​main.ts --list-sessions

Session files are stored in ~/​Library/​Application Support/​baoyu-skills/​gemini-web/​sessions/<id>.json and contain:

  • id: Session ID
  • metadata: Gemini chat metadata for continuation
  • messages: Array of {role, content, timestamp, error?}
  • createdAt, updatedAt: Timestamps

Extension Support

Custom configurations via EXTEND.md.

Check paths (priority order):

  1. .baoyu-skills/​baoyu-danger-gemini-web/​EXTEND.md (project)
  2. ~/​.baoyu-skills/​baoyu-danger-gemini-web/​EXTEND.md (user)

If found, load before workflow. Extension content overrides defaults.

More skills from aiskillstore

docx logo
aiskillstore/marketplace

docx

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

430 216
View
agent-development logo
aiskillstore/marketplace

agent-development

This handles everything around building autonomous agents for Claude Code plugins.

430 197
View
doc-coauthoring logo
aiskillstore/marketplace

doc-coauthoring

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

430 196
View
skill-development logo
aiskillstore/marketplace

skill-development

This is the meta-skill for building skills themselves.

430 196
View
canvas-design logo
aiskillstore/marketplace

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

430 193
View
webapp-testing logo
aiskillstore/marketplace

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

430 191
View
hook-development logo
aiskillstore/marketplace

hook-development

Helps you build event-driven automation for Claude Code using hooks that trigger on tool use, session events, and stop conditions.

430 187
View
algorithmic-art logo
aiskillstore/marketplace

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

430 185
View
command-development logo
aiskillstore/marketplace

command-development

Shows Claude Code how to build slash commands from markdown files, covering the YAML frontmatter options, dynamic arguments with $1/$2...

430 185
View
plugin-structure logo
aiskillstore/marketplace

plugin-structure

This is your reference when scaffolding Claude Code plugins or figuring out why components aren't loading.

430 183
View
skill-installer logo
aiskillstore/marketplace

skill-installer

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

430 180
View
web-artifacts-builder logo
aiskillstore/marketplace

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

430 177
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View