ANTIGRAVITY LABJP
Articles/Integrations
Integrations/2026-07-01Advanced

Distribution-Path-Agnostic Antigravity CLI Automation: Betting on Both the Consumer and Google Cloud Editions

The 7/1 announcement began offering the Antigravity CLI via the Gemini Enterprise Agent Platform too. Here is a design that abstracts your personal automation to run on either the consumer or Cloud edition, laid out with a wrapper and capability-detection scripts.

Antigravity CLI23automation88abstraction designscheduled runs4Google Cloud3

Premium Article

When Gemini CLI ended consumer availability on 6/18, I hurriedly rewrote several nightly batches. Because the invocation commands were embedded inline, the migration's impact was scattered across the whole script.

With the 7/1 announcement, Antigravity 2.0 and the Antigravity CLI began being offered to Google Cloud customers via the Gemini Enterprise Agent Platform as well. For now the consumer edition on my machine is plenty for indie work, but the fact that distribution now runs through multiple paths cannot be ignored. To avoid the same rut, here is a design that abstracts automation into a form that "runs on the CLI of any path," laid out with the actual scripts.

Why a path-aware design is needed

Even the same Antigravity CLI can carry different surrounding assumptions depending on how you obtained it: how auth is threaded, the default model, how usage limits land, the names of environment variables. Even when the command body is identical, if this periphery differs, a script fails silently the moment it crosses paths.

What hurt about the Gemini CLI shutdown was not the feature disappearing so much as the fact that the invocation details were hardcoded all over the code. Migration should have been "swap one entry point," but in practice it started with grepping every file.

The lesson is simple. Wrap external-tool invocations in a single layer, on the assumption that the path can change. Do that and, when distribution shifts next, you only fix that one layer.

Confine invocation to a single wrapper

First, stop hitting the CLI directly from automation scripts and call it through a thin wrapper. Every per-path difference lives only inside this wrapper.

#!/usr/bin/env bash
# agy-invoke.sh — single entry point for Antigravity CLI invocation
# on any distribution path, upstream scripts call only this wrapper
set -euo pipefail
 
# choose the path via env var; default is the consumer edition
: "${AGY_CHANNEL:=consumer}"   # consumer | gcp
 
case "$AGY_CHANNEL" in
  consumer)
    AGY_BIN="${AGY_BIN:-agy}"
    # consumer auth depends on local login state
    ;;
  gcp)
    AGY_BIN="${AGY_BIN:-agy}"
    # via Gemini Enterprise Agent Platform; state project and authz
    export GOOGLE_CLOUD_PROJECT="${GOOGLE_CLOUD_PROJECT:?required on the gcp path}"
    ;;
  *)
    echo "unknown AGY_CHANNEL: $AGY_CHANNEL" >&2; exit 2 ;;
esac
 
# upstream passes only model and prompt; path details stay hidden
exec "$AGY_BIN" run \
  --model "${AGY_MODEL:-gemini-3.5-flash}" \
  "$@"

Upstream batches call this wrapper only as agy-invoke.sh --prompt "...". To switch paths, you change AGY_CHANNEL alone; individual tasks are untouched. This simple principle — one entry point — is what pays off.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A compatibility-layer design that isolates what can differ between the consumer and Cloud editions
A preflight script that detects CLI capabilities before a run and absorbs path differences
Turning the pain of the Gemini CLI shutdown into preparation so the next migration doesn't repeat it
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Integrations2026-07-19
When an Unresponsive MCP Server Freezes Your Agent: Separate Timeouts for Connect, List, and Call
Antigravity CLI 1.1.3 closed the case where an unresponsive MCP server stalls an agent forever, by adding timeouts to connect, list-tools, and call-tool. This walks through why the three boundaries fail differently, and builds a defensive wrapper with a circuit breaker and failure-only notifications, backed by working code and a week of overnight runs.
Integrations2026-07-19
The One File That Stops Startup: Guarding config.json Integrity Before Scheduled Runs
Antigravity 2.3.1 fixed a bug where an empty or corrupt config.json blocked startup. The symptom was fixed; the causes of corruption still live in your environment. Here is a three-layer guard — validate, snapshot, restore — that runs before a scheduled job, with working code and notes from running it nightly.
Integrations2026-07-18
Turning Silent Auto-Approvals into Allow Rules, One Soft-Deny at a Time
In Antigravity CLI 1.1.3, headless -p stops silently auto-approving confirmation-required tools and instead soft-denies them, printing the required allow-rule name to stderr. This piece uses that output as a discovery source to build least privilege from an empty allow set upward, with a working harness and real numbers from a personal automation.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →