Ward

How do I use Ward with Gemini CLI?

Updated

Run ward integrate gemini in your project. Ward writes the hooks in .gemini/settings.json and the wrapper .gemini/hooks/ward.sh and checks the code Gemini CLI writes.

What does the integration install?

Gemini event What happens
BeforeTool (write_file, replace, run_shell_command) With the guard enabled, denies protected changes
AfterTool (write_file, replace) Runs the quality check. Findings are appended as additionalContext
AfterAgent Runs the quality check and spec validation. Findings retry the turn once

Gemini registers project hooks only in a trusted folder.

Keep ward on your PATH.

What does the agent see when a check fails?

After an edit, findings are appended to the tool result, so the edit is still reported as applied. When the agent finishes, findings retry the turn once with the findings as the prompt.

How do I install and remove it?

ward integrate gemini
ward integrate gemini --remove

Generated files carry a Ward ownership marker. Ward refreshes only its own files and reports any file you wrote as a conflict.

Is it tested?

The generated files pass tests against Gemini CLI 0.64.0’s documented hook contract. A live run is not recorded yet. Ward is in alpha, so the CLI and the configuration may change before 1.0.

Where do I go next?

Ready to try it? Install Ward and run ward init in your project.