
Gemini CLI generated an image for a web app in an early test, but only after the coding agent got stuck and received help with the API documentation. Google’s open-source coding assistant runs in the terminal with a 1-million-token context window and uses Gemini 2.5 Pro by default. Testing by Prompt Engineering shows both what the agent can build and where it still needs intervention.
Free Access Comes With Request Limits
TL;DR Key Takeaways :
- Gemini CLI brings Gemini 2.5 Pro and a 1-million-token context window to the terminal.
- A text-to-image app worked after the agent received an example API payload.
- Loops and an early free-key rate limit exposed reliability and access constraints.
- Conversation compression reduced active history without reducing recorded usage.
Google introduced Gemini CLI as a public preview on June 25, 2025, with free individual access to Gemini 2.5 Pro. The preview allows up to 60 requests per minute and 1,000 requests per day without charge. Users who need more can bring their own API key.
When Gemini CLI starts, you can choose a Google account, a Google work login, a Gemini API key or a Vertex AI API key. You can also put a Gemini API key in an environment file for the tool to load. After setting the key, restart the agent: in the test it found the key and stopped asking for it.
A free AI Studio API key hit rate limits during early access, and the test continued with a paid key. An agent can make many calls to an API endpoint while working through a task, so the free key may run into that constraint even when a request begins as a single prompt.
Tools And Instructions Shape The Agent’s Work
Once authenticated, you can inspect the agent’s capabilities with /tools. Its default tools cover local files as well as online information, and users can add custom tools. The available functions include:
- Folder and file tools for reading folder contents and writing files.
- Text search for finding material in a project.
- Web fetching for retrieving information from a web page.
- Google Search, which the preview uses to ground models with external information from web pages.
For instructions you want the agent to retain, create a gemini.md file, in a similar fashion to Cursor rules. Gemini CLI can add items to memory and remove them as well. It also supports MCP servers that users can configure and ask the agent to interact with, although the new session in the test had none configured.
The /editor command selects a code editor and lets you see file changes as diffs. Windsurf was selected for the test, giving the session an editor in which to inspect changes to the app’s files.
An Image App Needed Help With Its API
The practical task was to build a text-to-image web app that takes a written description and uses the Gemini Flash native image-generation API. The prompt included a documentation link, explicitly asked the agent to use its fetch tool and identified the environment file as the location of the Gemini API key. When supplying documentation links, explicitly request the web tool: the agent sometimes does not pick up links otherwise.
Web fetch was given permission to run automatically on subsequent requests, and the agent also tried Google Search after encountering problems. It chose a NodeJS backend and a simple HTML frontend, then created the project files after permission was granted to execute the relevant commands. A model-related issue prompted it to change its selection to the Gemini 2 Flash generative image-generation model requested for the app.
The agent could inspect terminal problems and fix some of them itself, but it then entered a loop, repeatedly reporting that the server was running. The server was accessible, yet the app initially failed to generate an image. That left a working server without the result the app was built to produce.
A Screenshot Did Not End The Loop
The agent’s multimodal input let it receive a screenshot of the error through a file path. It added logs and tried to restart the server, but looped again, and another image-generation attempt failed. Supplying an example payload from the documentation directly gave it the missing help: it corrected the app and generated an image of a llama wearing sunglasses.
That result came through a back-and-forth rather than a single unattended run. The test also shows why permission to fetch documentation does not remove the need to check the resulting app: the successful image arrived only after the example payload was supplied.
Compression Frees Context Without Erasing Usage
The app-building session used about 700,000 tokens, including cached tokens. Input accounted for about 200,000 tokens and output for about 8,000 tokens, with about 75% of the tokens cached. The /stats command shows token usage and the remaining context, which is useful because usage can be expensive.
For a long session, /compress summarizes the conversation to preserve context space. In the test it reduced the chat history from 35,000 tokens to 550 tokens, while /stats immediately afterward still showed the same usage totals. Compressing the conversation therefore made room in the active history without changing the usage already recorded.
After compression, the agent was asked to add a download button to the app. The button appeared to work, and the downloaded image was opened. The follow-up shows the session continuing after its history had been condensed.
Rumored And Unconfirmed Possibilities
One possible explanation for the image-generation failure is that web fetch missed some payload details in the documentation. The agent’s open-source design could also allow it to be used with other models, although its effectiveness with them remains to be seen. Google is expected to improve the tool further.
We would try the agent on a contained project where the result can be checked, rather than assume a long context window will keep a task on course by itself. The app ultimately generated an image and gained a download button, but repeated loops and the need to supply a payload show why a developer should stay involved. The token totals are also worth watching, particularly when using an API key for a session that may make many calls.
Gemini CLI is a useful alternative to Claude Code for developers who prefer Gemini models, with file tools and multimodal input available from the terminal. Its early reliability issues mean you should be prepared to inspect failures and provide guidance when the agent gets stuck.
More on Gemini:
- Gemini Flash Updates and How to Build a Support Agent
- Gemini 2.5 Flash: Thinking Modes, Costs and Benchmarks
- How to Cut AI Model Costs by 75% with Gemini AI’s Implicit Caching
- Gemini 2.5 Flash Lets Developers Set a Reasoning Budget
Media Credit: Prompt Engineering
Disclosure: Some of our articles include affiliate links. If you buy something through one of these links, Geeky Gadgets may earn an affiliate commission. Learn about our Disclosure Policy.