Playwright with Gemini CLI: 5-Step Setup Guide for 2026
Connect Gemini CLI to Playwright MCP, pick an auth path that still works, and ship AI-generated tests that pass CI.
On June 18, 2026, Google switched off Gemini CLI for free and consumer accounts, yet most guides to playwright with gemini cli still open with a Google sign-in that now fails.
So you install the tool, the login succeeds, and the very next screen turns you away. Get past that, and the first tests the agent writes tend to guess at selectors and go red in CI.
This guide uses only the auth paths Google still supports, wires in Playwright MCP, and shows every command and output from a real run against a demo store, ending with a spec that passed in CI.
What playwright with gemini cli means in 2026
Playwright with Gemini CLI means running Google's open-source terminal agent with the Playwright MCP server attached. The agent opens a real browser, reads the page's accessibility tree, and writes or repairs Playwright tests from what it actually sees, not from guesses about your markup.
Gemini CLI is a terminal agent. You type a request in plain English, and it reads files, runs shell commands, and calls tools on your behalf. The project is Apache 2.0 licensed, has passed 107,000 GitHub stars, and still ships weekly. Version 0.65.0 landed on npm on October 20, 2026.
Who lost access on June 18, 2026
On May 19, 2026, Google announced that it was folding Gemini CLI into Antigravity, its agent-first development platform. The post set the cutoff date. From June 18, 2026, Gemini CLI stopped serving requests for Google AI Pro, Google AI Ultra, and free use through Gemini Code Assist for individuals.

The same post is clear about who keeps access. Gemini CLI "will remain accessible via paid Gemini and Gemini Enterprise Agent Platform API keys," and Code Assist Standard and Enterprise customers were told "your access remains unchanged."
The June 18 notice on GitHub repeats it: enterprise licenses and API key authentication "remain completely unaffected."
One more signal matters for planning. The Gemini CLI docs now state that the tool "has not been optimized for Gemini 4 Argon" and point you to Antigravity for that model. Google's newest flagship goes to the newer product first, so expect to run Gemini 3 series models in this workflow.
Why teams still pick Gemini CLI for Playwright
If you hold an API key or an enterprise license, three things keep Gemini CLI on the shortlist:
-
It runs wherever Node runs. No IDE, no desktop app. It works over SSH and inside CI containers.
-
MCP support is mature. Gemini CLI has shipped Model Context Protocol support since 2025, and the Playwright MCP README lists it as a client that takes the standard config block.
-
It is scriptable. A headless mode with JSON output and documented exit codes lets you chain generate, run, and fix without a person at the keyboard.
The download curve tells the rest of the story. Monthly npm downloads of the package peaked at 3.47 million in April 2026 and fell to 1.63 million by September 2026, after the consumer cutoff. Anyone still installing it needs an API key or an enterprise license, which is who this guide is written for.

If your account was moved, the comparison near the end shows how the same Playwright setup carries over to Antigravity CLI, and the Playwright AI ecosystem maps where both tools sit. Everyone else can start with the five-step overview.
How to set up playwright with gemini cli in 5 steps
Here is the whole process, start to finish. Each step has one trap, and the sections that follow show the trap and the fix with real output.
- Install Gemini CLI with npm (Node 20 or newer) and authenticate with a paid Gemini API key, Vertex AI, or a Code Assist Standard or Enterprise license.
- Add the Playwright MCP server with gemini mcp add playwright npx @playwright/mcp@latest, then add the --headless and --caps testing flags.
- Trust the project folder so Gemini CLI loads project settings, reads the env file, and connects MCP servers.
- Install a Playwright skill pack and write a short GEMINI.md with your locator and wait rules.
- Prompt for a spec, run it with npx playwright test, and stream the results to TestDino so you can watch how AI-written tests behave over time.
Check the environment first. Playwright MCP needs Node 18 or newer and Gemini CLI needs Node 20, so Node 20 covers both. You also need a Playwright project: npm init playwright@latest creates one, and Playwright 1.64 is the current release line.
Every browser example below runs against the public TestDino demo store at storedemo.testdino.com, a small electronics shop with search, cart, and login pages. Swap in your own staging URL once the loop works.

Start with the install, because the auth choice you make there decides your daily budget.
Step 1: install Gemini CLI and pick an auth path that still works
Install the CLI globally and confirm the version. Homebrew users can run brew install gemini-cli instead, and npx @google/gemini-cli runs it without installing anything. All three give you the same binary.
npm install -g @google/gemini-cli
gemini --version
# 0.65.0 was the latest release on npm as of October 22, 2026
Pick the auth method that survives 2026
Run gemini once inside your project folder. The first screen asks how you want to authenticate and lists three options: Sign in with Google, Use Gemini API Key, and Vertex AI. Option 1 only works if your organization holds a Code Assist Standard or Enterprise license.
The daily budget depends on that choice. A single Playwright MCP session can burn dozens of requests, because every snapshot, click, and assertion is a separate tool call. These are the limits on the Gemini CLI quota page, last updated June 18, 2026.
| Auth method | Daily request limit | Status after June 18, 2026 |
|---|---|---|
| Sign in with Google (Code Assist for individuals, free) | 1,000 | Stopped; moved to Antigravity CLI |
| Sign in with Google (Google AI Pro) | 1,500 | Stopped; moved to Antigravity CLI |
| Sign in with Google (Google AI Ultra) | 2,000 | Stopped; moved to Antigravity CLI |
| Gemini API key (unpaid tier) | 250, Flash models only | Still listed; Google names paid keys as the supported path |
| Gemini API key (paid) | Varies by pricing tier, billed per token | Supported |
| Vertex AI (express mode) | Varies; billing required after 90 days | Supported |
| Gemini Code Assist Standard | 1,500 | Supported |
| Gemini Code Assist Enterprise | 2,000 | Supported |
For the API key route, create a key in Google AI Studio and store it in an env file that Gemini CLI reads on its own. The CLI loads the first .env it finds while searching up from the current directory, then falls back to ~/.gemini/.env. Variables come from the first file found, not merged across files.
GEMINI_API_KEY=your_key_here
For Vertex AI, set the project and location instead. Gemini CLI honors the same variables when you export them from your shell profile.
GOOGLE_GENAI_USE_VERTEXAI=true
GOOGLE_CLOUD_PROJECT=my-gcp-project
GOOGLE_CLOUD_LOCATION=us-central1
Pick option 1 on a personal account and the browser login succeeds, then the CLI rejects the session with "This client is no longer supported for Gemini Code Assist for individuals." That one line is why the API key path comes first in this guide.

Choose a model before you generate anything
Gemini CLI defaults to Auto routing, which sends complex prompts to a Pro model and simple ones to a Flash model.
On the build we captured, the picker listed gemini-3.1-pro-preview and gemini-3.5-flash behind Auto, with a Manual option to pin any model. The /model command opens that picker inside a session, and -m sets a model at launch.
gemini -m gemini-3.1-pro-preview
Test generation counts as a complex prompt. The model holds a page snapshot, your rules file, and the spec it is writing at the same time. So on a paid key, a Pro model for generation and Flash for quick questions is the sensible split.
There is one trap on an unpaid API key. The quota page limits that tier to Flash models, so a Pro request fails, and Auto routing keeps retrying while the session sits on "Thinking" for minutes.
Pin a Flash model in project settings and the problem disappears. In our runs, Gemini 3 Flash handled the whole generate, run, and heal loop against the demo store.
{
"model": { "name": "gemini-3-flash-preview" }
}

With a working login and a pinned model, the next job is giving the agent a browser.
Step 2: connect the Playwright MCP server to Gemini CLI
Playwright MCP is the bridge. It exposes browser actions as tools that any MCP client can call, and Gemini CLI is one of those clients. If you searched for gemini cli playwright mcp, this is the step you wanted. It is also the one with the trap: folder trust.
Add the server with one command
Gemini CLI ships a management command that writes the config for you, so the whole gemini cli mcp setup is one line. Run it from the project root so the server lands in project scope.
gemini mcp add playwright npx @playwright/mcp@latest
# MCP server "playwright" added to project settings. (stdio)
That writes the same JSON block that Cursor, VS Code, and Claude Code use, which is why the Playwright MCP setup for Cursor looks so familiar. Add -s user to put the server in ~/.gemini/settings.json for every project instead.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}
The screenshot below is the full sequence on a Windows machine: the add command, the generated settings file, and a listing that already hints at the next problem.

Trust the folder, or nothing connects
The last line of that screenshot is the trap. Gemini CLI runs a fail-closed trust model. In an untrusted folder it does not load the project settings file, does not read .env files, and "will not attempt to connect to any MCP servers." Your Playwright server shows as disconnected, and nothing in the config explains why.
Launch gemini in the folder and the trust dialog appears before anything else. Choose "Trust folder" and the decision is saved to ~/.gemini/trustedFolders.json. You can change it later with /permissions.
The same gate protects you from a cloned repo that ships its own MCP servers, one of the risks covered in MCP server security.
In CI there is no dialog, and an untrusted workspace exits with a FatalUntrustedWorkspaceError. Pass the flag for one command or set the env var for the whole job.
gemini --skip-trust -p "Open https://storedemo.testdino.com and list the product categories on the home page"
# or, for the whole job:
export GEMINI_CLI_TRUST_WORKSPACE=true

Verify the connection
Once trusted, start a session and run /mcp list. The playwright server should show as connected with its tools underneath.
If it does not, /mcp prints the connection status and any discovery error, and Playwright MCP troubleshooting covers the npx and browser-install failures that come up next.
The core tool set includes browser_navigate, browser_snapshot, browser_click, browser_type, browser_fill_form, browser_take_screenshot, and browser_wait_for. These read the accessibility tree, so the model works from element roles and names, not pixels.
Flags worth adding to the args array
The default server is headed and keeps a persistent browser profile. Both are fine for a first run and wrong for CI. These are the options from the Playwright MCP README that matter for test generation.
| Flag | What it does | Use it when |
|---|---|---|
| --headless | Runs the browser without a window; headed is the default | CI, SSH sessions, containers |
| --isolated | Keeps the profile in memory and discards it on close | Every session should start logged out |
| --storage-state auth.json | Seeds an isolated session with saved cookies and local storage | Reusing a login captured with Playwright |
| --browser firefox | Switches from Chrome to firefox, webkit, or msedge | Cross-browser exploration |
| --caps testing | Adds browser_generate_locator and browser_verify_* tools | You want locators and assertions checked live |
| --viewport-size 1280x720 | Fixes the viewport | Matching your Playwright config |
| --output-dir ./mcp-out | Sets where screenshots and PDFs are saved | Keeping artifacts out of the repo root |
The storage state flag is the one to reach for on apps behind a login. Capture the state once with the approach in Playwright authentication, and the agent starts every exploration already signed in.
A production-friendly config looks like this. The testing capability is the option most guides skip, and it is the difference between a guessed locator and a verified one.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--headless",
"--isolated",
"--caps", "testing",
"--viewport-size", "1280x720"
],
"timeout": 60000
}
}
}
Stop approving every click
By default, Gemini CLI asks before each tool call. That can mean dozens of prompts for one login flow. You have three levers, from broad to precise:
-
Approval mode. --approval-mode auto_edit auto-approves edit tools but still asks for MCP calls.
-
Server trust. --trust on the add command, or "trust": true in the server block, skips confirmation for that server only.
-
A policy rule in your user policies folder, which is the most controlled option.
[[rule]]
mcpName = "playwright"
decision = "allow"
priority = 200
Tip: The docs say to use server trust "cautiously and only for servers you completely control." Playwright MCP runs locally from npm, so trusting it is reasonable. Keep --approval-mode yolo off for anything that touches a real environment, because it approves shell commands too.
With the Playwright server trusted, browser calls run silently while a shell command still stops for a yes. That is the balance you want. The agent can explore freely, but it cannot run npx playwright test or edit a file without you seeing it first.

The browser is connected and the approvals are tamed. The agent still has no idea how your team writes tests, and that is what the next two files fix.
Step 3: teach the agent your rules with skills and GEMINI.md
Connecting MCP gives the model eyes. It does not give it taste. Left alone, Gemini will write CSS selectors, add fixed waits, and share state between tests. Two files fix that: an agent skill pack and a project context file.
Install the Playwright skill pack
Gemini CLI supports the Agent Skills open standard. A skill is a folder with a SKILL.md file. Only its name and description load at session start, so it costs almost no context until the model decides it is relevant and calls activate_skill. You approve once, and the full guide loads into the conversation.
The open-source TestDino Playwright skill packages 79 guides across seven packs: core, qa, frontend, ci, playwright-cli, pom, and migration. It is MIT licensed, and the install is one command.
npx skills add testdino-hq/playwright-skill
The installer drops the pack into .agents/skills, which Gemini CLI reads as a workspace skills folder alongside .gemini/skills. If you prefer Gemini's own installer, point it at the repository and scope it to the workspace. The --consent flag skips the security prompt for non-interactive installs.
gemini skills install https://github.com/testdino-hq/playwright-skill.git --scope workspace --consent
gemini skills list
Inside a session, /skills list confirms what was discovered, and /skills reload picks up a pack you just added without restarting. The same pack works in Claude Code, Cursor, and Antigravity, so the guidance travels with the repo rather than with the tool.

Write a GEMINI.md that states your rules
GEMINI.md is Gemini CLI's context file. The CLI loads the global file from your home directory, then every GEMINI.md it finds in the workspace and its parent directories, concatenates them, and sends the result with every prompt. /memory show prints the merged text so you can check what the model actually sees.
Keep it short and specific. Every line should be a rule the model would otherwise break. This version is a good starting point for an existing Playwright repo.
# Playwright test rules
- Use the Playwright MCP server to inspect the live page before writing any locator.
- Prefer getByRole, getByLabel, getByPlaceholder, and getByText. Never use CSS or XPath.
- Never call page.waitForTimeout(). Use web-first assertions like expect(locator).toBeVisible().
- One user flow per test. No shared state between tests.
- Read baseURL from playwright.config.ts; never hardcode the host in a spec.
- Put new specs in tests/ and name them <feature>.spec.ts.
- After writing a spec, run `npx playwright test <file>` and fix failures before reporting done.
Note: Rules and skills do different jobs. GEMINI.md is a hard constraint sent with every prompt. Skills are reference knowledge loaded on demand. If they conflict, the rules win, so keep GEMINI.md to the handful of lines you would refuse to merge without.
Already keeping an AGENTS.md for other agents? Set context.fileName in settings.json to a list such as AGENTS.md and GEMINI.md, and Gemini CLI reads both. The structure in AGENTS.md for Playwright maps straight onto GEMINI.md.
As the suite grows, Playwright best practices is the source for rules worth adding. Add one line per failure pattern you have actually seen, and nothing speculative.

Browser, skill pack, rules. Now ask for a test.
Step 4: generate, run, and heal your first Playwright test
Point Playwright at the app you want to test. The examples use the demo store, so set it as the base URL once and every generated spec can use relative paths. Then launch gemini in the project and describe the flow the way you would explain it to a new teammate. This is how to use gemini cli with playwright day to day.
use: {
baseURL: 'https://storedemo.testdino.com',
trace: 'on-first-retry',
},
Prompt for a spec, not for a script
The difference between a prompt that works and one that produces junk is whether you ask for verification. Tell the agent to inspect the page first, and tell it what done looks like. More patterns like this are collected in Playwright prompts.
Use the Playwright MCP server to open https://storedemo.testdino.com/products.
Explore the page and take an accessibility snapshot. Then open /cart.
Write tests/store.spec.ts covering: searching for "GoPro" shows the GoPro HERO10 Black
product and hides the others, and the cart page shows "Your cart is empty" with a
Continue Shopping button. Follow GEMINI.md. Run the spec with
npx playwright test tests/store.spec.ts and fix it until it passes.
Gemini calls browser_navigate, then browser_snapshot, then starts typing into the search box. With the testing capability on, it can call browser_generate_locator for the elements it plans to use, so the locators are checked against the real page before they land in the file.
What a good generated spec looks like
The spec below is what Gemini 3 Flash produced from that prompt on the first attempt, with the rules file in place. Every locator is role or placeholder based, and every check is a web-first assertion that waits on its own.
import { test, expect } from '@playwright/test';
test.describe('TestDino demo store', () => {
test('search narrows the catalog to a matching product', async ({ page }) => {
await page.goto('/products');
await page.getByPlaceholder('Search products...').fill('GoPro');
await expect(page.getByRole('heading', { name: 'GoPro HERO10 Black' })).toBeVisible();
await expect(page.getByRole('heading', { name: 'JBL Charge 4 Bluetooth Speaker' })).toBeHidden();
});
test('cart page starts empty', async ({ page }) => {
await page.goto('/cart');
await expect(page.getByRole('heading', { name: 'Your cart is empty' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Continue Shopping' })).toBeVisible();
});
});
If the output uses CSS selectors or a fixed sleep, the fix is not a better prompt. It is a missing rule in GEMINI.md or a skill that did not activate. Check /memory show first. Playwright locators explains why role-based locators survive the UI changes that break CSS.

Run it and let the agent heal failures
Ask the agent to run the spec, or run it yourself. A passing run prints one line per test and a summary count.
npx playwright test tests/store.spec.ts
# ok 1 [chromium] › tests\store.spec.ts:13:7 › TestDino demo store › cart page starts empty (652ms)
# ok 2 [chromium] › tests\store.spec.ts:4:7 › TestDino demo store › search narrows the catalog to a matching product (696ms)
# 2 passed (1.4s)
When Gemini runs the tests itself, it closes the turn with a summary of what it explored, what it wrote, and whether the run passed. Read that summary against your rules file. If it says it guessed a locator instead of reading a snapshot, that is a rule to tighten.
When a test fails, paste the error back and ask for a diagnosis, not a patch. The agent can reopen the page, compare the current snapshot to the failing locator, and tell you whether the UI changed or the test was wrong.

tests/store.spec.ts failed with a timeout on getByRole('heading', { name: 'Your basket is empty' }).
Open https://storedemo.testdino.com/cart with Playwright MCP, snapshot the page, and tell me
whether the heading text changed. Only edit the test if the app is correct.
That last sentence matters. An agent that "fixes" a test around a real bug hides the bug. Playwright's own planner, generator, and healer agents follow the same rule.
Note that npx playwright init-agents currently supports only the vscode, claude, codex, and opencode loops, so with Gemini CLI you drive these steps through prompts.
The repair patterns in fixing Playwright tests with AI apply unchanged here. The agent reads the failure, re-checks the page, and proposes the smallest edit that makes the test honest again.
Tip: Set general.checkpointing.enabled to true in settings.json. Every file-modifying tool call then snapshots your project into a shadow git repo under ~/.gemini/history, and /restore rolls back a bad edit without touching your real history.
Pick the right browser channel for the job
MCP is not the only way to give Gemini CLI a browser. The Playwright CLI README states that CLI invocations "are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees," while MCP "remains relevant for specialized agentic loops that benefit from persistent state, rich introspection."
The trade is visibility. Through the CLI, the model only sees what each command prints.

TestDino measured the gap while building the Cursor guide: roughly 114,000 tokens for an MCP session versus about 27,000 for the same work through the Playwright CLI. The breakdown is in Playwright CLI vs MCP. For Gemini CLI, the practical rule is MCP for exploration and debugging, CLI for long batch generation.
To add the CLI route, install the tool and drop its skill into your Gemini skills folder. Google's own codelab on agentic UI testing uses this exact command, and Playwright CLI covers the commands the skill teaches.
npm install -g @playwright/cli@latest
npx degit microsoft/playwright-cli/skills/playwright-cli ~/.gemini/skills/playwright-cli
Run the whole loop headless in CI
Gemini CLI switches to headless mode whenever you pass -p or run without a TTY. Combine that with JSON output and the trust variable, and you can generate or repair tests as a pipeline step. Exit code 0 means success, 1 is a general error, 42 is an input error, and 53 means the turn limit was hit.
GEMINI_CLI_TRUST_WORKSPACE=true gemini \
--approval-mode auto_edit \
--output-format json \
-p "Run npx playwright test. For each failure, open the page on https://storedemo.testdino.com with Playwright MCP, diagnose the cause, and propose a fix as a diff. Do not edit files."
Demand for this kind of loop is not niche. Monthly downloads of the Playwright MCP package went from 2.22 million in September 2025 to 29.30 million in September 2026, a thirteenfold rise, which is a fair proxy for how many agents now have a browser attached.

Generated tests are only useful if you can see how they behave over weeks, not minutes. That is the last step.
Step 5: track AI-generated tests in TestDino
AI-written tests need more scrutiny than hand-written ones, not less. You want to know which generated specs fail after every deploy, which fail one run in five, and which never fail at all. TestDino gives you that view from a Playwright reporter, with no upload step.
Add the reporter
Install the package and register it next to your existing reporters. Results stream to the dashboard as each test finishes. The reporter needs Playwright 1.52 or newer.
npm install --save-dev @testdino/playwright
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['list'],
['@testdino/playwright', { token: process.env.TESTDINO_TOKEN }],
],
use: { trace: 'on-first-retry' },
});
Create the token under Project Settings and API Keys in the TestDino app, then export it as TESTDINO_TOKEN locally and as a repository secret in CI. Keep tracing on, because the dashboard's embedded trace viewer is where you will debug the agent's failures.
A local run now ends with a run summary box and a link to the live results. There is no upload command to remember, which matters when the agent is the one running the tests. If you would rather not touch the config at all, npx tdpw test wraps the same run.

Wire it into GitHub Actions
The workflow is standard Playwright plus one env var. The same pattern works for GitLab, Azure DevOps, Jenkins, and the other providers in Playwright in GitHub Actions.
name: Playwright Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npx playwright install --with-deps
- name: Run tests with TestDino
env:
TESTDINO_TOKEN: ${{ secrets.TESTDINO_TOKEN }}
run: npx playwright test
Tag the specs Gemini wrote, for example with @ai-generated, so you can compare their flake rate against the hand-written ones. That comparison is the fastest way to learn whether your GEMINI.md rules are working.
The same split is the heart of how to test AI-generated code: treat the agent's output as a candidate, and let run history decide whether it earns a place in the suite.

A run page shows each test's status, duration, and history across runs. Once a generated spec has twenty runs behind it, the flaky column tells you more than any code review could.
That history is also what the agent is missing when it tries to fix a failure on its own, which is where the second MCP server comes in.
Give Gemini CLI your CI history with TestDino MCP
Playwright MCP shows the agent the page as it is right now. It cannot tell the agent that a test has failed on WebKit every Tuesday for a month. The TestDino MCP server fills that gap with 57 tools for runs, failures, flaky tests, and traces. Add it beside the Playwright server.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--headless", "--isolated", "--caps", "testing"]
},
"testdino": {
"command": "npx",
"args": ["-y", "@testdino/mcp@latest"],
"env": { "TESTDINO_PAT": "$TESTDINO_PAT" }
}
}
}
The personal access token comes from User Settings and Personal Access Tokens, and it is different from the project API key the reporter uses. Gemini CLI expands $TESTDINO_PAT from your environment, so the secret never sits in the settings file.
Restart the session, run /mcp list, and ask the agent to run health once to confirm it can see your projects.

[notice_block bg="#FEFCE8" border="#FEF08A" color="#854D0E" icon="https://cms.testdino.com/wp-content/uploads/2026/01/fluent_info-sparkle-48-filled.svg"]Tip: Before you fix flaky tests one at a time, put a number on the problem. TestDino's free tools include a flaky cost calculator that turns debug hours and CI reruns into a yearly dollar figure, and a locator playground for checking getByRole queries before the agent uses them. Both are on TestDino's free tools.[/notice_block]
With both servers connected, one prompt closes the loop: find the flakiest test, open the page, diagnose, and propose a fix.
Use the TestDino MCP tools to list the 3 flakiest tests in the last 20 runs of
the main branch. For the top one, open the failing page on
https://storedemo.testdino.com with Playwright MCP, compare the current
accessibility snapshot to the failing locator, and explain the root cause.
Propose a fix but do not edit the file yet.
The agent's diagnosis will usually match one of the root causes in Playwright flaky tests, and now it arrives with the run history attached.
Now that the full loop works, it is worth asking whether Gemini CLI is the right agent to run it.
Gemini CLI vs Antigravity CLI for Playwright tests
Every tool in this table uses the same Playwright MCP server and the same JSON config block. What differs is who can log in, where the config lives, and how the rules and skills are stored.
| Feature | Gemini CLI | Antigravity CLI | Claude Code | Cursor |
|---|---|---|---|---|
| Interface | Terminal (gemini) | Terminal (agy) | Terminal | IDE |
| Who can use it in 2026 | Paid API keys, Vertex AI, Code Assist Standard and Enterprise | Free, Pro, Ultra, and Google Cloud users | Claude subscribers and API users | Cursor subscribers |
| Playwright MCP config | .gemini/settings.json | .agents/mcp_config.json | claude mcp add | .cursor/mcp.json |
| Rules file | GEMINI.md | GEMINI.md and AGENTS.md | CLAUDE.md | .cursor/rules |
| Skills location | ~/.gemini/skills or .agents/skills | ~/.gemini/antigravity-cli/skills or .agents/skills | .claude/skills | .cursor/skills |
| Open source | Yes, Apache 2.0 |
Moving the setup to Antigravity CLI
If your account was moved on June 18, the Playwright config carries over with two edits. Antigravity CLI reads MCP servers from ~/.gemini/config/mcp_config.json globally or .agents/mcp_config.json in a workspace, and remote servers use serverUrl instead of url or httpUrl. The stdio block for Playwright is unchanged.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--headless", "--isolated", "--caps", "testing"]
}
}
}
GEMINI.md and AGENTS.md are read as they are. Workspace skills move from .gemini/skills to .agents/skills, and agy plugin import gemini converts Gemini CLI extensions into plugins. The installer itself copies skills and MCP configs over when it finds a Gemini CLI directory.
curl -fsSL https://antigravity.google/cli/install.sh | bash
# Windows PowerShell: irm https://antigravity.google/cli/install.ps1 | iex
The full walkthrough for Google's newer tool, including the IDE's built-in browser agent, lives in Playwright tests with Antigravity.
When another agent fits better
Choose Claude Code when you want a multi-agent pipeline with strong file reasoning; Claude Code with Playwright walks through a four-agent setup. Choose Cursor when your team lives in the editor and wants inline generation; Cursor with Playwright covers it.
Choose Gemini CLI when you need an open-source, scriptable agent behind an enterprise license or your own API key, and when you want to pin a version and keep it.
Note: Playwright with Gemini CLI and Playwright with Antigravity CLI produce the same kind of test, because both run the same Playwright MCP server against the same page. The choice is about login, licensing, and scripting, not about test quality.
For a wider survey of the agents in this space, agentic testing tools compared lines up a dozen of them.
Conclusion
Setting up playwright with gemini cli in 2026 comes down to five decisions: an auth path that still serves requests, a Playwright MCP server with headless and testing flags, a trusted folder, a short GEMINI.md, and a reporter that shows how generated tests behave over weeks, not minutes.
The prompting side is covered in more depth in how to write Playwright tests with AI, and it applies to every agent in the comparison table above.
FAQs

Ayush Mania
Forward Development Engineer