Skip to content
AISeeker

Search

Search reports, topics, companies…

CH.05Tutorials
3 min read
Signal strength: 3/5Important
Verified · 6 Sources

From Gemini CLI to Antigravity: setting up agy with rules, permissions and headless runs

Google moved individual Gemini CLI users to Antigravity CLI. Here is how to install agy, migrate your setup, write rules, lock down permissions and script it.

Key figures

Jun 18
Gemini CLI cut-off for individual plans (2026)
20K
Token budget for always-on rules

Since June 18, 2026, Gemini CLI no longer serves free individual accounts or Google AI Pro and Ultra subscribers; Google moved them to Antigravity CLI, a terminal agent invoked as agy that shares rules and plugins with the Antigravity desktop app and IDE. This tutorial covers installing and migrating, writing rules it actually loads, setting a permission policy and scripting it. You need macOS, Linux or Windows, a Google account or Gemini API key, and jq for the script example. Checked against Google's docs in November 2026.

Which tool applies to you

Your accessWhat to use
Personal Google account, Google AI Pro or UltraAntigravity CLI (agy) or the Antigravity app/IDE
Gemini Code Assist Standard or Enterprise licenceGemini CLI remains supported
Paid Gemini API key or Google Cloud's Agent PlatformEither; Gemini CLI still accepts paid keys

Google said skills, hooks, subagents and extensions carry over, though without full parity at launch.

Install and migrate

Install and sign in

bash
curl -fsSL https://antigravity.google/cli/install.sh | bash
agy --version
mkdir agy-demo && cd agy-demo && agy

The first run walks you through browser sign-in, colour scheme, rendering mode and workspace trust. To use an API key instead, export GEMINI_API_KEY before launching. Run agy models to list the model identifiers your plan can use. Availability varies by plan and some models are scheduled for removal, so check before hard-coding one in scripts.

Bring your Gemini CLI setup

If agy finds legacy Gemini CLI configuration, it starts an onboarding checklist and moves your session tokens into the OS keyring. Context files need no changes: GEMINI.md, AGENTS.md and the global ~/.gemini/GEMINI.md are read as before. Extensions need one command:

bash
agy plugin import gemini

That converts extension manifests into native plugins, including their skills, agents, commands and MCP servers. Custom commands become skills. A few paths change, and two of them are manual:

ItemGemini CLIAntigravity CLI
Workspace skills.gemini/skills/.agents/skills/ (rename yourself)
Workspace MCP configinside settings.json.agents/mcp_config.json
Global MCP configinside ~/.gemini/settings.json~/.gemini/config/mcp_config.json
Remote MCP server keyurl / httpUrlserverUrl

Rules and permissions

Write rules it actually loads

Antigravity combines every rule it finds into the prompt. It looks in the workspace folder and each parent up to the repository root for AGENTS.md or GEMINI.md (always on, no frontmatter) and for modular rules in .agents/rules/*.md. Modular rules need a trigger in their frontmatter. A model_decision rule injects only its path and description until the task matches, which keeps context lean:

markdown
---
trigger: model_decision
description: Database migration conventions. Read before creating or editing files in db/migrations.
---

- One migration per pull request; never edit a merged migration.
- Every migration must include a tested down step.

Other triggers are always_on, glob and manual (the CLI does not support manual @-mentions). Two limits matter: rule files are truncated beyond 24,000 bytes, and global plus always-on rules share a 20,000-token budget, after which the largest files are reduced to pointers.

Set a permission policy

Shift+Tab cycles the execution modes default, accept-edits, plan and auto. default asks you to review diffs before file changes, accept-edits auto-approves workspace edits but still checks shell commands, and auto runs edits and sandboxed terminal commands without prompts (it is not offered on business or enterprise accounts). Explicit rules in ~/.gemini/antigravity-cli/settings.json add a fixed policy on top, with deny beating ask and ask beating allow:

json
{
  "permissions": {
    "allow": ["command(git)", "command(regex:npm run (build|lint|test))", "write_file(src/)"],
    "ask": ["read_url(*)"],
    "deny": ["command(sudo)"]
  }
}

Targets can be a prefix, regex:<pattern> or *. Granting write access to a path also grants read access to it.

Headless runs and the IDE

Script it

agy -p sends one prompt, prints the result and exits. Use JSON output in automation and always check the status:

bash
result=$(agy -p "List the TODO comments in src/ as a markdown bullet list." \
  --output-format json --print-timeout 10m)
if [[ "$(echo "$result" | jq -r '.status')" != "SUCCESS" ]]; then
  echo "agy failed: $(echo "$result" | jq -r '.error')" >&2
  exit 1
fi
echo "$result" | jq -r '.response' > todos.md

Pin behaviour with --mode and --model, add --json-schema when you need structured output, and use --continue to resume the last conversation. Authenticate once interactively before using agy in CI; unauthenticated headless runs fail with an authentication error rather than hanging.

When to switch to the app or IDE

Rules and plugins are shared across the CLI, desktop app and IDE. The app is better for parallel work (a session can start in a new git worktree), and the IDE's agent panel (Cmd/Ctrl+L) suits review-heavy edits. The /browser command delegates UI checks and screenshots to a browser subagent.

Pitfalls and next steps

  • Soft denials. A tool call that needs approval in headless mode is denied, but the run still exits 0. Check .status and the output, not just $?.
  • Skip-permissions overrides everything. --dangerously-skip-permissions approves every tool call; prefer scoped allow rules.
  • Nested rules are ignored. Rule files in folders below the workspace are not loaded, and files in subfolders of .agents/rules/ load only if registered in .agents/rules.json.
  • Silent rule drops. A rule with an invalid trigger, such as camelCase alwaysOn, is discarded without warning.
  • Unknown models fail hard. An unrecognised --model returns an error instead of falling back.

Start with agy plugin import gemini and your workspace skills, then add a permission file before trying auto mode on a real repository.

Researched and drafted with AI assistance under editorial review. Report errors to support@aiseeker.dev.

Sources

This report synthesises the sources below. Primary sources are marked.

  1. [1]
    An important update: Transitioning Gemini CLI to Antigravity CLI

    Google for Developers Blog2026.05.19Primary

  2. [2]
    Get started

    Google Antigravity Docs2026.11.28Primary

  3. [3]
    Migrating from Gemini CLI

    Google Antigravity Docs2026.11.28Primary

  4. [4]
    Rules

    Google Antigravity Docs2026.11.28Primary

  5. [5]
    Agent permissions

    Google Antigravity Docs2026.11.28Primary

  6. [6]
    Headless mode

    Google Antigravity Docs2026.11.28Primary

Back to Tutorials →