Skip to content(if available)orjump to list(if available)

Gemini CLI Tips and Tricks for Agentic Coding

cjbarber

Notable re author: “Addy Osmani is an Irish Software Engineer and leader currently working on the Google Chrome web browser and Gemini with Google DeepMind. A developer for 25+ years, he has worked at Google for over thirteen years, focused on making the web low-friction for users and web developers. He is passionate about AI-assisted engineering and developer tools. He previously worked on Fortune 500 sites. Addy is the author of a number of books including Learning JavaScript Design Patterns, Leading Effective Engineering Teams, Stoic Mind and Image Optimization.“

lvl155

Gemini CLI sucks. Just use Opencode if you have to use Gemini. They need to rebuild the CLI just as OAI did with Codex.

agentdrek

YMMV I guess but it's my goto tool; fast and reliable results at least for my use cases

oblio

> To use OpenCode, you’ll need:

> A modern terminal emulator like:

> WezTerm, cross-platform

> Alacritty, cross-platform

> Ghostty, Linux and macOS

> Kitty, Linux and macOS

What's wrong with any terminal? Are those performance gains that important when handling a TUI? :-(

Edit:

Also, I don't see Gemini listed here:

https://opencode.ai/docs/providers/

Only Google Vertex AI (?): https://opencode.ai/docs/providers/#google-vertex-ai

Edit 2:

Ah, Gemini is the model and Google Vertex AI is like AWS Bedrock, it's the Google service actually serving Gemini. I wonder if Gemini can be used from OpenCode when made available through a Google Workspace subscription...

randomsofr

what happened with Codex? Did they rebuild it?

dnw

I too am curious. My daily driver has been Claude Code CLI since April. I just started using Codex CLI and there are lot of gaps--the most annoying being permissions don't seem to stick. I am so used to plan mode in Claude Code CLI and really miss that in Codex.

qsort

The model needs to be trained to use the harness. Sonnet 4.5 and gpt-5.1-codex-max are "weaker" models in abstract, but you can get much more mileage out of them due to post-training.

3578987532688

My tip: Move away from Google to an LLM that doesn't respond with "There was a problem getting a response" 90% of the time.

knollimar

Are we getting billed for these? The billing is so very not transparent.

OsrsNeedsf2P

My experience working in FAANG.. Nobody knows

swyx

we need a Nate Bargatze skit for these quips

mhitza

Would be nice to have an official confirmation. Once token get back to the user those are likely already counted.

Sucks when the LLM goes on a rant only to stop because of hardcoded safeguards, or what I encounter often enough with Copilot: it generates some code, notices it's part of existing public code and cancels the entire response. But that still counts towards my usage.

dingnuts

[dead]

tarruda

I had a terrible first impression with Gemini CLI a few months ago when it was released because of the constant 409 errors.

With Gemini 3 release I decided to give it another go, and now the error changed to: "You've reached the daily limit with this model", even though I have an API key with billing set up. It wouldn't let me even try Gemini 3 and even after switching to Gemini 2.5 it would still throw this error after a few messages.

Google might have the best LLMs, but its agentic coding experience leaves a lot to be desired.

knollimar

I had to make a new API key. My old one got stuck with this error; it's on Google's end. New key resolved immediately.

franze

and then loosing half a day setting up billing - with a limited virtual credit card so you have at least some cost control

jasonsb

All these tips and tricks just to get out-coded by some guy rawdogging Copilot in VS Code.

wg0

Gemini 3 with CLI is relentless if you give it detailed specs and other than API errors, it just is great. I'd still rank Claude models higher but Gemini 3 is good too.

And the GPT-5 Codex has a very somber tone. Responses are very brief.

SamDc73

A lot of times Gemini models will get stuck in a loop of errors in a lot of times it fails to edit/read or other simple function calling

it's really really terrible at agentic stuff

tekacs

Not so much with Gemini 3 Pro (which came out a few days ago)... to the point that the loop detection that they built into gemini-cli (to fight that) almost always over-detects, thinking that Gemini 3 Pro is looping when it in fact isn't. Haven't had it fail at tool calls either.

SamDc73

Tried in V0, it always gets into an infinite loop

will give the CLI another shot

timonoko

Gemini-CLI on Termux does not work anymore. Gemini itself found a way to fix the problem, but I did not totally grok what it was going to do. It insisted my Termux was old and rotten.

Rebelgecko

Make sure you've turned off the "alternate buffer" setting

senotrusov

>this lets you use Gemini 2.5 Pro for free with generous usage limits

Considering that access is limited to the countries on the list [0], I wonder what motivated their choices, especially since many Balkan countries were left out.

[0]: https://developers.google.com/gemini-code-assist/resources/a...

oblio

For Europe it's EU + UK + EFTA plus for some reason, Armenia.

agentifysh

agentic coding seems like its not the top priority but more at capturing the search engine users which is understandable.

still i had high hopes for gemini 3.0 but was let down by the benchmarks i can barely use it in cli however in ai studio its been pretty valuable but not without quirks and bugs

lately it seems like all the agentic coders like claude, codex are starting to converge and differentiated only by latency and overall cli UX and usage.

i would like to use gemini cli more even grok if it was possible to use it like codex

albert_e

A lot it seems to mirror syntax of Claude Code

Integration with Google Docs/Spreadsheets/Drive seems interesting but it seems to be via MCP so nothing exclusive/native to Gemini CLI I presume?

vidarh

There seems to be an awful many "could" and "might" in that part. Given how awfully limited the Gemini integration inside Google Docs is, it's an area that's just made me feel Google is executing really slowly on this.

neural_thing

I've built a document editor that has AI properly integrated - provides feedback in "Track Changes" mode and actually gives good writing advice. If you've been looking for something like this - https://owleditor.com

rgthomas

Nice breakdown. Curious if you’ve explored arbitration layers or safety-bounded execution paths when chaining multiple agentic calls?

I’m noticing more workflows stressing the need for lightweight governance signals between agents.

xbryanx

It would/will be interesting to see this modified to include Antigravity alongside Gemini CLI.