Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Reference for building scripted and programmatic integrations around the Antigravity CLI (`agy`) non-interactive print mode. ALWAYS use when the user wants to call `agy` from another script, server, subprocess, automation pipeline, CI job, or custom agent harness; when they mention `agy -p`, `agy --print`, `--dangerously-skip-permissions`, conversation resume, headless Antigravity usage, or Google-subscription-backed CLI automation. Covers auth reuse, subprocess patterns, workspace scoping, conv
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 199% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 81% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 137% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 123% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 188% | 0% |
Use this skill when the task is not “how do I use the Antigravity TUI manually?”, but rather:
agy from code?”agy conversation programmatically?”agy -p hanging / asking for permissions / printing weird extra output?”This skill is about the CLI subprocess integration path.
agy has two distinct modes:
agyagy -p / agy --printFor programmatic integrations, prefer print mode unless you truly need the live TUI.
The key idea: agy authenticates using the same user’s local Antigravity credentials, so a script can usually reuse the existing Google-backed login without needing a separate API key.
For a one-shot scripted call, start here:
bashagy \ --dangerously-skip-permissions \ --print-timeout 10m \ -p "Summarise the repo and suggest the next 3 actions"
Good defaults for integrations:
--dangerously-skip-permissions if the task may use tools--print-timeout explicitly--modelstdout and stderrThese were verified locally on this machine with agy 1.0.6:
<AGY_BIN>agy --help exposes: --print, --prompt, --dangerously-skip-permissions, --print-timeout, --model, --conversation, --continue, --sandbox, --add-dir, --log-file, --prompt-interactiveagy --help also lists shell subcommands: changelog, help, install, models, plugin, plugins, updateagy models works non-interactively and currently lists:Gemini 3.5 Flash (Medium)Gemini 3.5 Flash (High)Gemini 3.5 Flash (Low)Gemini 3.1 Pro (Low)Gemini 3.1 Pro (High)Claude Sonnet 4.6 (Thinking)Claude Opus 4.6 (Thinking)GPT-OSS 120B (Medium)agy -p "Reply with exactly: AGY_OK" returned clean stdout--conversation <id> and --continue both worked for follow-up turnsbashagy --dangerously-skip-permissions -p "Explain what this directory does"
bashagy --dangerously-skip-permissions --print-timeout 15m -p "Run the tests, explain the failures, and suggest a fix"
bashagy --dangerously-skip-permissions \ --model "Gemini 3.5 Flash (Medium)" \ -p "Summarise the architecture"
bashagy --dangerously-skip-permissions \ --conversation <conversation-id> \ -p "Continue from the previous context and propose the next step"
bashagy --dangerously-skip-permissions --continue -p "What should I do next?"
bashagy -i "Open the repo and inspect the auth flow"
Use -i only when you want to stay interactive after seeding the prompt.
bash#!/usr/bin/env bash set -euo pipefail export PATH="/path/to/agy/bin:$PATH" PROMPT="Summarise the purpose of this repository in 5 bullets." OUTPUT=$(agy --dangerously-skip-permissions --print-timeout 5m -p "$PROMPT") printf '%s\n' "$OUTPUT"
javascriptimport { spawn } from "node:child_process"; function runAgy({ prompt, cwd, model, conversationId, useContinue = false, timeout = "10m" }) { return new Promise((resolve, reject) => { const args = ["--dangerously-skip-permissions", "--print-timeout", timeout]; if (model) args.push("--model", model); if (conversationId) args.push("--conversation", conversationId); if (useContinue) args.push("--continue"); args.push("-p", prompt); const proc = spawn("agy", args, { cwd, env: process.env, stdio: ["ignore", "pipe", "pipe"], }); let stdout = ""; let stderr = ""; proc.stdout.on("data", (d) => { stdout += d.toString(); }); proc.stderr.on("data", (d) => { stderr += d.toString(); }); proc.on("error", reject); proc.on("close", (code) => { if (code === 0) { resolve({ stdout, stderr }); } else { reject(new Error(`agy exited ${code}\nSTDERR:\n${stderr}\nSTDOUT:\n${stdout}`)); } }); }); }
pythonimport subprocess def run_agy(prompt, cwd, model=None, conversation_id=None, use_continue=False, timeout="10m"): cmd = [ "agy", "--dangerously-skip-permissions", "--print-timeout", timeout, ] if model: cmd += ["--model", model] if conversation_id: cmd += ["--conversation", conversation_id] if use_continue: cmd += ["--continue"] cmd += ["-p", prompt] return subprocess.run( cmd, cwd=cwd, capture_output=True, text=True, check=True, )
For scripted usage, agy usually reuses the current user’s local login state.
Relevant files/locations:
~/.gemini/settings.json~/.gemini/antigravity-cli/~/.gemini/antigravity-cli/settings.json~/.gemini/antigravity-cli/keybindings.json~/.gemini/oauth_creds.json~/.gemini/antigravity-cli/antigravity-oauth-token~/.gemini/antigravity-cli/log/cli-*.logDo not print or expose credential file contents in logs, user-facing traces, or telemetry.
Practical guidance:
agy may attempt browser-based sign-in.Antigravity scopes work to the launch directory and workspace context.
For integrations, always set cwd intentionally.
Why this matters:
If the integration needs more than one directory in scope, add extra roots with repeated --add-dir flags.
Example:
bashagy --dangerously-skip-permissions \ --add-dir /repo/backend \ --add-dir /repo/shared \ -p "Check the backend and shared package for duplicated types"
agy exposes two follow-up mechanisms:
--conversation <id> — resume a specific conversation--continue / -c — continue the most recent conversationLocally, Antigravity stores conversations under:
text~/.gemini/antigravity-cli/conversations/
Observed local format: one SQLite DB per conversation, with filenames like:
text24342cb9-f218-4788-b349-5acde3c5df33.db
That UUID is usable as the --conversation value.
In local testing on agy 1.0.6, resuming with --conversation or --continue caused stdout to include earlier assistant final replies before the newest one. Treat this as an observed behaviour, not a documented stable contract.
Example shape observed:
textPREVIOUS_REPLY PREVIOUS_REPLY_2 NEWEST_REPLY
So if you are building a multi-turn wrapper:
Example prompt pattern:
textReturn your final answer only inside: <AGY_FINAL> ... </AGY_FINAL>
Then parse the last tagged block from stdout.
There is no verified JSON event stream documented for agy -p yet. In practice, an integration may need to:
~/.gemini/antigravity-cli/conversations/ before the callagy -p ...*.db file afterwardTreat this as a pragmatic filesystem-based workaround, not a guaranteed formal API.
--dangerously-skip-permissions mattersWithout it, headless runs can stall when the agent wants approval for:
For automation, this flag is often necessary.
It effectively auto-approves tool actions. Only use it when:
The docs present --sandbox as a way to restrict terminal execution, but public issue tracker research found an open issue showing that combining:
bash--sandbox --dangerously-skip-permissions
may undermine sandbox guarantees by auto-approving sandbox bypass prompts.
As of June 2026, treat this combination as not a strong security boundary unless you have independently verified the behaviour in your exact environment/version.
If you need real isolation, prefer external containment such as:
Public issue tracker research shows at least one open 1.0.6 bug report for agy -p hanging in some non-TTY headless environments, especially Windows / redirected subprocess scenarios.
Local Linux testing here did succeed for:
agy -p--conversationSo the right guidance is:
--print-timeoutA robust wrapper should enforce both:
agy --print-timeout ...List models dynamically with:
bashagy models
Do not hardcode the full model catalogue forever; it can change.
If the integration accepts a model name from a user, either:
agy models, oragy models check.When scripted runs fail, inspect:
stderr from the subprocess~/.gemini/antigravity-cli/log/cli-*.logUseful commands:
bashagy --version agy --help agy models agy plugin list ls -lt ~/.gemini/antigravity-cli/log/cli-*.log | head
If you need per-run logfile isolation, pass --log-file /absolute/path/to/agy.log and archive that alongside stdout/stderr in your wrapper.
Useful things to read:
~/.gemini/settings.json~/.gemini/antigravity-cli/settings.json~/.gemini/antigravity-cli/keybindings.jsonLook for signs of:
Programmatic wrappers may also need these shell-level commands:
agy helpagy plugin listagy plugins (alias surface)agy plugin install <target>agy plugin enable <name>agy plugin disable <name>agy plugin validate [path]agy updateagy changelogagy install --helpThis is still all shell CLI surface, not an HTTP API.
If you are designing a reusable integration layer, prefer this policy:
agy --versionagy -p smoke testcwd explicitly--print-timeout explicitly--dangerously-skip-permissions only when neededbashagy -p "Reply with exactly: OK"
bashagy --dangerously-skip-permissions -p "List the files in the current directory and summarise what kind of project this is"
bashagy --dangerously-skip-permissions -p "Reply with exactly: TURN1" # detect newest conversation ID agy --dangerously-skip-permissions --conversation <id> -p "Reply with exactly: TURN2"
Check whether the second stdout contains only TURN2 or accumulated prior replies too.
When the user wants a custom integration, the default recommendation is:
agy has a programmatic path via -p / --printIf the user needs a more durable machine interface than subprocess wrapping, say so plainly.
Before concluding an integration design is sound, verify all of these:
agy --version worksagy models worksagy -p call workscwd is correct--add-dir--log-file behaviour is tested if you rely on custom run logs--sandbox + --dangerously-skip-permissionsIf you need to inspect behaviour rather than guess, run the real command and look at the latest files in ~/.gemini/antigravity-cli/.
Other measured skills in the registry, with their headline benchmark lift.