AI

Antigravity CLI Cheat Sheet

The Antigravity CLI is one binary, agy, and it carries Google’s whole agentic coding stack into your terminal. It replaced the hosted Gemini CLI for personal accounts in June 2026, so if you signed in with a free, AI Pro, or AI Ultra account, this is the tool you land on now. This Antigravity CLI cheat sheet is the fast reference: every flag, every slash command, the subcommands, MCP wiring, and the customization files, in one place.

Original content from computingforgeeks.com - post 171560

Setup lives in a separate walkthrough. If agy is not installed yet, start with our full Antigravity CLI install and sign-in guide, then keep this page open while you work. Every command below was run against Antigravity CLI 1.2.4 on Ubuntu 26.04 in September 2026.

Printable Antigravity CLI agy cheat sheet preview
Grab the printable Antigravity CLI cheat sheet

A one-page PDF with every agy command on this page, grouped by task. Free to print and pin above your desk.

Download the PDF cheat sheet

Install the Antigravity CLI

One script per platform. The installer drops a native agy binary into ~/.local/bin, checks a SHA512 checksum before it writes the file, and appends that directory to your shell profile. On later runs agy self-updates in the background from Google’s release channel.

PlatformCommand
Linux / macOScurl -fsSL https://antigravity.google/cli/install.sh | bash
Windows (PowerShell)irm https://antigravity.google/cli/install.ps1 | iex
Windows (CMD)curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmd
Custom directorycurl -fsSL https://antigravity.google/cli/install.sh | bash -s -- --dir /opt/agy
Confirm the buildagy --version

If agy is not found after install, open a fresh shell or add the bin directory to your path yourself: export PATH="$HOME/.local/bin:$PATH". On a CPU without AES-NI the binary exits with an illegal-instruction error, which is why a bare-metal box or a VM with host CPU passthrough is the safe bet.

Terminal showing agy install output and agy --version returning 1.2.4

Sign in and use an API key

Run agy on a desktop and it reads your OS keyring, or opens a browser to sign in the first time. Over SSH it cannot open a browser, so it prints an authorization URL, you sign in on your laptop, and you paste the code back into the terminal.

For CI or a headless box, skip the account and drive agy with a Gemini API key. Set the provider in settings.json, then export the key:

echo '{ "modelProvider": "gemini" }' > ~/.gemini/antigravity-cli/settings.json
export GEMINI_API_KEY="your-api-key"
agy

The header then reads Gemini API key instead of your account email. A couple of environment variables round out the setup:

VariableWhat it does
GEMINI_API_KEYThe key the CLI reads when modelProvider is gemini. It is ignored otherwise.
GOOGLE_GEMINI_BASE_URLSend model calls to a compatible endpoint instead of the default.
EDITORThe external editor agy opens for prompts and artifacts when editor is auto.

With a key in play, /logout does nothing because there is no stored session to clear.

agy command-line flags

Launch the interactive TUI with a plain agy. These flags shape a session at launch, whether you stay interactive or drive it from a script.

FlagWhat it does
--add-dir <path>Add a directory to the workspace. Repeatable.
--agent <name>Pick the agent for this session (see agy agents).
-c, --continueContinue the most recent conversation.
--conversation <id>Resume a specific conversation by ID.
-i, --prompt-interactive "<text>"Run an opening prompt, then stay in the session.
--mode <accept-edits|plan>Set the execution mode for the session.
--model <slug>Reasoning model for the session (see agy models).
--effort <low|medium|high>How hard the model reasons before acting.
--project <id>Use a specific project ID or name.
--new-projectCreate a fresh project for the session.
--sandboxRun with terminal-execution restrictions enabled.
--dangerously-skip-permissionsAuto-approve every tool permission request. Use with care.
--log-file <path>Override where the CLI writes its log.
agy --help output listing command-line flags and available subcommands

Run agy without the TUI (headless mode)

Print mode is where agy earns a spot in CI and shell pipelines. Pass a prompt, read the answer on stdout, and check the exit code. A clean run exits zero. A run that never produced a response exits non-zero with the reason on stderr.

FlagWhat it does
-p, --print, --prompt "<text>"Run a single prompt non-interactively and print the response.
--output-format <text|json|stream-json>Shape of the printed response. Default is text.
--input-format <text|stream-json>Read prompts from stdin. stream-json takes one NDJSON message per line.
--json-schema <string|path>Force structured output against a JSON schema.
--print-timeout <dur>Maximum wait for a response. Default is 5m.
--disable-slash-commandsTurn off slash and skill expansion in print mode.

A one-shot question:

agy -p "In one sentence, what is a git rebase?"

JSON output piped into jq, the pattern you want in a script. The envelope carries conversation_id, status, response, usage, and, when you pass a schema, structured_output:

agy -p "Name three popular version control systems, comma-separated." \
  --output-format json | jq -r '.response'

Structured output enforced against a schema, so the caller never has to parse prose. Read the parsed object from .structured_output:

agy -p "Parse the version string v2.14.3 into major, minor, patch." \
  --output-format json \
  --json-schema '{"type":"object","properties":{"major":{"type":"integer"},"minor":{"type":"integer"},"patch":{"type":"integer"}}}' \
  | jq '.structured_output'

Pin a timeout for a CI step, then branch on the status field:

result=$(agy -p "Summarize the staged diff in two lines." \
  --output-format json --print-timeout 10m)
[ "$(echo "$result" | jq -r '.status')" = "SUCCESS" ] && echo "$result" | jq -r '.response'

Slash commands inside the TUI

Once agy is running, type / to open the command menu, or /help for the full panel. The complete set, with aliases in parentheses:

CommandWhat it does
/add-dir <path>Add a directory to the active workspace.
/agentsOpen the agent manager to switch agents and watch background subagents.
/artifactOpen the artifact review panel.
/boost <task>Run an on-demand multi-agent deep reasoning loop.
/btw <query>Ask a side question in the background without interrupting the main thread.
/clear (/new)Clear the screen and reset the conversation.
/config (/settings)Open the settings editor overlay.
/contextShow context-window usage.
/copyCopy the last agent response to the clipboard.
/creditsView remaining credits and purchase links.
/diffOpen the interactive diff viewer to review and steer edits.
/exit (/quit)Close the session and return to your shell.
/fastFast mode: skip planning for quick actions.
/feedbackOpen the feedback submission panel.
/fork (/branch)Clone the current thread into a parallel session.
/helpOpen the panel of commands and shortcuts.
/hooksReview active pre and post script hooks.
/keybindingsOpen the keyboard shortcut editor.
/logoutSign out and purge cached tokens from the keyring.
/mcpOpen the MCP server manager.
/modelChoose the reasoning model. Persists across sessions.
/open <path>Open a path in your default editor.
/permissionsOpen the tool permissions manager.
/planningPlan-first mode for complex tasks.
/rename <name>Rename the current session thread.
/resume (/switch, /conversation)Open the conversation picker.
/rewind (/undo)Roll history back to an earlier message.
/skillsBrowse loaded local and global skills.
/statuslineCustomize the status bar.
/tasksMonitor and kill background shell tasks.
/teamwork-preview (/teamwork)Launch collaborative multi-agent teams. Paid plans.
/titleToggle terminal window title updates.
/usage (/quota)Show model quota usage.
/voice (/record)Dictate a prompt with your microphone.

Two prompt-box shortcuts are worth memorizing alongside these: type @ to trigger file-path suggestions, and start a line with ! to run a shell command directly.

Keyboard shortcuts

Defaults live in ~/.gemini/antigravity-cli/keybindings.json, and you can remap any of them with /keybindings. The bindings that save the most keystrokes:

KeysAction
EnterSubmit the prompt or the highlighted menu choice.
Shift+Enter / Ctrl+JInsert a newline without submitting.
EscClose a panel, halt a stream, or clear an empty prompt.
Ctrl+CInterrupt the running agent, or exit when idle. Confirms while the agent is working.
Ctrl+DExit when the prompt box is empty.
Ctrl+LClear and redraw the terminal buffer.
Ctrl+OExpand or collapse the tool reasoning output.
Ctrl+ROpen the artifact review panel.
Ctrl+GCompose the prompt in your $EDITOR.
Ctrl+KFast-approve the pending subagent action.
Alt+JJump to the next subagent waiting on you.
Ctrl+A / Ctrl+EMove the cursor to the start or end of the line.
Ctrl+VPaste text or media into the prompt.
TabAccept the highlighted autocomplete option.
Up / Down, PgUp / PgDnMove the selection or scroll the viewport.
y / nApprove or reject a tool or artifact.
F5Start or stop voice dictation.

agy subcommands

Outside the TUI, agy exposes a handful of management subcommands. Run any of them with --help for flags.

SubcommandWhat it does
agy mcp <add|remove|list|enable|disable>Manage MCP server configurations.
agy plugin <list|import|install|uninstall|enable|disable|validate|link>Manage plugins. plugins is an alias.
agy modelsList available models. Needs a signed-in session.
agy agentsList available agents.
agy updateUpdate the CLI to the latest build.
agy changelogShow the changelog and release notes.
agy remote-control <start|status|stop>Manage the remote-control background daemon.
agy mic-serveServe this machine’s microphone to a CLI on another host.
agy install <--dir|--skip-path|--skip-aliases>Configure environment paths and shell settings.

Connect MCP servers

MCP is how agy talks to tools it did not ship with: a filesystem server, a database, an internal API, the GitHub server. Add one with a name and either a command (stdio) or a URL (http). The type is detected from the argument, so an http URL rarely needs --type. Flags must come before the name.

agy mcp add fs npx -y @modelcontextprotocol/server-filesystem /work

An http server that needs an auth header:

agy mcp add --header "Authorization: Bearer TOKEN" api https://example.com/mcp

A stdio server that runs in a container, with an environment variable passed through. The -- stops flag parsing so the container command keeps its own flags:

agy mcp add --env GITHUB_TOKEN=xxx gh -- docker run -i ghcr.io/github/mcp

List what is wired up, then enable, disable, or remove by name. Added servers persist to .agents/mcp_config.json in the workspace, or ~/.gemini/config/mcp_config.json globally, where a remote server uses the serverUrl key with an optional headers block. If you already keep a GitHub server, our GitHub CLI cheat sheet pairs well with it.

CommandWhat it does
agy mcp listShow every configured server with type and status.
agy mcp enable <name>Turn a server on.
agy mcp disable <name>Turn a server off without deleting it.
agy mcp remove <name>Delete the server configuration.
-t, --type <stdio|http>Force the transport when the URL is ambiguous.
-e, --env KEY=valuePass an environment variable. Repeatable.
-H, --header "Key: Value"Add an HTTP header. Repeatable.
agy mcp add and agy mcp list output registering a stdio and an http MCP server

Customize agy: skills, rules, plugins, hooks

The customization system is what turns agy from a general assistant into one that knows your repo. Five types, each a file or folder the agent discovers on its own. Workspace customizations live under .agents/ at the project root and travel with the repo in version control. Global ones live in the CLI home, ~/.gemini/antigravity-cli/, and apply everywhere.

TypeFile or folderUse it for
RulesGEMINI.md, AGENTS.md, .agents/rules/*.md; global ~/.gemini/GEMINI.mdCoding style, API limits, local guidelines.
Skills.agents/skills/<name>.md or .agents/skills/<name>/SKILL.mdMulti-step runbooks. They surface as slash commands.
Plugins~/.gemini/antigravity-cli/plugins/<name>/plugin.jsonBundle skills, agents, rules, hooks, and MCP into one unit.
Hookshooks.json or settings.jsonRun scripts on lifecycle events, like a pre-tool check.
MCP servers.agents/mcp_config.json or ~/.gemini/config/mcp_config.jsonConnect external services and custom tools.

A skill is a markdown file with a name and description in its frontmatter. Registered skills convert automatically into slash commands, so a format-tests skill becomes /format-tests in the prompt box. Global skills go in ~/.gemini/antigravity-cli/skills/ and import into every workspace. A plugin is a namespaced bundle: a required plugin.json plus optional skills/, agents/, rules/, hooks.json, and mcp_config.json. When two customizations share a name, workspace beats global, and global beats the built-ins Google ships. The same skill-and-rule model runs across our other agents too, so the patterns in the Claude Code cheat sheet port over with little friction.

settings.json keys

Config lives in ~/.gemini/antigravity-cli/settings.json. Edit it directly or through /config in the TUI. The CLI writes only the values you change, so a fresh file is nearly empty and every key falls back to its default. The keys you touch most:

KeyDefaultNotes
toolPermissionrequest-reviewAutonomy: request-review, proceed-in-sandbox, always-proceed, strict.
artifactReviewPolicyasks-for-reviewCode review: asks-for-review, agent-decides, always-proceed.
enableTerminalSandboxfalseConfine agent shell commands to an OS sandbox.
allowNonWorkspaceAccessfalseLet file tools reach outside the workspace.
altScreenModedefaultRendering: default (adaptive), always (alt buffer), never (inline).
colorSchemeterminalterminal, dark, light, solarized variants, tokyo night, colorblind variants.
runningLightSpeedmediumProgress animation: fast, medium, slow, off.
verbosityhighhigh shows full thoughts and tools; low stays quiet.
editorautoExternal editor: auto ($EDITOR), vim, emacs.
editorModedefaultPrompt editing: default or vim for modal editing.
notificationsfalseDesktop and terminal bell alerts on completion.
showTipstrueTips above the prompt during a turn.
showFeedbackSurveytrueOccasional quality surveys after a task.
enableTelemetrytrueSet to false to opt out of usage metrics.
useG1CreditsfalseExternal builds only. Spend personal credits past quota.
modelProviderunsetSet to gemini to run on GEMINI_API_KEY instead of an account.

Permission rules

Anything that writes or runs commands sits at Ask by default, which is why a headless run soft-denies shell tools until you grant them. Pre-approve exactly what a pipeline needs with a permissions.allow array in settings.json. Each rule names an action and a target:

{
  "permissions": {
    "allow": [
      "command(git)",
      "command(regex:npm run (build|lint|test))",
      "write_file(src/)",
      "mcp(github/*)"
    ]
  }
}

MCP rules follow the same shape: mcp(server/tool) for one tool, mcp(server/*) for a whole server, mcp(*) for every server. For a single throwaway run, --dangerously-skip-permissions approves everything, but scoped rules are the safer habit.

Coming from the Gemini CLI

Antigravity is the migration path off the hosted Gemini CLI, and it brings your customizations with it. Import existing Gemini extensions and skills as plugins in one command:

agy plugin import gemini

Extensions become plugins, legacy commands become skills, and inline servers move into mcp_config.json. The same importer reads a Claude setup with agy plugin import claude. Your workspace rules in GEMINI.md and AGENTS.md carry over untouched, and global rules stay at ~/.gemini/GEMINI.md. The open-source gemini-cli binary itself is not gone: a paid API key, Vertex AI, or a Code Assist licence keeps it working, so the change only ended the free hosted quota. For the old surface, our Gemini CLI cheat sheet and the guide to set up the Gemini CLI still apply. If you also live in Codex CLI, the flag habits map across cleanly.

Keep agy current

agy moves fast, and the binary self-updates from Google’s release channel. Run agy update to pull the latest build and agy changelog to see what changed before you rely on a new flag. Pin this page, print the PDF, and you have the whole surface in reach: launch flags for interactive work, print mode for scripts, slash commands in the TUI, and the customization files that make the agent yours.

Keep reading

Claude Code Cheat Sheet – Commands, Shortcuts, Tips AI Claude Code Cheat Sheet – Commands, Shortcuts, Tips Ollama Models Cheat Sheet 2026 (gpt-oss, Qwen3-Coder, DeepSeek) AI Ollama Models Cheat Sheet 2026 (gpt-oss, Qwen3-Coder, DeepSeek) GPT-6 Astra: Benchmarks, Pricing and API Access, Tested AI GPT-6 Astra: Benchmarks, Pricing and API Access, Tested Get Started with LanceDB in Python AI Get Started with LanceDB in Python Install and Self-Host Karakeep with Docker AI Install and Self-Host Karakeep with Docker Ollama Commands Cheat Sheet: CLI and API Reference AI Ollama Commands Cheat Sheet: CLI and API Reference

Leave a Comment

Press ESC to close