Skip to content

Gemini CLI

Support: detection and feedback.

Run OpenFiles: Install Agent Hooks… and pick Gemini CLI. OpenFiles adds this to .gemini/settings.json:

{
"hooks": {
"AfterTool": [
{
"matcher": "write_file|replace",
"hooks": [
{
"type": "command",
"name": "OpenFiles",
"command": "node \"/Users/you/.openfiles/hook.js\" --agent gemini --tag openfiles-hook",
"timeout": 15000
}
]
}
]
}
}

Gemini CLI timeouts are in milliseconds. Gemini expects a hook’s stdout to be pure JSON, and OpenFiles prints either one JSON object or nothing.

hookSpecificOutput.additionalContext is appended to the tool result.

Reference: Gemini CLI hooks.