ANTIGRAVITY LABJP
Articles/Integrations
Integrations/2026-03-10Intermediate

A Practical GitHub Workflow in Antigravity — git, gh CLI, and the Agent Together

Combine git and the gh CLI in Antigravity's integrated terminal, and let the agent draft diff summaries and PR bodies. A real workflow, with working commands, from branching through Pull Requests to a pre-review self-check.

github5gh-cligit12integrations20pull-request2antigravity429

Late at night, about to push a small fix to an app I maintain as an indie developer, I hit the same tiny wall every time: the diff was already clear in my head, but turning it into a commit message and a PR body that someone else — including future me — could actually follow always cost a little friction.

Since folding Antigravity into my daily work, that friction has dropped noticeably. The trick isn't to treat "GitHub integration" as a magic button. It's to combine three things by hand in the integrated terminal: git, the gh CLI, and the agent's drafting ability. This article lays out the workflow I actually run, with commands you can copy. Nothing flashy — just a realistic loop for shaving off the small daily frictions.

Three paths to GitHub from Antigravity

Let's name the paths first. Leave this fuzzy — expecting "the AI does everything" — and you'll get let down somewhere along the way.

PathOwnerBest for
Integrated terminal + gitYouclone / branch / commit / push — the committing actions
Integrated terminal + gh CLIYouCreating and listing PRs, reading Actions logs, Issue ops
The agentDrafterSummarizing diffs, drafting commit and PR text, first-pass review notes

My split is simple: anything that changes repository state — commit, push, merge — I type myself, and I hand the writing and the first look at a diff to the agent. Judgment and execution stay human; translation and proofreading go to the AI.

First setup — authenticate with the gh CLI

Open the integrated terminal and get gh working. Browser auth is the quickest and least likely to miss a scope.

# Install gh if you don't have it (macOS example)
brew install gh
 
# Authenticate via the browser. Choosing SSH means no more token prompts later.
gh auth login
# ? What account do you want to log into? GitHub.com
# ? What is your preferred protocol for Git operations? SSH
# ? Authenticate Git with your GitHub credentials? Yes
 
# Confirm it went through
gh auth status

Pick HTTPS and you'll be asked for a token on every push, which wears on you. On a machine you use daily, SSH is the calmer choice. Once auth is in place, you can let gh handle cloning too.

# With gh, org/repo is enough to clone
gh repo clone your-org/your-app
cd your-app

When you want the Antigravity agent to understand a project, the fastest move right after cloning is to ask: "Explain this repository's structure and main entry points in three lines." It reads the README and directory tree and summarizes, which shortens the time it takes to get into an unfamiliar codebase.

Branching — consult the agent on names only

Creating and switching branches is git's job. Typing it yourself is faster than delegating, and it avoids mishaps.

# Pull the latest main, then cut a working branch
git switch main
git pull --ff-only
git switch -c feature/oauth-apple-signin

Only when a name eludes me do I ask the agent: "Here's the change. Give me three branch names that fit the team's conventions." It returns options that respect prefixes like feature/, fix/, and docs/, which keeps naming consistent. The branch itself, though, I still create by hand.

Let the agent draft commits and PR bodies

This is where the daily friction drops the most. Once the diff is staged, have the agent summarize it.

git add -p            # Stage changes in small, intentional chunks
git diff --staged     # Review what's staged

I hand that git diff --staged output to the agent and ask it to "draft a Conventional Commits message from this diff, plus a PR body with a summary, the changes, and test steps." Then I trim the draft into my own words and use it.

# Commit (message is the edited draft)
git commit -m "feat(auth): add Sign in with Apple"
git push -u origin feature/oauth-apple-signin
 
# Create the PR, passing the drafted body as a file
gh pr create \
  --title "feat(auth): add Sign in with Apple" \
  --body-file .git/PR_BODY.md \
  --base main

Passing the draft through --body-file fixes the flow — agent output to file to PR — so you never build a body from scratch. I treat .git/PR_BODY.md as a throwaway scratchpad; being under .git/, it never lands in a commit.

Delegate the pre-review self-check to the AI

Before opening the PR, ask the agent for a first-pass review. It's prep work so your human reviewer can spend their time on design and intent instead.

# Review the whole branch diff as material
git diff main...HEAD

I give that diff to the agent and specify: "List possible bugs, missing edge cases, and gaps in error handling, most-confident first." Constrain it that way and you get comments pointing at specific lines rather than a vague "LGTM." After clearing those, I check CI too.

# List the status of checks tied to this PR
gh pr checks
 
# Request a review
gh pr edit --add-reviewer teammate-handle

The agent's notes are only a first filter; the final call stays with you and your reviewer. Get that backwards and you'll lose time chasing false positives, so I always decide myself whether a comment is safe to dismiss.

Reading GitHub Actions logs

When CI fails, pulling logs from the terminal and handing them to the agent beats clicking through the browser.

# List recent runs
gh run list --limit 5
 
# Fetch logs for the failed run (RUN_ID from the list above)
gh run view <RUN_ID> --log-failed

--log-failed narrows output to just the failed steps, so I paste it straight to the agent and ask for "the likely cause and one thing to try first." It lets you form a hypothesis before a human reads the full, sprawling log.

Common snags

Missing auth scopes: If gh is authenticated but Actions or a specific operation throws a permissions error, your login may lack a scope. Add it with something like gh auth refresh -s workflow.

Mixing SSH and HTTPS: Clone over HTTPS but push over SSH and only your pushes get rejected at auth. Check with git remote -v and unify via git remote set-url origin git@github.com:your-org/your-app.git.

Don't hand the agent too much execution power: Tempting as it is, letting the agent's suggestions drive push or merge can land changes on a branch you didn't intend. State-changing operations, you type yourself — holding that one line turned out to be the safest choice.

If you're curious about setting up a local-LLM development environment alongside this, the practical guide to fine-tuning Gemma 4 on a Mac pairs well and gives you a feel for environment setup around Antigravity.

The next move

Start with just one thing in whatever repo you have open: hand the git diff --staged output to the agent and let it draft the commit message. That's where the payoff is easiest to feel. As it clicks, widen the delegation to PR bodies, then the pre-review check, then Actions logs — it eases into your own rhythm without forcing it.

I'm still tuning this setup myself, but offloading the friction of writing to the AI while keeping judgment and execution in my own hands is, for now, the split that feels best. Thanks for reading.

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 →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

Integrations2026-03-27
Automate GitHub Pull Request Reviews with Antigravity: A Practical Guide
Learn how to automate GitHub Pull Request code reviews using Antigravity's AI agents. From environment setup to workflow design, this step-by-step guide covers everything you need.
Integrations2026-06-28
Where to Start Reading an Unattended Agent's Changes — A Digest for Re-Entry
How do you review the pile of changes an unattended agent left overnight? Not the full diff, not the chat log — a re-entry digest grouped by risk class.
Integrations2026-05-30
Handing Crashlytics Stack Traces to Antigravity — Three Weeks Across Four Apps
Paste a Crashlytics stack trace into Antigravity, let it narrow the cause, and drive the fix to the finish. After three weeks across four wallpaper apps, here is what I learned to delegate and what I kept for myself.
📚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 →