← All Guides

Coding Agent Guide

Hermes Agent + Gemini CLI: Running Google’s Terminal Agent Alongside Hermes

Gemini CLI is Google’s open-source coding agent for the terminal. Hermes Agent is an always-on agent that lives in your chat apps. They fit together in two directions: Hermes can hand coding jobs to Gemini CLI, and Gemini CLI can reach your Hermes messaging channels over MCP. This guide shows both, based on the current upstream docs of each project.

Which page do you need?

Three topics share the word “Gemini” and are easy to mix up:

  • Gemini models as Hermes’s brain — Hermes calls the Gemini API directly. See Hermes Agent + Gemini.
  • Gemini CLI as a product — how Google’s terminal agent compares with a managed agent platform. See OpenClaw Launch vs Gemini CLI.
  • Gemini CLI working with Hermes — this page.

What Gemini CLI is

Gemini CLI is an Apache 2.0 terminal agent from Google. It reads and edits files, runs shell commands, fetches web pages, grounds answers with Google Search, loads project instructions from GEMINI.md, and connects to MCP servers. It is built for a developer sitting in a repo, one session at a time.

Hermes Agent solves a different problem. It runs as a long-lived gateway connected to Telegram, Discord, Slack and other platforms, with memory, skills, cron jobs and a model of your choosing. So the useful question is not which one to pick, but which job each one should own.

Install and sign in to Gemini CLI

From the upstream README, any one of these installs it:

npx @google/gemini-cli              # run without installing
npm install -g @google/gemini-cli   # global install
brew install gemini-cli             # macOS / Linux

Then pick one of three auth methods:

MethodHowNotes
Sign in with GoogleRun gemini and choose Sign in with GoogleBrowser login. Free tier listed at 60 requests/min and 1,000/day for personal accounts. Org Code Assist licences also need GOOGLE_CLOUD_PROJECT.
Gemini API keyexport GEMINI_API_KEY="..."Key from Google AI Studio; usage-based billing past the free tier.
Vertex AIGOOGLE_API_KEY plus GOOGLE_GENAI_USE_VERTEXAI=trueFor Google Cloud projects.

The browser login is interactive, so do it once by hand before any agent tries to call Gemini CLI. On a headless server, the API-key route is the practical one.

Direction 1: Hermes delegates coding to Gemini CLI

Hermes has a terminal tool, and Gemini CLI has a non-interactive mode. Together that is enough for Hermes to hand off a coding task and read back the result:

gemini -p "Explain the architecture of this codebase"
gemini -p "Summarise the failing tests" --output-format json
cat notes.md | gemini -p "Turn these notes into a README section"
gemini -m gemini-2.5-flash -p "Quick lint pass on src/"

Useful details from upstream:

  • -p / --prompt runs one prompt and exits. A bare positional prompt starts interactive mode instead, which an agent cannot drive cleanly.
  • --output-format json gives one structured result; stream-json emits newline-delimited events for long jobs.
  • --approval-mode takes default, auto_edit, yolo or plan. Without approval, file edits and shell calls stop for a prompt nobody is there to answer, so an unattended run usually needs auto_edit or yolo. Give that power only inside a disposable checkout or a sandbox.

Upstream Hermes ships delegation skills for Claude Code, Codex and OpenCode, but not for Gemini CLI. The Codex skill is a good template: it runs the CLI through terminal with pty=true, and for long jobs starts it with background=true and checks on it with the process tool. A Gemini CLI skill is the same shape with the commands above. See Hermes Agent skills for where a custom SKILL.md goes.

Why bother, when Hermes can already edit files? Cost and context. A personal Google sign-in covers Gemini CLI’s own usage, so a large refactor does not spend the model budget Hermes uses for chat, and Gemini CLI keeps the repo exploration inside its own session instead of filling Hermes’s context.

Direction 2: Gemini CLI uses Hermes over MCP

Hermes can also run as an MCP server. hermes mcp serve starts a stdio server that exposes your messaging channels: conversations_list, messages_read, events_wait, messages_send, channels_list and approval tools. Gemini CLI reads MCP servers from ~/.gemini/settings.json (or a project .gemini/settings.json):

{
  "mcpServers": {
    "hermes": {
      "command": "hermes",
      "args": ["mcp", "serve"]
    }
  }
}

Or add it from the command line:

gemini mcp add hermes hermes mcp serve

Now a Gemini CLI session can say “post the test summary to my Telegram” or wait for a reply from Discord. Two limits from the Hermes docs: the server is stdio-only, so Hermes must be installed on the same machine as Gemini CLI, and reads work without the gateway but sends need hermes gateway running with the platforms connected. Sends are text-only. More on the MCP side in Hermes Agent + MCP.

Gemini CLI or Gemini models in Hermes?

You wantUse
A chat bot on Telegram or Discord that thinks with GeminiGemini models inside Hermes — setup guide
Heavy repo work on your laptop, on your Google account’s quotaGemini CLI
Hermes to kick off coding jobs from a chat messageHermes + Gemini CLI via terminal (Direction 1)
Your coding session to notify people or read repliesGemini CLI + hermes mcp serve (Direction 2)

The two are not exclusive. A Hermes bot can run on Gemini models and still call Gemini CLI for repo work.

The OpenClaw equivalent

OpenClaw bundles a gemini skill. It declares the gemini binary as a requirement (with a Homebrew install hint for gemini-cli) and tells the agent to use headless one-shot mode: gemini -p, -m for a model, --output-format json, and stdin piped into -p. If auth is missing, run gemini once interactively to log in. So on OpenClaw, Direction 1 works as soon as the binary is on the path, with no custom skill to write. For Gemini as OpenClaw’s own model, see OpenClaw + Gemini.

On OpenClaw Launch

A managed bot on OpenClaw Launch runs in our cloud, not on your laptop, so the stdio MCP bridge in Direction 2 needs a local Hermes install and does not attach to a hosted bot. The split that works well: keep Gemini CLI on your own machine for repo work, and let the hosted Hermes or OpenClaw bot handle the always-on part — chat platforms, memory, schedules. You can choose a Gemini model for the hosted bot from the model picker, as described in Hermes Agent + Gemini.

Hermes + Gemini CLI FAQ

Is Gemini CLI the same as using Gemini models in Hermes?

No. Gemini CLI is Google’s own terminal agent, a separate program with its own tools, login and context files. Using Gemini models in Hermes means Hermes itself calls the Gemini API as its LLM backend (provider: gemini). That setup is covered in Hermes Agent + Gemini.

Does Hermes Agent have a built-in Gemini CLI integration?

Not as a dedicated skill or provider. Upstream Hermes bundles delegation skills for Claude Code, Codex and OpenCode, but none for Gemini CLI as of September 2026. Hermes can still drive it through its terminal tool, because Gemini CLI has a headless mode (gemini -p), and you can write a small skill to make that a habit.

Can Gemini CLI send messages through my Hermes bot?

Yes, when Hermes is installed on the same machine. hermes mcp serve runs Hermes as a stdio MCP server exposing tools such as conversations_list, messages_read and messages_send. Register it in Gemini CLI’s mcpServers and Gemini CLI can read and send messages on your connected platforms. Sending needs the Hermes gateway running.

Does OpenClaw support Gemini CLI too?

Yes. OpenClaw ships a bundled gemini skill that requires the gemini binary and runs it in one-shot mode with gemini -p, including --output-format json for structured output.

Is Gemini CLI free?

Gemini CLI is open source under Apache 2.0. Google’s README lists a free tier of 60 requests per minute and 1,000 requests per day when you sign in with a personal Google account; API-key and Vertex AI use follow those products’ own quotas and billing. Limits change, so check Google’s current terms.

Related guides

Run Hermes 24/7 without a server

OpenClaw Launch hosts Hermes Agent and OpenClaw with Telegram, Discord and more connected in minutes. Keep Gemini CLI on your laptop for code; let the hosted bot handle the always-on part.

Deploy Managed Hermes