Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips & Traps

  1. 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”.

  2. You can do concurrent tasks by opening multiple Gemini CLI (in a multiplexing tool, say Zellij).

  3. The YOLO mode (gemini --yolo) is strongly discouraged. It is suggested that you leverage Policy Engine to grant permissions for each specific tool.

  4. 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."
  5. Gemini CLI allows you run shell commands directly by prefixing it with an exclamation mark (!) similar to IPython.

  6. Use /help for more information on Gemini CLI.

  7. Use the comamnd /vim to toggle on Vim mode. This sets vimMode: true in the file ~/.gemini/settings.json.

Manage Prompts

  1. Use the command /init to generate GEMINI.md in the root directory of your project. This generated file GEMINI.md contains high-level summary about your project, which serves as the context for Geminii CLI. You can polish GEMINI.md as needed.

  2. You can write prompts (even each one-time) in text file and then use @/path/to/prompt/file to 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.

  3. Define custom command for reusable prompts.

Memory Management

Saves your effort about historical conversations.

https://geminicli.com/docs/cli/tutorials/memory-management/

https://geminicli.com/docs/cli/tutorials/memory-management/#scenario-saving-a-memory

/memory show
/memory reload

Gemini Custom Commands vs Skills

Skills are preferred to custom commands for a few reasons.

  1. Skill is open standard and is portable to other agents (Claude, Codex, etc).

  2. A custom command can be implemented as a skill.

  3. 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

References