Skip to content

Latest commit

 

History

History
103 lines (72 loc) · 6.34 KB

File metadata and controls

103 lines (72 loc) · 6.34 KB

Antigravity (Gemini CLI)

Home antigravity.google (IDE) · Gemini CLI GitHub
Engine name antigravity
CLI command gemini
Instructions file GEMINI.md
Skills directory .agent/skills/

Google Antigravity is an agent-first IDE (VS Code fork). It does not expose its own headless CLI — the terminal counterpart is Gemini CLI, Google’s open-source terminal AI agent that shares the same skills/rules ecosystem.

Install and authenticate:

# Install via npm (requires Node.js 18+)
npm install -g @google/gemini-cli

# Or run without installing
npx @google/gemini-cli

# Authenticate (opens browser sign-in on first run)
gemini

Free-tier access with a personal Google account (Gemini 2.5 Pro, 60 req/min, 1000 req/day). Also supports Google AI Studio or Vertex AI keys for higher limits.

HAL usage:

  • Config: engine.name: "antigravity". Optional: engine.command, engine.model (e.g. gemini-2.5-pro, passed as --model; default: auto), engine.session (false | true | "shared" | "user"; see Session configuration), engine.sessionMsg, and the flags under engine.antigravity (see table below).
  • Invocation: gemini -p <prompt> --output-format stream-json --approval-mode <mode> [--model <m>] [--resume <sessionId>] [--sandbox]
  • Sessions: session: true, "shared", or "user" = per-user (--resume {sessionId}). session: false = stateless. /clear clears the stored session and replies with a static message (no engine call — same as Claude).
  • Streaming: JSONL output with live progress from tool-use events.
  • Project files: GEMINI.md, .agent/skills/.

Antigravity-specific config:

Field Description Default
antigravity.approvalMode Tool approval policy: default, auto_edit, or yolo "yolo"
antigravity.sandbox Run in containerized/seatbelt sandbox false

approvalMode defaults to yolo because HAL runs non-interactively — default and auto_edit would cause hangs or policy denials in headless mode.

Filesystem access and cwd boundary

Not sandboxed by default. sandbox: false is the default, meaning the agent runs with full user-level filesystem access. Combined with approvalMode: yolo (also the default), every tool call is auto-approved with no confirmation prompt. This means the agent can read, write, and delete files anywhere on disk — including outside the project cwd — without any gate.

Why this matters: Gemini CLI is git-aware. It traverses the directory tree upward from cwd to discover GEMINI.md context files in every ancestor (up to the git root), and it knows the repository structure. With no sandbox active and all approvals bypassed, the agent has the same filesystem access as the user who launched HAL. A prompt that asks the agent to "create a file for the project" may result in a file written at the git root rather than in the project subdirectory, just as was observed with Copilot before the path restriction fix.

HAL's mitigation (opt-in): Set engine.antigravity.sandbox: true to pass --sandbox to Gemini CLI. This runs the agent inside a containerized or OS-level seatbelt, restricting filesystem access to the project directory.

engine:
  name: antigravity
  antigravity:
    approvalMode: yolo
    sandbox: true

Prerequisites for sandbox mode: The --sandbox flag requires either Docker (cross-platform) or macOS sandbox tools. If neither is available, Gemini CLI will fail to start. Sandboxed runs are also slightly slower due to container overhead.

If sandbox is not an option: Write an explicit instruction in GEMINI.md telling the agent to confine all file operations to the project cwd. This is a soft guard — it relies on model compliance and is not enforced at the OS level.

engine:
  name: antigravity
  model: gemini-2.5-pro
  antigravity:
    approvalMode: yolo
    sandbox: false

Available models

Last updated: 2026-03-03 — source

HAL uses Gemini CLI (gemini command). The Antigravity IDE offers additional Vertex Model Garden models (Claude, GPT-OSS) in its UI, but these aren't available via gemini --model.

Model Description
auto Auto-selects best model for the task (default)
gemini-3.1-pro-preview Gemini 3.1 Pro — latest, highest reasoning
gemini-3-pro-preview Gemini 3 Pro — strong reasoning, 1M context
gemini-3-flash-preview Gemini 3 Flash — fast reasoning
gemini-2.5-pro Gemini 2.5 Pro — stable production model
gemini-2.5-flash Gemini 2.5 Flash — fast and cost-effective

Instruction files and precedence

Gemini CLI (Antigravity engine) uses GEMINI.md by default as the root instruction file. You can configure AGENTS.md (and other names) via context.fileName in settings.json, e.g. ["AGENTS.md", "CONTEXT.md", "GEMINI.md"], so it can follow the AGENTS.md convention.

Chain of instructions: Yes. Multiple context files are discovered and concatenated (all are merged and sent with every prompt):

  1. Global: ~/.gemini/GEMINI.md (or first matching name from context.fileName).
  2. Project root and ancestors: From the current directory up to the project root (directory containing .git), the CLI looks for the context file (e.g. GEMINI.md or AGENTS.md) in each directory.
  3. Subdirectories: Context files in subdirectories below the cwd are also scanned (respecting .gitignore and .geminiignore) and included.

If both AGENTS.md and GEMINI.md exist: With default config only GEMINI.md is sought. If context.fileName lists both (e.g. ["AGENTS.md", "GEMINI.md"]), the order in the list and the hierarchy above determine which filenames are looked for; each directory can contribute at most one file per name. All found files are concatenated. So in a given directory you typically use one of the names, not both.

See Provide Context with GEMINI.md Files.

← Back to engines index