Stream of Consciousness

Mark Eschbach's random writings on various topics.

Gemini CLI -- First look

Categories: tech

Tags: gemini cli ai llm generative-ai developer-tools

I started playing with gemini-cli after listening to t3’s Theo video on it and another engineer advocating for the tools usage as a time-saving tool. To be fully transparent, I’ve already been extensively using JetBrains’ AI features for development, particularly for automating tedious and straightforward tasks. Loving the idea of having something like GEMINI.md which describes the context instead of needing to tell the AI to pull in a project file every time seems like a boost.

In full disclosure I have not used Claude’s tooling outside of JetBrains. So this is really my first time playing with this kind of stuff.

Getting Setup

Project documentation is fairly straightforward on installation. I installed it via npx https://github.com/google-gemini/gemini-cli. I’m considering checking if brew offers a package to ensure it stays updated.

Teething Pains

The tool doesn’t feel like a polished release yet. It lacks reasonable default configurations, requiring effort to get it operational.

Sandbox Configuration

Upon loading the CLI I was quickly confronted with no sandbox message. Documentation stated setting sandbox: true in a settings.json file would enable this. By default, it would use a seatbelt method in MacOS when enabled. Which is amusingly deprecated. This was not slurped up.

settings.json must be located precisely at .gemini/settings.json from where the gemini command located. Picking up changes requires a restart which is probably fair. I could not find a great link for this.

Context Management

I was initially thinking it would be really cool to have a personal repository of knowledge. Like with private info so I can query and such. Something like Joplin with MCP or something. Figured best place to start is this knowledge base since it probably contains a decent fraction of bespoke details I have probably forgotten.

Any content specified in the context fields of settings.json is loaded upon startup. Better to stick to GEMINI.md.

Quota Issues

A significant hurdle was repeatedly encountering a gemini-2.5-pro daily quota limit error. Attempts to switch to gemini-2.5-flash for the session were unsuccessful, leading to a complete failure that necessitated exiting and restarting the tool. Despite the tool erroneously reporting “100% context left,” it became stuck in a loop. Upon restart, the tool seemed to forget the quota limit had been hit and reverted to gemini-2.5-pro.

Finally, a query to “find the a link t3’s theo youtube video on gemini-cli” was identified as the trigger for the gemini-2.5-pro overflow. It took four attempts for this query to return a result. The solution ultimately involved restarting Gemini, allowing it to initially default to gemini-2.5-pro (which failed), then observing its automatic fallback to gemini-2.5-flash before reissuing the query. Notably, the tool does not automatically re-issue failed queries.

Definitely a powerful tool with some rough edges there.

Compression Behavior

Using the /compress command also presented an unexpected issue, as it resulted in additional tokens being consumed for the entire chat history, as evidenced by the output:

╭───────────────╮
│  > /compress  │
╰───────────────╯

✦ Chat history compressed from 3277 to 6926 tokens.

I think I misunderstood something about this command.

Project oriented

So I used it to put together this post. Creation was relatively interesting with a REPL-like interface for bootstrapping the GEMINI.md file. It was able to use my plain language to create a new post skeleton. Although it struggled when I tried to converse about tags.

When tasked with converting bullet points into prose, the tool exhibited a tendency to ’talk itself up.’ Similarly, when prompted for suggested edits, its responses were notably self-congratulatory.

Reformatting

I tasked the model with reformatting this file to a 120-character line limit. Initially, the LLM reformatted the text to 80-90 characters per line. Upon correction, it adjusted to 115-125 characters, respecting word wrap. However, it then entered a loop of repeated reformatting attempts and apologies. Eventually I had to stop it and fix the file by hand.

Closing thoughts

While Gemini CLI currently has some rough edges in setup and usage, it shows significant promise as a powerful tool for the future. I’m excited to see its development and if Google will continue to provide generous tokens from the flash models for continued experimentation.

For JetBrains’ AI features, I’m considering using a context.md file for project-specific instructions, or perhaps adopting the GEMINI.md concept for this purpose.

As a base model, it handles markdown reasonably well, provided reformatting tasks are avoided. I wonder if there is an MCP which would allow for better editing.