Gemini CLI has a feature that doesn’t get nearly enough attention, and I only recently discovered it. You can completely replace the system prompt with a single environment variable and a markdown file.
That’s it. No configuration files. No complicated setup. No having to use an SDK. Just point GEMINI_SYSTEM_MD at a markdown file and the entire personality and behavior of your CLI session changes.
Why This Matters
System prompts define how an AI assistant behaves. They’re the instructions that run before anything you type. Most CLI tools hide this away or make it difficult to modify, but Gemini CLI makes it trivial.
Want a coding assistant that only writes code and skips the explanations? Create a markdown file with those instructions. Want responses in pirate speak? Same thing. The MCP servers and other resources still load normally, but the baseline behavior is completely under your control.
How to Use It
The basic pattern is straightforward:
export GEMINI_SYSTEM_MD=/path/to/your/prompt.md
gemini
Your markdown file becomes the system prompt. Everything you define in that file shapes how Gemini responds. When you exit the session, the environment variable goes away and you’re back to the default behavior.
The System Agents Extension
I built a Gemini CLI extension to make this easier and provide a collection of ready-made system prompts. Install it through Gemini CLI’s extension system and it drops a bunch of prompt files into the default extensions folder. (If you’re curious about the broader Gemini CLI extension ecosystem, I analyzed what 106 extensions in the first week reveal about developer priorities.)
The collection includes practical agents like:
- Architect - System design and documentation, no code
- Code Generator - Clean, idiomatic code with minimal explanation
- Creative Writer - Poetry, prose, storytelling
And some entertaining ones:
- Pirate - Technically accurate responses in pirate dialect
- Shakespeare - Shakespearean English with dramatic flair
- Yoda - Inverted syntax and wise mentoring
- Cowboy - Old West vernacular for your terminal sessions
- Gen Z - Contemporary internet slang and cultural references
- Comedian - Dad jokes, regardless of what you actually asked
The Pirate agent is particularly amusing when debugging production issues. Nothing quite like hunting down a memory leak while your AI assistant talks about “scurvy memory allocations” and “walking the garbage collector’s plank.” Here’s an actual example (in the gemini-cli repo from Github):
> what does this codebase do?
✦ Ahoy, matey! Shiver me timbers, it seems ye be standin' right on the deck of the grand vessel itself! This here treasure trove of code be the charts and riggin' for
the Gemini CLI.
Let me read the main treasure map, the GEMINI.md scroll, to give ye the official word. Hoist the colors
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ ReadFile GEMINI.md │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ Yarr! As I suspected! This be a TypeScript monorepo that houses the mighty Gemini CLI and all its components.
Here be the lay of the land:
* `packages/cli`: This be the main command-line vessel, the tool ye interact with in yer terminal.
* `packages/core`: The heart of the ship, containin' the core logic and engine that powers the whole operation.
* `packages/vscode-ide-companion`: A trusty spyglass that integrates Gemini right into VS Code for all ye landlubber developers.
* `docs/`: The ship's logs and charts, holdin' all the documentation.
* `integration-tests/`: The cannons we use to blast away bugs and make sure the ship is seaworthy.
* `.github/`: The crow's nest where all the automated workflows for buildin' and testin' are managed.
In short, ye be lookin' at the very source of the magic that lets us talk, savvy? Fair winds to ye as ye explore these arcane runes! Arr
The Technical Details
Each agent is just a markdown file with detailed instructions. The extension philosophy prioritizes technical accuracy over personality, so even the Cowboy agent will give you correct answers about distributed systems through Gemini CLI. It just phrases them differently.
You can create your own agents by dropping markdown files in the installation directory. Define the personality, expertise areas, and communication style you want. The file becomes the prompt.
This is useful for project-specific contexts too. Working on a Rust project? Create a prompt that emphasizes Rust idioms and borrow checker guidance. Doing frontend work? Build one that focuses on accessibility and browser compatibility.
Why This Approach Works
Making system prompts mutable and obvious is good design. You can see exactly what instructions the AI is following. You can modify them. You can experiment.
Most importantly, you can switch contexts quickly. Different tasks need different approaches. Sometimes I want detailed explanations. Sometimes I just need code. The ability to change that behavior with a single environment variable makes Gemini CLI more flexible than traditional CLI tools.
Try It Yourself
The Gemini System Agents extension is available now. The Gemini CLI source code shows how the system prompt mechanism works under the hood. And the Gemini CLI homepage has more information about the tool itself.
Start with one of the existing agents to see how it feels. Then create your own. The barrier to customization is low enough that experimentation is easy.
And if you find yourself explaining technical concepts in pirate speak more often than you expected, that’s normal. It happens to all of us.