CLI for AI-powered browser automation. Tell the agent what you want, and it autonomously navigates, clicks, fills forms, and extracts data.
Built with Gemini AI and Chrome DevTools MCP.
- Go to Target and search for 'bookshelf'. 2. Apply these filters: Color = White, Material = Wood. 3. Set max price to $80. 4. Show only items that are available for order pickup. 5. List the links for all results.
- Node.js >= 20.19.0
- Google Chrome browser
- Gemini API key
pnpm install
cp .env.example .env
# Add your GEMINI_API_KEY to .env
# Optionally, create your own config to override defaults
cp .chrome-geminirc.default.json .chrome-geminirc.jsonDefault Interactive Mode:
Starts a chat session.
npm startRun a Task:
Executes a one-off task with default settings.
npm start -- "Find Honolulu's weather on Google"Using a Preset:
Executes a task using a named preset for configured, non-interactive, or schema-driven tasks.
# This assumes a "product-scrape" preset exists in your config
# that sets a schema and disables interactive mode.
npm start -- --preset product-scrape "Get the top 3 laptops from Best Buy"Scripting (Quiet Mode):
For clean JSON output suitable for piping or redirecting, use npm start --silent.
# Using a preset and piping output to a file
npm start --silent -- --preset product-scrape "Get the top 3 laptops" > output/laptops.jsonImportant: When redirecting output (>) or piping (|), always use npm start --silent to prevent progress logs from appearing in your output.
Chrome Gemini CLI uses an opinionated configuration system where the config file controls all non-secret settings.
Configuration is resolved in this order (highest to lowest priority):
- CLI Flags - For temporary, one-time overrides (presets only).
- Project Config -
.chrome-geminirc.jsonin the current directory (optional, overrides defaults). - Default Config -
.chrome-geminirc.default.json(built-in, always present).
Environment variables are used strictly for secrets. All other configuration belongs in a config file.
# .env
GEMINI_API_KEY=your_key_hereThis is the standard way to configure the CLI.
Project Config (.chrome-geminirc.json):
Create this in your project's root directory. It controls how the tool should behave.
{
"interactive": true,
"maxSteps": 30,
"model": "gemini-3-flash-preview",
"requestDelayMs": 1000,
"schema": "",
"temperature": 1,
"thinkingLevel": "medium",
"presets": {
"quick": {
"maxSteps": 20,
"interactive": false
},
"research": {
"maxSteps": 50,
"thinkingLevel": "high"
}
}
}Configuration Fields:
interactive- Enable interactive chat mode after task completionmaxSteps- Maximum number of agent steps before stoppingmodel- Gemini model to use (e.g.,gemini-3-flash-preview,gemini-3-pro-preview)requestDelayMs- Delay in milliseconds between Gemini API calls to prevent rate limitingschema- Path to a TypeScript schema file for structured JSON outputsystemPrompt- Path to a markdown file with custom system prompt instructionstemperature- Model temperature for response randomness (0 = deterministic, 2 = maximum creativity)thinkingLevel- Reasoning depth for model thinking (minimal,low,medium,high)presets- Named configurations that can be invoked with--preset <name>
The tool comes with .chrome-geminirc.default.json that provides sensible defaults. You can override any values by creating .chrome-geminirc.json.
The CLI is intentionally minimal, prioritizing configuration files.
--preset <name>- Use a named preset.--help- Show usage information.
Presets allow you to create named configurations for common workflows. They are defined in the presets object for running automated tasks.
# Use the "quick" preset
npm start -- --preset quick "Find the price of an iPhone"
# Use the "research" preset
npm start -- --preset research "Discover the top 5 AI companies, and summarize the Wikipedia page of each company."Note: Use npm start --silent to suppress all logs and get clean JSON output (perfect for piping/scripting).
Schema files for structured output must:
- Be TypeScript (.ts) files
- Import
Typefrom@google/genai - Export a schema object with Gemini Type enums
Example (schemas/examples/price-schema.ts):
import { Type } from '@google/genai'
export const priceSchema = {
type: Type.OBJECT,
properties: {
product: { type: Type.STRING },
price: { type: Type.STRING },
available: { type: Type.BOOLEAN }
},
required: ['product', 'price']
}Add your own schemas in schemas/ directory (git-ignored). See schemas/examples/ for examples.
