Google Gemini CLI¶
Google Gemini CLI is used as an AI agent that can be used directly in a terminal.
I use the Gemini CLI to help generate bash script files and markdown documents for zensical. It is my preferred coding agent at the moment since I already pay for Google One.
Installation¶
Config path: ~/.gemini/
Config¶
- Generate a key from Google AI Studio.
- Set it as an environment variable in your terminal. Replace
YOUR_API_KEYwith your generated key.
Syntax Files¶
Syntax files are used to customize the iutput from Gemini.
AGENTS.md files can also be used to enable the use of other AI agents.
Enable gemini-cli to use AGENTS.md files.
MCP Servers¶
MCP servers are used to extract information from my homelab.
GitHub MCP Server¶
The GitHub MCP Server can be used to allow Gemini to interact with GitHub repositories.
~/.gemini/settings.json
GITHUB_PERSONAL_ACCESS_TOKEN: This environment variable must be set with your GitHub PAT for thegithubMCP server.
proxmox-mcp-plus¶
The proxmox-mcp-plus can be used to allow Gemini to interact with Proxmox VE.
~/.gemini/settings.json
{
"mcpServers": {
"pve01": {
"command": "${HOME}/.local/share/uv/tools/proxmox-mcp/bin/python",
"args": ["-m", "proxmox_mcp.server"],
"env": {
"PROXMOX_MCP_CONFIG": "${HOME}/git/nicholaswilde/homelab/tools/gemini/pve01.config.json"
}
},
"pve04": {
"command": "${HOME}/.local/share/uv/tools/proxmox-mcp/bin/python",
"args": ["-m", "proxmox_mcp.server"],
"env": {
"PROXMOX_MCP_CONFIG": "${HOME}/git/nicholaswilde/homelab/tools/gemini/pve04.config.json"
}
}
}
}
Build and Load¶
The Docker image for proxmox-mcp-plus needs to be built and loaded manually.
UniFi Network MCP¶
The UniFi Network MCP allows Gemini to interact with UniFi Network controllers.
~/.gemini/settings.json
Tip
To find the UNIFI_SITE value, check the URL in the UniFi GUI. For example, in https://unifi.l.nicholaswilde.io/network/154bj8wf/dashboard, the site ID is 154bj8wf.
AdGuard Home MCP¶
The AdGuard Home MCP allows Gemini to interact with AdGuard Home for DNS management.
~/.gemini/settings.json
Home Assistant MCP¶
The Home Assistant MCP allows Gemini to interact with Home Assistant for IoT device control.
Activation¶
- Add Integration: Go to your Home Assistant instance, navigate to Settings -> Devices & Services, and click Add Integration. Search for "Model Context Protocol" and add it.
- Generate Token: Click on your user profile icon in the bottom left corner of the sidebar. Scroll down to the "Long-Lived Access Tokens" section and click Create Token. Give it a name (e.g., "Gemini MCP") and copy the generated token.
~/.gemini/settings.json
Nanobanana MCP¶
The Nanobanana MCP is used to watch for repository commit updates.
~/.gemini/settings.json
Theme¶
The Catppuccin theme can be used to customize the appearance of the Gemini CLI.
- Download the mocha flavor of the Catppuccin theme.
- Add the
themeproperty to yoursettings.jsonfile.
Usage¶
Once installed and authenticated, start interacting with Gemini from the shell.
Example
Pipe content to the CLI from stdin
UniFi Network MCP
List Models¶
Note
Assuming that your Gemini key is stored in the GEMINI_API_KEY environmental variable and jq is installed.
Code
References¶
- https://github.com/google-gemini/gemini-cli
- https://github.com/github/github-mcp-server/blob/6a57e75d729f9767827bc4f96e80ff9bd8538a46/docs/installation-guides/install-gemini-cli.md
- https://github.com/catppuccin/gemini-cli
- https://github.com/nicholaswilde/proxmox-mcp-plus
- https://github.com/sirkirby/unifi-network-mcp
- https://github.com/fcannizzaro/mcp-adguard-home
- https://github.com/zhongweili/nanobanana-mcp-server