| name | gemini-image |
| description | Automate image generation on Google Gemini (gemini.google.com) using CamoFox CLI. Use when the user asks to "generate image", "create image with Gemini", "AI image generation", "tạo hình ảnh", or needs automated Gemini workflows. |
| allowed-tools | Bash(camofox:*) |
Gemini Image Generation Skill (CLI)
Use this skill for Gemini image generation flows with CamoFox CLI commands only. Use curl only for download file retrieval from the local CamoFox download API.
1. Prerequisites
- CamoFox server must be running on port
9377.
- Google account with Gemini access.
- First-time login requires email/password and 2FA approval on phone.
- After first login, save and reuse a session profile.
2. Quick Start (Fast Path — Authenticated)
When a valid Gemini session is already saved:
All commands below assume --user gemini. Add it explicitly in multi-session scenarios.
camofox open https://gemini.google.com/app --user gemini
camofox session load <profile-name> --user gemini
camofox snapshot --user gemini
camofox type <prompt-ref> "your image description here" --user gemini
camofox press Enter --user gemini
camofox wait 'mat-icon[fonticon="download"]' --timeout 180000 --user gemini
camofox click 'mat-icon[fonticon="download"]' --user gemini
camofox close --user gemini
3. Authentication Flow
Step 3.1: Check Auth State
camofox open https://gemini.google.com/app --user gemini
camofox snapshot --user gemini
Step 3.2: Login (if needed)
camofox navigate https://accounts.google.com --user gemini
camofox fill '[e1]="email@gmail.com"' --user gemini
camofox type e1 "email@gmail.com" --user gemini
camofox click e4 --user gemini
camofox wait 'input[type="password"]' --user gemini
camofox snapshot --user gemini
camofox type e2 "password" --user gemini
camofox click e4 --user gemini
Security Tip: For production workflows, store credentials in CamoFox Auth Vault:
camofox auth save google-gemini
camofox auth load google-gemini --user gemini
Step 3.3: 2FA (Push Notification)
After entering password, Google may prompt 2FA:
- Push notification: user taps "Yes" on phone app.
- Wait for redirect:
camofox wait 'a[href*="myaccount.google.com"]' --timeout 90000 --user gemini
- Or wait for URL change away from
accounts.google.com:
camofox wait navigation --timeout 90000 --user gemini
Step 3.4: Save Session
camofox session save <profile-name> --user gemini
4. Image Generation
camofox navigate https://gemini.google.com/app --user gemini
camofox snapshot --user gemini
camofox type <prompt-ref> "Generate an image of a cute red fox wearing sunglasses in digital art style" --user gemini
camofox press Enter --user gemini
camofox wait 'mat-icon[fonticon="download"]' --timeout 180000 --user gemini
camofox snapshot --user gemini
5. Download Generated Image
camofox click 'mat-icon[fonticon="download"]' --user gemini
camofox downloads --format json --user gemini
curl -o "generated-image.png" "http://localhost:9377/downloads/<download-id>/content?userId=gemini"
camofox close --user gemini
6. Tips & Best Practices
- Session reuse: Always save profile after login. Load before each run to skip login.
- Locale-agnostic selectors: Use
mat-icon[fonticon="..."] instead of text labels.
- Wait instead of sleep: Use
camofox wait with CSS selectors, not fixed delays.
- Re-snapshot after actions: Element refs (
eN) shift after navigation/interaction.
- Image prompts: Be descriptive; Gemini performs better with detailed prompts.
- Rate limits: Free tier has daily image generation limits. If limit is reached, wait or switch account.
7. Error Recovery
| Error | Solution |
|---|
| "Sign in" still visible after session load | Session expired (24-48h). Re-login with email/password + 2FA |
wait times out for download button | Image generation may have failed. Run camofox snapshot and inspect error text |
| "can't create it right now" | Not authenticated. Re-check auth state and login again |
| "Image Generation Limit Reached" | Daily limit reached. Wait 24h or use another account |
TAB_NOT_FOUND | Tab was invalidated. Open a new tab with camofox open |
type does not input text | Gemini may use custom editor. Fallback: camofox eval 'document.querySelector(".ql-editor").innerHTML = "prompt"' |
8. Verified Test Results
- Account:
user@gmail.com (User)
- Profile:
gemini-sky (52 cookies)
- Test prompt:
Generate an image of a cute red fox wearing sunglasses in digital art style
- Result:
8.1MB PNG (Gemini_Generated_Image_ecu3ujecu3ujecu3.png)
- Generation time:
~30 seconds
- Download method:
click mat-icon[fonticon="download"]