---
name: Google AI Mode CLI
slug: google-ai-mode-cli
category: AI Engineering
description: Google AI Mode CLI queries Google AI Mode from the terminal and returns AI-generated answers with cited source links. Use it for quick questions, follow-ups in the same session, or MCP access without opening a browser.
github: "https://github.com/ItamarZand88/CLI-Anything-WEB/tree/main/.claude/skills/gai-cli"
language: Python
stars: 215
forks: 45
install: "npx degit https://github.com/ItamarZand88/CLI-Anything-WEB/tree/main/.claude/skills/gai-cli ~/.claude/skills/gai-cli"
installs_to: ~/.claude/skills/gai-cli
source_path: .claude/skills/gai-cli/SKILL.md
collection_size: 25
category_size: 2970
collection_url: "https://dirskills.com/collections/ItamarZand88/CLI-Anything-WEB"
added: 2026-09-04T05:25:47.963Z
last_synced: 2026-09-04T05:25:47.963Z
canonical_url: "https://dirskills.com/skills/google-ai-mode-cli"
---

# Google AI Mode CLI

Google AI Mode CLI queries Google AI Mode from the terminal and returns AI-generated answers with cited source links. Use it for quick questions, follow-ups in the same session, or MCP access without opening a browser.

**Install:**

```bash
npx degit https://github.com/ItamarZand88/CLI-Anything-WEB/tree/main/.claude/skills/gai-cli ~/.claude/skills/gai-cli
```

## README

# cli-web-gai

Google AI Mode search: AI answers with source references, rendered through headless Playwright (Chromium).
Install: `pip install cli-web-gai`, then `playwright install chromium`.

## Commands

- `search ask QUERY` — submit a question. Options: `--lang CODE` (response language, e.g. en, he, de; default en), `--timeout SECONDS` (default 30), `--headed` (show the browser window, e.g. to solve a CAPTCHA)
- `search followup QUERY` — follow-up in the same conversation; requires a prior `ask` in the same session

## Examples

```bash
# Ask a question — returns answer + sources
cli-web-gai search ask "What is quantum computing?" --json

# Extract just the source URLs
cli-web-gai search ask "best static site generators" --json | \
  python3 -c "import json,sys; [print(s['url']) for s in json.load(sys.stdin)['data']['sources']]"

# Answer in another language
cli-web-gai search ask "What is machine learning?" --lang he --json

# Follow-up (same session only)
cli-web-gai search followup "How is it used in cryptography?" --json
```

## JSON output

Add `--json` for structured output: `{"success": true, "data": {query, answer, sources: [{title, url, snippet}], follow_up_prompt}}`. Errors: `{"error": true, "code": "...", "message": "..."}`.

## Utilities

`cli-web-gai doctor [--json]` diagnoses local setup. `cli-web-gai mcp-serve` exposes the commands as MCP tools over stdio. Running with no subcommand opens a REPL with `ask` / `followup` shortcuts.

## Agent tips

- Google rate-limits headless browsers; space out queries. If a CAPTCHA appears, rerun with `--headed` and solve it manually.
- Conversation threading (`followup`) only persists within a single CLI session, not across invocations.
