Preface
Recently, Google announced the integration of Gemini into the Chrome browser, which sparked the idea of switching back to Chrome from the Arc browser. However, I’ve grown very fond of Arc’s vertical tab and bookmark management system. So, I decided to roll up my sleeves and build a Chrome extension with similar functionality.
This article shares my journey of creating an Arc-style Chrome extension from scratch using Google’s newly released Gemini CLI. I’ll document the development process, the challenges I faced, and my practical thoughts on AI development tools like Gemini CLI.
Developing a Chrome Extension with Gemini CLI
The power of Gemini CLI is truly impressive. It doesn’t just help with writing code; it also handles version control, automatically generates commit messages, and more. Developers can guide Gemini to understand the project’s architecture, coding style, and development conventions through a GEMINI.md file in the project’s root directory.
However, I did encounter a few challenges along the way.
Development Challenge: Stability of Code Modifications
When tackling more complex tasks, I noticed that Gemini CLI, while using str_replace to modify code, would occasionally make mistakes or even get stuck in an infinite loop of fixing and re-introducing errors.
The best way to overcome this is to break down large modifications into several smaller steps and ensure that each commit is as granular as possible. This approach not only aligns with good development practices but also allows you to ask the AI to squash commits and tidy up the messages when needed.
Development Challenge: Context Management and Suggestions
Another issue, related to the first, is that when Gemini CLI gets stuck in an infinite loop, the current conversation session can easily get derailed, leading to irrelevant responses. In these moments, using the /clear command to reset the context is crucial.
I also observed that when the context usage reaches around 75%-80%, the quality of the AI’s responses can decline. So, having /clear at the ready is a must. To help Gemini get back up to speed quickly after a context reset, I’ve made it a habit to ask the AI to check if the GEMINI.md file needs updating after every code change.
Keeping GEMINI.md up-to-date is key to ensuring Gemini operates at peak efficiency.
Overall, AI development tools like Gemini CLI can significantly boost productivity, making it much easier for engineers to work on side projects or proofs of concept (POCs).
Conclusion
With AI tools like Gemini CLI, my development efficiency has seen a massive improvement. The time I’ve saved can now be spent on more valuable things, like spending time with family or researching investments.
While AI-assisted development (or “Vibe Coding”) still carries the risk of going off the rails, as long as developers remain sufficiently cautious and detail-oriented, most of the silly mistakes can be avoided. I look forward to seeing how AI technology continues to evolve and bring even more possibilities to the world of development.