Gemini CLI
Apothem harness adapter for Gemini CLI (GA).
Vendor: Google
Install name: gemini-cli
Status: GA
Native config: project-local GEMINI.md and .gemini/
Installation
apothem install --harness gemini-cli --project /path/to/projectThe adapter is project-scoped. It installs the project GEMINI.md, converts
Apothem commands to Gemini TOML slash commands, normalizes local helper
definitions, and places non-native support cohorts under .gemini/.apothem/support/.
Other coding tools also read a project GEMINI.md, so the Apothem block in it
is written as project-wide guidance that names no single tool as its reader.
Files written:
GEMINI.md
.gemini/commands/*.toml
.gemini/agents/*.md
.gemini/skills/
.gemini/.apothem/support/Profile-to-native-config mapping
The adapter reads Apothem's shared cohorts and routes each one through a
Gemini-compatible surface. Markdown rules, templates, and hook material remain
under .gemini/.apothem/support/ because they are support material, not a Gemini-native
rules directory.
The Apothem block in GEMINI.md ends with an Apothem support files section
that names, relative to the project root, the directory under
.gemini/.apothem/support/ each repository-style citation (rules/<name>.md,
templates/..., hooks/...) resolves against. The paths are relative so a
committed GEMINI.md carries no machine-specific path.
Each converted command in .gemini/commands/ holds a description and a
prompt. The prompt is the command's instructions only; the Apothem metadata
at the top of the source file (version, tool list, and similar fields) is left
out, so the model never reads it as instructions. Gemini runs a custom command
only when you type it.
Helper definitions in .gemini/agents/ keep their tool limits and turn limit:
the source tools grant, minus disallowedTools, becomes a Gemini tools
allowlist of Gemini tool names, and maxTurns becomes max_turns. A read-only
helper therefore gets no write_file or replace tool. No model is set, so
each helper inherits the session model.
A helper that the profile's agent_mcp_servers key lists also gets one
mcp_<server>_* entry per named server in its tools allowlist, so it can call
that server's tools and no other server's; with no key every helper keeps the
plain allowlist (see
MCP servers). Apothem
writes a grant here only for a server name of letters, digits and -, because
Gemini CLI cannot address a name with an underscore; any other name is skipped
and reported, and so is a grant for a helper that already reaches every MCP
server.
Compatibility notes
~/.gemini/ remains user-scope territory for tools that use a global Gemini
profile. The Gemini CLI adapter writes only to the project passed through
--project.
Verification
apothem verify --harness gemini-cli --project /path/to/projectThe verify command confirms that:
- The native config exists at the expected path.
- Each managed target exists; managed files are non-empty, and JSON or YAML
configs parse. Add
--profile PATHto also confirm that the installed files match that profile. - The adapter-specific verification routine reports success.
Updating
apothem update --harness gemini-cli --project /path/to/projectRefreshes GEMINI.md, converted commands, local helper definitions, installed
skills, and the .gemini/.apothem/support/ support tree.
Uninstalling
apothem uninstall --harness gemini-cli --project /path/to/projectRemoves the Apothem block from <project>/GEMINI.md and keeps any other text
in it. The file is deleted only when nothing else remains in it. Also removes
the Apothem files in <project>/.gemini/commands/,
<project>/.gemini/skills/, <project>/.gemini/agents/, and
<project>/.gemini/.apothem/support/; other files in those folders stay.
Before the change, a timestamped copy of each file is saved under
~/.apothem/backups/; no backup file is left in the project. The shared
profile YAML and Apothem engine are unaffected.
Conformity gate
python -m apothem.conformity.gate --all .Troubleshooting
| Symptom | Fix |
|---|---|
| Config file not found | Re-run apothem install --harness gemini-cli --project /path/to/project |
| Verification failed | Run apothem update --harness gemini-cli --project /path/to/project, then verify again |
| Unexpected config content | Check ~/.config/apothem/profile.yaml or --profile PATH, then re-run apothem update --harness gemini-cli --project /path/to/project |
Configuration knobs
| Flag | Default | Description |
|---|---|---|
--dry-run | false | Preview install without writing files. |
See also
- All harnesses — the full catalog of supported tools
- Install guide — install Apothem into this harness
apothem harnessesreference — list and inspect adapters from the CLI