Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips & Traps¶
Gemini CLI is extremely useful as it doesn’t requires your favorite IDE to have integration with LLM tools. You can use whichever IDE you like. What you need is just a terminal. Even if you do prefer IDE, Gemini CLI might work better than the VSCode extension “Gemini Code Assist”.
You can do concurrent tasks by opening multiple Gemini CLI (in a multiplexing tool, say Zellij).
The YOLO mode (
gemini --yolo) is strongly discouraged. It is suggested that you leverage Policy Engine to grant permissions for each specific tool.You can pipe output of another command into Gemini. Below is such an example.
git diff --cached | gemini -p "Generate a conventional commits message based on this diff. Output only the message."Gemini CLI allows you run shell commands directly by prefixing it with an exclamation mark (!) similar to IPython.
Use
/helpfor more information on Gemini CLI.Use the comamnd
/vimto toggle on Vim mode. This setsvimMode: truein the file~/.gemini/settings.json.
Manage Prompts¶
Use the command
/initto generateGEMINI.mdin the root directory of your project. This generated fileGEMINI.mdcontains high-level summary about your project, which serves as the context for Geminii CLI. You can polishGEMINI.mdas needed.You can write prompts (even each one-time) in text file and then use
@/path/to/prompt/fileto load it to Gemini CLI. This can make writing prompts easier as you can write prompts in your favorite IDE and can easily polish it as needed.Define custom command for reusable prompts.
Memory Management¶
Saves your effort about historical conversations.
https://
https://
/memory show
/memory reloadGemini Custom Commands vs Skills¶
Skills are preferred to custom commands for a few reasons.
Skill is open standard and is portable to other agents (Claude, Codex, etc).
A custom command can be implemented as a skill.
It’s easier and more flexible to trigger a skill (though mismatch might happen).
Gemini Extensions¶
Gemini supports extensions (similar concepts to Claude Plugins) .
Automation Workflows Based on Gemini CLI¶
Automate tasks with headless mode