ANTIGRAVITY LABJP
Articles/Tips & Best Practices
Tips & Best Practices/2026-06-16Advanced

Measuring the Go-Based Antigravity CLI's Responsiveness to Rethink My Nightly Batch

The Antigravity CLI was reimplemented in Go, and startup and first-response feel different now. I measure startup, time-to-first-token, and throughput as three separate intervals, then use those numbers to move my nightly batch from serial to parallel.

antigravity362cli3automation47benchmark3tips34

Premium Article

On June 18, the Gemini CLI and the Gemini Code Assist IDE extension stop serving individual users, with the successor Antigravity CLI taking over. I run automated posting for several sites in a nightly batch as an indie developer, so I swapped in the new CLI a little ahead of the deadline to try the destination out.

The first thing I noticed after swapping was that startup was clearly faster. The Antigravity CLI has been reimplemented in Go. The old Gemini CLI was Node-based, so the time it takes for the process to spin up is fundamentally different. But changing how I structure a batch based on "it feels faster" is risky, so I decided to put numbers on it first. This article is that measurement, and how I rebuilt the nightly batch once I had the numbers.

Before You Argue About "Fast" or "Slow," Split It Into Three Times

When a CLI feels slow inside automation, the cause usually falls into one of three buckets. If you collapse them into a single number, you'll reach for the wrong fix.

  • Startup (cold start): from launching the process until config loading and auth initialization finish. The time between issuing the command and the process being "ready."
  • Time to first token: from sending the request until the model's first output starts coming back. This is where the network and the model-side queue come into play.
  • Throughput: from the first token until the response completes. The longer the output, the more this dominates.

Whether the slowness you felt in your nightly batch was startup or throughput completely changes the fix. If startup is heavy, you should reduce the number of calls (i.e., batch them); if throughput is heavy, you should chunk the output shorter or run things in parallel. Looking only at total time, without splitting the intervals, makes that decision impossible.

Benchmark With Headless Execution

The Antigravity CLI offers non-interactive (headless) execution: you pass the prompt as an argument and the result streams to stdout. That's the foundation for benchmarking. Measuring in interactive mode is unreliable because the presence or absence of a TTY changes how output is emitted, so always measure non-interactively.

First, prepare a minimal command that measures startup alone. A subcommand that returns immediately, like --version, gives you the "launch plus exit" time with no real work, which is your cold-start indicator.

#!/usr/bin/env bash
# bench_startup.sh — measure startup only N times and report the median
# Using --version, which does no real work, isolates cold start
set -euo pipefail
 
CMD="${1:-antigravity}"   # pass "gemini" as the arg to compare with the old CLI
N="${2:-20}"
 
times=()
for i in $(seq 1 "$N"); do
  start=$(date +%s.%N)
  "$CMD" --version >/dev/null 2>&1
  end=$(date +%s.%N)
  times+=("$(echo "$end - $start" | bc)")
done
 
# Report the median (robust to outliers); the mean is skewed by warmup
printf '%s\n' "${times[@]}" | sort -n | awk '
  { a[NR]=$1 }
  END {
    if (NR % 2) print "median:", a[(NR+1)/2];
    else        print "median:", (a[NR/2] + a[NR/2+1]) / 2;
    print "min:", a[1], "max:", a[NR];
  }'

There's a reason I report the median rather than the mean. The first few runs tend to be slow because of file caching and network connection setup, and the mean is heavily pulled by that. What you want to know when designing a batch is "how many seconds does it usually take to spin up," so the outlier-resistant median is more useful for the decision.

Next, measure first response and throughput separately. If the CLI streams its response, recording the moment the first byte reaches stdout gives you the boundary between first response and throughput.

#!/usr/bin/env bash
# bench_response.sh — measure first response and throughput separately
# Split the intervals at the moment the first line hits stdout
set -euo pipefail
 
CMD="${1:-antigravity}"
PROMPT="${2:-Write about 200 characters of dummy text for benchmarking.}"
 
start=$(date +%s.%N)
first_token=""
 
# run --print is assumed to run the prompt non-interactively and stream to stdout
"$CMD" run --print "$PROMPT" 2>/dev/null | while IFS= read -r line; do
  if [ -z "$first_token" ]; then
    first_token=$(date +%s.%N)
    echo "ttft: $(echo "$first_token - $start" | bc)s"
  fi
done
 
end=$(date +%s.%N)
echo "total: $(echo "$end - $start" | bc)s"

The key here is stamping the time the instant the first line arrives, inside while read. If you write it to collect all output at the end, you miss the first-response timestamp even when streaming is happening. The CLI's subcommand names (run --print and so on) change between versions, so check your local antigravity --help for the actual non-interactive option and adjust.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
If you've been running nightly batches on the old Gemini CLI without knowing where the slowness actually was, you'll be able to measure startup, first response, and throughput as three separate intervals.
You'll take home a reproducible benchmark harness built on headless execution that you can drop straight into your own automation.
You'll be able to decide whether to keep things serial or stagger them in parallel based on real numbers, not a hunch.
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
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 →

Related Articles

Tips2026-06-14
Turning 'the Antigravity CLI feels faster' into a number with hyperfine
The Go-based Antigravity CLI feels snappier to start. Here is how to turn that impression into a reproducible number with hyperfine: warm vs cold runs, cumulative cost in automation, and a CI gate that catches regressions.
Tips2026-06-13
A Week of Coding Hands-Free with Antigravity 2.0's Live Voice Transcription
Antigravity 2.0 added Gemini Audio-based live transcription right inside the editor. After a week of using it in real work, here's an honest take on how it differs from external dictation tools, how it handles technical terms, and where it actually earns its place.
Tips2026-05-27
Fixing Japanese Mojibake (Garbled Text) in Antigravity's Integrated Terminal
When git log, npm errors, or filenames containing Japanese characters turn into gibberish like 譁?ュ怜喧縺 in Antigravity's integrated terminal, the fix usually takes one or two lines per platform. Here are the Windows, macOS, and WSL2 patterns I keep running into.
📚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 →