Skip to content

LearnTutorials

Make reviewed code changes with Antigravity CLI

Install Google's Antigravity CLI, have its agent plan a code change, review the plan and each edit, then set project rules in about 25 minutes.

By Recaply EditorsIntermediate25 min6 stepsUpdated

A hand holds a magnifying glass over a blank paper scroll with a small wrench drawn on it

What you need

  1. Step 1: Install the CLI

    3 min

    The agy command runs Google's coding agent right in your terminal.

    1. Mac or Linux: run the command below in a terminal.
    2. Windows: in PowerShell, run irm https://antigravity.google/cli/install.ps1 | iex.
    3. Run agy --version to check the install.
    Mac or Linux: run this
    curl -fsSL https://antigravity.google/cli/install.sh | bash

    You should see a version number, with no error.

    The terminal says agy: command not found?

    The install folder isn't on your PATH. Add export PATH="$HOME/.local/bin:$PATH" to ~/.zshrc or ~/.bashrc, then open a new terminal.

  2. Step 2: Start the agent in your project

    3 min

    The folder where you start agy becomes the agent's workspace.

    1. In the terminal, go to your project folder with cd, then run agy.
    2. Sign in with your Google account in the browser window that opens.
    3. Pick a color scheme and a rendering mode, then confirm that you trust the folder.

    You should see the agent's prompt box, with your account email in the header.

    Sign-in fails with secret keyring is locked?

    On a Mac, allow agy in the keychain item's Access Control tab. On Linux, unlock your keyring. Then run agy again.

    Working over SSH? agy prints a link instead. Open it on your own computer, sign in and paste the code back.

  3. Step 3: Ask for a plan first

    5 min

    A plan shows you the agent's approach before it writes any code.

    1. Type /plan, then describe the task in one or two sentences, as below.
    2. Type @ and part of a file name to point the agent at the right file.
    3. Press Enter and wait while it reads your code.
    Your prompt
    /plan Add input checks to [YOUR FORM OR FUNCTION] in @[FILE]. Reject empty and badly formatted values with a clear error message. Add a test for each case. Don't change any other behavior.

    You should see an Implementation Plan in the terminal, and /artifact to review in the status bar.

    The plan touches files you didn't expect?

    Mention the right files with @ and say what is out of scope, such as "Don't edit the database code." Then run /plan again.

    Mentions match loosely: @bkjs can find src/routes/bookmarks.js.

  4. Step 4: Review and approve the plan

    4 min

    This is your checkpoint. Fixing a plan is much easier than undoing code.

    1. Press Ctrl+R to open the artifact picker, then press Enter on the plan to read it.
    2. To change a step, move to its line, press c, type your note and press Esc.
    3. Press y to approve, or n to reject. Then press Esc to send your review to the agent.

    You should see the plan marked approved, and the agent starting on the first task.

    The agent didn't act on your notes?

    Add each note as a line comment, reject the plan with n and press Esc. If it still misses, type the change as a normal message.

  5. Step 5: Check each edit as it lands

    6 min

    In the default mode, the agent shows a diff before each file edit and asks before it runs a command.

    1. Read each diff, then press y to accept it or n to reject it.
    2. For a terminal command, press y to run it, n to decline or e to edit it first.
    3. When the agent stops, type /diff and open Per Turn to see what each turn changed.

    You should see your change and its new tests listed in the diff viewer.

    It asks about every small edit?

    Press Shift+Tab to switch to accept-edits mode. File edits in your project then go through on their own, but commands still ask first.

    /undo rewinds the conversation. To drop file changes, use Git, which is why you committed first.

  6. Step 6: Save rules for every task

    4 min

    The agent reads an AGENTS.md file on every turn, so you stop repeating the same instructions.

    1. In your project's top folder, create a file named AGENTS.md.
    2. Paste the rules below, and change the commands to match your project.
    3. Type /clear to start a new conversation, then give the agent its next task.
    Your rules
    # Project rules
    
    - Before you finish any task, run the tests with `[YOUR TEST COMMAND]` and fix any failures.
    - Run `[YOUR TYPE CHECK COMMAND]` before you say a task is done.
    - Keep changes small. Ask before you add a new dependency.
    - Never open or edit `.env` files or anything that holds keys.

    You should see the agent running your tests at the end of its next task, without being asked.

    The agent skips a rule?

    Check that the file is named AGENTS.md and sits in the folder where you start agy. Subfolders below that folder aren't scanned.

    Never put API keys or tokens in AGENTS.md. It's plain text that gets shared with your repo.

You get

A planned and reviewed code change, plus an `AGENTS.md` file that sets the rules for every task after it

Did this guide work for you?

Sources