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.
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.
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 sheetInstall 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.
| Platform | Command |
|---|---|
| Linux / macOS | curl -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 directory | curl -fsSL https://antigravity.google/cli/install.sh | bash -s -- --dir /opt/agy |
| Confirm the build | agy --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.

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:
| Variable | What it does |
|---|---|
GEMINI_API_KEY | The key the CLI reads when modelProvider is gemini. It is ignored otherwise. |
GOOGLE_GEMINI_BASE_URL | Send model calls to a compatible endpoint instead of the default. |
EDITOR | The 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.
| Flag | What it does |
|---|---|
--add-dir <path> | Add a directory to the workspace. Repeatable. |
--agent <name> | Pick the agent for this session (see agy agents). |
-c, --continue | Continue 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-project | Create a fresh project for the session. |
--sandbox | Run with terminal-execution restrictions enabled. |
--dangerously-skip-permissions | Auto-approve every tool permission request. Use with care. |
--log-file <path> | Override where the CLI writes its log. |

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.
| Flag | What 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-commands | Turn 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:
| Command | What it does |
|---|---|
/add-dir <path> | Add a directory to the active workspace. |
/agents | Open the agent manager to switch agents and watch background subagents. |
/artifact | Open 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. |
/context | Show context-window usage. |
/copy | Copy the last agent response to the clipboard. |
/credits | View remaining credits and purchase links. |
/diff | Open the interactive diff viewer to review and steer edits. |
/exit (/quit) | Close the session and return to your shell. |
/fast | Fast mode: skip planning for quick actions. |
/feedback | Open the feedback submission panel. |
/fork (/branch) | Clone the current thread into a parallel session. |
/help | Open the panel of commands and shortcuts. |
/hooks | Review active pre and post script hooks. |
/keybindings | Open the keyboard shortcut editor. |
/logout | Sign out and purge cached tokens from the keyring. |
/mcp | Open the MCP server manager. |
/model | Choose the reasoning model. Persists across sessions. |
/open <path> | Open a path in your default editor. |
/permissions | Open the tool permissions manager. |
/planning | Plan-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. |
/skills | Browse loaded local and global skills. |
/statusline | Customize the status bar. |
/tasks | Monitor and kill background shell tasks. |
/teamwork-preview (/teamwork) | Launch collaborative multi-agent teams. Paid plans. |
/title | Toggle 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:
| Keys | Action |
|---|---|
Enter | Submit the prompt or the highlighted menu choice. |
Shift+Enter / Ctrl+J | Insert a newline without submitting. |
Esc | Close a panel, halt a stream, or clear an empty prompt. |
Ctrl+C | Interrupt the running agent, or exit when idle. Confirms while the agent is working. |
Ctrl+D | Exit when the prompt box is empty. |
Ctrl+L | Clear and redraw the terminal buffer. |
Ctrl+O | Expand or collapse the tool reasoning output. |
Ctrl+R | Open the artifact review panel. |
Ctrl+G | Compose the prompt in your $EDITOR. |
Ctrl+K | Fast-approve the pending subagent action. |
Alt+J | Jump to the next subagent waiting on you. |
Ctrl+A / Ctrl+E | Move the cursor to the start or end of the line. |
Ctrl+V | Paste text or media into the prompt. |
Tab | Accept the highlighted autocomplete option. |
Up / Down, PgUp / PgDn | Move the selection or scroll the viewport. |
y / n | Approve or reject a tool or artifact. |
F5 | Start or stop voice dictation. |
agy subcommands
Outside the TUI, agy exposes a handful of management subcommands. Run any of them with --help for flags.
| Subcommand | What 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 models | List available models. Needs a signed-in session. |
agy agents | List available agents. |
agy update | Update the CLI to the latest build. |
agy changelog | Show the changelog and release notes. |
agy remote-control <start|status|stop> | Manage the remote-control background daemon. |
agy mic-serve | Serve 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.
| Command | What it does |
|---|---|
agy mcp list | Show 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=value | Pass an environment variable. Repeatable. |
-H, --header "Key: Value" | Add an HTTP header. Repeatable. |

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.
| Type | File or folder | Use it for |
|---|---|---|
| Rules | GEMINI.md, AGENTS.md, .agents/rules/*.md; global ~/.gemini/GEMINI.md | Coding style, API limits, local guidelines. |
| Skills | .agents/skills/<name>.md or .agents/skills/<name>/SKILL.md | Multi-step runbooks. They surface as slash commands. |
| Plugins | ~/.gemini/antigravity-cli/plugins/<name>/plugin.json | Bundle skills, agents, rules, hooks, and MCP into one unit. |
| Hooks | hooks.json or settings.json | Run scripts on lifecycle events, like a pre-tool check. |
| MCP servers | .agents/mcp_config.json or ~/.gemini/config/mcp_config.json | Connect 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:
| Key | Default | Notes |
|---|---|---|
toolPermission | request-review | Autonomy: request-review, proceed-in-sandbox, always-proceed, strict. |
artifactReviewPolicy | asks-for-review | Code review: asks-for-review, agent-decides, always-proceed. |
enableTerminalSandbox | false | Confine agent shell commands to an OS sandbox. |
allowNonWorkspaceAccess | false | Let file tools reach outside the workspace. |
altScreenMode | default | Rendering: default (adaptive), always (alt buffer), never (inline). |
colorScheme | terminal | terminal, dark, light, solarized variants, tokyo night, colorblind variants. |
runningLightSpeed | medium | Progress animation: fast, medium, slow, off. |
verbosity | high | high shows full thoughts and tools; low stays quiet. |
editor | auto | External editor: auto ($EDITOR), vim, emacs. |
editorMode | default | Prompt editing: default or vim for modal editing. |
notifications | false | Desktop and terminal bell alerts on completion. |
showTips | true | Tips above the prompt during a turn. |
showFeedbackSurvey | true | Occasional quality surveys after a task. |
enableTelemetry | true | Set to false to opt out of usage metrics. |
useG1Credits | false | External builds only. Spend personal credits past quota. |
modelProvider | unset | Set 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.