GEMINI LABJP
CLI — As of Jun 18, Gemini CLI and the Gemini Code Assist IDE extensions stop serving AI Pro/Ultra and free individual users; Antigravity CLI is the successorFLASH — The Gemini 3.5 series begins with 3.5 Flash, built for agents and coding with strength on long-horizon tasksDEEPTHINK — Gemini 3 Deep Think is rolling out to Google AI Ultra as the top reasoning mode for math, science, and logicAPP — The Gemini app gains a Daily Brief, a redesigned interface, the Gemini Omni video model, and a personal agent called Gemini SparkDESIGN — A new design language, Neural Expressive, rebuilds the experience for richer visuals and faster switching between modalitiesULTRA — Google AI Ultra bundles top model access, Deep Research, Veo 3 video, and a 1M-token context windowCLI — As of Jun 18, Gemini CLI and the Gemini Code Assist IDE extensions stop serving AI Pro/Ultra and free individual users; Antigravity CLI is the successorFLASH — The Gemini 3.5 series begins with 3.5 Flash, built for agents and coding with strength on long-horizon tasksDEEPTHINK — Gemini 3 Deep Think is rolling out to Google AI Ultra as the top reasoning mode for math, science, and logicAPP — The Gemini app gains a Daily Brief, a redesigned interface, the Gemini Omni video model, and a personal agent called Gemini SparkDESIGN — A new design language, Neural Expressive, rebuilds the experience for richer visuals and faster switching between modalitiesULTRA — Google AI Ultra bundles top model access, Deep Research, Veo 3 video, and a 1M-token context window
Articles/API / SDK
API / SDK/2026-06-17Intermediate

Moving My Automation Off the Gemini CLI Before the June 18 Shutdown

On June 18, the Gemini CLI stops responding for hosted plans. Here is how I moved unattended scripts that called gemini from the shell over to the google-genai SDK, with structured output, retries, and cost measurement built in.

gemini83gemini-api239automation38migration5python91

Premium Article

Behind the apps I run as an indie developer, several small automation scripts fire every night. One gathers reviews from the App Store and Google Play and classifies them; another summarizes AdMob reports. Many of them leaned on a single shell call: gemini -p "...". That assumption breaks on June 18.

For Google AI Pro / Ultra and Gemini Code Assist, the Gemini CLI stops responding on June 18 and consolidates into the successor Antigravity CLI. The backend agent harness is the same, so for interactive use you simply switch over. Unattended scripts driven from cron are a different story. The moment responses stop coming back, the nightly job fails quietly, night after night.

This article is the migration path I actually took to prevent that silent failure. The short version: instead of swapping one CLI for another, I moved only the automation parts onto the google-genai SDK. I will walk through why, along with what changed before and after.

Start by Taking Inventory of What the CLI Was Doing

The first stumbling block in a migration is not rewriting code. It is that you do not have a full picture of which scripts depend on the CLI. When interactive use and unattended use are tangled together in your head, you cannot prioritize.

So I mechanically surfaced every place that called the CLI.

# Pull gemini calls out of crontab and your script directories
grep -rn -E '(^|[^a-z])gemini( |$)' ~/scripts ~/cron 2>/dev/null
crontab -l | grep -n gemini

Then split the results by whether they run unattended. Interactive, investigative use can move straight to the Antigravity CLI. What you should rewrite first is only what runs from cron or hooks without a human watching. In my case, of six scripts, only three were unattended jobs that needed urgent attention. Just deciding not to touch the rest in a hurry made the whole thing feel far more manageable.

Replace the Shell Call With an SDK Call

The pre-migration implementation was naive: call the CLI from the shell, take standard output, done.

# Before: hand a prompt to the CLI and take the output as-is
RESULT=$(gemini -p "Classify this review text: ${REVIEW_TEXT}")
echo "$RESULT" >> labels.txt

Replace that with a google-genai SDK call. If you are on Python, install the SDK first.

pip install google-genai

Then move the prompt you handed the CLI straight into generate_content.

import os
from google import genai
 
# Read the key from the environment; never hardcode it in the script
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
 
def classify(review_text: str) -> str:
    response = client.models.generate_content(
        model="gemini-2.5-flash",
        contents=f"Classify this review text:\n{review_text}",
    )
    return response.text

At this point behavior is roughly the same as in the CLI days. But stopping here means you also inherit the fragility. The structure you used to pry open with regular expressions on CLI text output is worth rebuilding while you are here. If you trip over SDK-specific errors or initialization, I collected the common snags in errors you hit migrating to the google-genai SDK.

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
You will be able to move automation scripts that embed the Gemini CLI onto the google-genai SDK calmly, before they break on June 18
You will rewrite implementations that just shell out to gemini -p into API code with structured output, retries, and cost measurement
You will get a real-world sense of how cost and latency shift between the CLI and the API, so you can decide how to migrate
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

Gemini 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

API / SDK2026-03-29
Automating Multilingual Translation and Localization with Gemini API
Learn how to automate multilingual translation and app localization using Gemini API. Covers Python implementation, glossary management, batch processing, and quality checks.
API / SDK2026-03-28
Automate Document Summarization and Meeting Notes with Gemini API
Learn how to build an automated document summarization and meeting notes system using the Gemini API and Python. Covers text, PDF, and audio file processing with practical code examples.
API / SDK2026-03-20
Build an AI Data Analysis Agent with Gemini API — Combining Code Execution, Function Calling, and Structured Output
Learn how to build a production-ready AI data analysis agent in Python that combines Gemini API's Code Execution, Function Calling, and Structured Output to automatically analyze CSV/Excel data, generate visualizations, and produce structured reports.
📚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 →