> Graphify: shared context of codebase for agents and developers. Canonical: https://graphify.com/integrations/gemini-cli · Full index: https://graphify.com/llms-full.txt

Integrations

# Wire Gemini CLI to a graph of your repository.

Connect Gemini CLI to Graphify at api.graphify.com/mcp, or run the Graphify CLI locally with GEMINI.md.

Setup guide · hosted MCP · GEMINI.md

Connect Gemini CLI to Graphify at https://api.graphify.com/mcp, where it can use the [code graph](https://graphify.com/concepts), Memory and PR review status. Sign in with OAuth: no API key, and nothing to build on your machine. The Wiki lives in the Graphify app and is not served over MCP. Start free at [app.graphify.com](https://app.graphify.com).

terminal

```
gemini mcp add --transport http graphify https://api.graphify.com/mcp
```

Start gemini. Gemini CLI opens your browser to sign in the first time it uses the server. Prefer local? The open-source Graphify CLI (uv tool install graphifyy) wires it into GEMINI.md.

## Prefer local

Graphify can also give Gemini CLI a local graph in graphify-out/, with always on rules in GEMINI.md and a BeforeTool hook that fires right before the agent reads a file or lists a directory.

1. Install the CLI. If graphify is not found afterwards, run uv tool update-shell and open a new terminal.
2. From the project root: graphify gemini install. Prefer everything inside the repo? graphify gemini install --project writes the skill under .gemini/skills/ and prints a git add hint, so the setup is committable.
3. Build the graph: type /graphify . in a Gemini CLI session. It writes graphify-out/ with graph.json (the queryable graph), graph.html (interactive), and GRAPH_REPORT.md (highlights, suggested questions).
4. Ask something structural and watch the agent query the graph first.

terminal

```
$ uv tool install graphifyy
$ graphify gemini install
```

in Gemini CLI

```
/graphify .
```

## What graphify gemini install writes

GEMINI.md (section added by graphify gemini install, excerpt)

```
## graphify

This project has a knowledge graph at graphify-out/ with god nodes,
community structure, and cross-file relationships.

Rules:
- For codebase questions, first run `graphify query "<question>"`
  when graphify-out/graph.json exists. Use `graphify path "<A>" "<B>"`
  for relationships and `graphify explain "<concept>"` for focused
  concepts.
```

## How the BeforeTool hook works

Gemini CLI exposes hooks that run before tool calls, and Graphify uses exactly one of them. Right before the agent runs read_file or list_directory, the hook checks whether graphify-out/graph.json exists. If it does, the tool call proceeds with a reminder attached: run graphify query "<question>" for a scoped subgraph instead of walking raw files. If there is no graph yet, the hook stays silent, so an uninitialized repo behaves exactly as before.

.gemini/settings.json (hook registered by the installer)

```
{
  "hooks": {
    "BeforeTool": [
      {
        "matcher": "read_file|list_directory",
        "hooks": [
          { "type": "command", "command": "graphify hook-guard gemini" }
        ]
      }
    ]
  }
}
```

The hook never blocks: it always allows the tool call and only adds context. It is a shell-agnostic graphify subcommand rather than inline shell, so it behaves the same on macOS, Linux, and Windows, and the installer re-registers it on every run so an upgraded CLI never leaves a stale hook payload behind. In the installed file the command embeds the absolute path to your graphify executable.

Query results come back with file:line citations, and every edge is tagged EXTRACTED (parsed from the AST), INFERRED (resolved by Graphify, with or without a model), or AMBIGUOUS (flagged by the model pass), so the agent knows where each link came from. The full command set is in the [CLI reference](https://docs.graphify.com/reference/overview).

## Gemini CLI vs Google Antigravity

These are two different Graphify platforms. graphify gemini install covers the Gemini CLI terminal agent described on this page. Google Antigravity, Google's agentic IDE, has its own installer (graphify antigravity install) that writes .agents rules and workflows instead, and its global skill lives at ~/.gemini/config/skills/. If you use both, install both; see [Graphify + Google Antigravity](https://graphify.com/integrations/google-antigravity).

## Keeping the graph current

After code changes, graphify update . re-extracts only the files that changed (AST-only, no API cost); the GEMINI.md rules tell the agent to run it after modifying code. graphify hook install adds post-commit and post-checkout git hooks that do the same automatically.

## Troubleshooting

- graphify: command not found: the uv or pipx tool bin dir (~/.local/bin) is not on your PATH yet. Run uv tool update-shell (or pipx ensurepath) and open a new terminal.
- No nudge appears before reads: that is expected until graphify-out/graph.json exists. The hook is deliberately silent without a graph, so build one with /graphify . first.
- /graphify does nothing: confirm the skill file exists (~/.gemini/skills/graphify/SKILL.md, or ~/.agents/skills/ on Windows) and that GEMINI.md contains the graphify section, then start a new session.
- Hook stopped firing after an upgrade: the hook command embeds the absolute executable path at install time. Re-run graphify gemini install; it replaces its own hook entry idempotently.
- The graph lives somewhere else: the hook honors the GRAPHIFY_OUT environment variable when your output directory is not the default graphify-out/.

## From the blog

- [Gemini CLI MCP: how to connect Graphify](https://graphify.com/blog/gemini-cli-how-to-connect-graphify): Connect Graphify to Gemini CLI as a local graph or through the hosted MCP server, then ask which function calls which, step by step.

## Gemini CLI FAQ

### Do I need an API key to connect Gemini CLI to Graphify?

No. Gemini CLI opens your browser to sign in to Graphify with OAuth the first time it uses the server. There is no key to paste or store.

### Is this the same as Google Antigravity support?

No. Gemini CLI and Google Antigravity are separate platforms in Graphify, with separate installers. graphify gemini install covers the Gemini CLI terminal agent; Antigravity has its own graphify antigravity install, which writes .agents rules and workflows and uses a different global skill directory (~/.gemini/config/skills/). Set up whichever you actually run, or both.

### Does graphify gemini install overwrite my GEMINI.md?

No. The installer replaces or appends only its own graphify section (marked with a heading it owns) and leaves the rest of the file alone. Re-running the install refreshes that one section; graphify gemini uninstall removes the section and the BeforeTool hook again.

### Can the hook block Gemini CLI from reading files?

No. The BeforeTool hook always allows the tool call; it only attaches a reminder to query the graph when graphify-out/graph.json exists, and stays completely silent when there is no graph. Strict blocking exists only on Claude Code, where the hook API supports a deny decision.

### Does my code leave my machine?

With the open-source engine, no. Source code is parsed locally across about 40 languages, mostly with tree-sitter; building code edges never requires an API call. Non-code files such as docs and PDFs are read by the model you already use in Gemini CLI. The engine sends Graphify no telemetry and needs no account. If you use Graphify Cloud instead, it builds the graph from the repositories you connect.

### Where does the skill go on Windows?

On Windows, the global Gemini CLI skill installs to ~/.agents/skills/graphify/SKILL.md, which Gemini CLI searches with higher priority there; macOS and Linux use ~/.gemini/skills/graphify/SKILL.md. With --project, the skill lives inside the repo at .gemini/skills/graphify/SKILL.md on every platform.

### How do I remove it?

graphify gemini uninstall removes the GEMINI.md section and the BeforeTool hook; graphify uninstall removes Graphify from every platform at once. Add --purge to also delete the graphify-out/ directory.

## Next steps

The [quickstart](https://docs.graphify.com/quickstart) walks the whole flow from install to first query, and the [CLI reference](https://docs.graphify.com/reference/overview) covers every command the rules point Gemini CLI at. The same graph serves your other assistants too: see [Graphify + Claude Code](https://graphify.com/integrations/claude-code), [Graphify + Codex](https://graphify.com/integrations/codex), or browse every assistant on the [integrations page](https://graphify.com/integrations).

## Try Graphify now.

[Try for free](https://graphify.com/signup)

[Graphify](https://graphify.com/)

Shared context of codebase for agents and developers. Hosted, or open source on your own machine.

[SOC 2 Type II Audit in progress](https://trust.graphify.com)

Ask AI about Graphify

- [ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fgraphify.com%2Fllms-full.txt%20and%20answer%20from%20it%20(fetch%20the%20page%20if%20you%20can%3B%20every%20page%20also%20has%20a%20.md%20version).%20Answer%20about%20Graphify%20by%20Graphify%20Labs%20at%20graphify.com%20specifically%2C%20not%20other%20tools%20with%20similar%20names.%0A%0AHow%20does%20Graphify%20give%20agents%20and%20developers%20a%20shared%20understanding%20of%20the%20codebase%2C%20turning%20huge%20monorepos%20and%20scattered%20business%20context%20into%20deep%2C%20shared%20knowledge%20that%20helps%20teams%20make%20safer%20changes%2C%20use%20AI%20efficiently%2C%20and%20avoid%20constantly%20relearning%20the%20codebase%3F%0A%0AAnswer%20in%20under%20150%20words%20and%20cite%20the%20source.%20If%20you%20cannot%20access%20it%2C%20say%20so.)
- [Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fgraphify.com%2Fllms-full.txt%20and%20answer%20from%20it%20(fetch%20the%20page%20if%20you%20can%3B%20every%20page%20also%20has%20a%20.md%20version).%20Answer%20about%20Graphify%20by%20Graphify%20Labs%20at%20graphify.com%20specifically%2C%20not%20other%20tools%20with%20similar%20names.%0A%0AHow%20does%20Graphify%20give%20agents%20and%20developers%20a%20shared%20understanding%20of%20the%20codebase%2C%20turning%20huge%20monorepos%20and%20scattered%20business%20context%20into%20deep%2C%20shared%20knowledge%20that%20helps%20teams%20make%20safer%20changes%2C%20use%20AI%20efficiently%2C%20and%20avoid%20constantly%20relearning%20the%20codebase%3F%0A%0AAnswer%20in%20under%20150%20words%20and%20cite%20the%20source.%20If%20you%20cannot%20access%20it%2C%20say%20so.)
- [Perplexity](https://www.perplexity.ai/search?q=Read%20https%3A%2F%2Fgraphify.com%2Fllms-full.txt%20and%20answer%20from%20it%20(fetch%20the%20page%20if%20you%20can%3B%20every%20page%20also%20has%20a%20.md%20version).%20Answer%20about%20Graphify%20by%20Graphify%20Labs%20at%20graphify.com%20specifically%2C%20not%20other%20tools%20with%20similar%20names.%0A%0AHow%20does%20Graphify%20give%20agents%20and%20developers%20a%20shared%20understanding%20of%20the%20codebase%2C%20turning%20huge%20monorepos%20and%20scattered%20business%20context%20into%20deep%2C%20shared%20knowledge%20that%20helps%20teams%20make%20safer%20changes%2C%20use%20AI%20efficiently%2C%20and%20avoid%20constantly%20relearning%20the%20codebase%3F%0A%0AAnswer%20in%20under%20150%20words%20and%20cite%20the%20source.%20If%20you%20cannot%20access%20it%2C%20say%20so.)
- [Google AI](https://www.google.com/search?udm=50&q=Read%20https%3A%2F%2Fgraphify.com%2Fllms-full.txt%20and%20answer%20from%20it%20(fetch%20the%20page%20if%20you%20can%3B%20every%20page%20also%20has%20a%20.md%20version).%20Answer%20about%20Graphify%20by%20Graphify%20Labs%20at%20graphify.com%20specifically%2C%20not%20other%20tools%20with%20similar%20names.%0A%0AHow%20does%20Graphify%20give%20agents%20and%20developers%20a%20shared%20understanding%20of%20the%20codebase%2C%20turning%20huge%20monorepos%20and%20scattered%20business%20context%20into%20deep%2C%20shared%20knowledge%20that%20helps%20teams%20make%20safer%20changes%2C%20use%20AI%20efficiently%2C%20and%20avoid%20constantly%20relearning%20the%20codebase%3F%0A%0AAnswer%20in%20under%20150%20words%20and%20cite%20the%20source.%20If%20you%20cannot%20access%20it%2C%20say%20so.)
- [Grok](https://grok.com/?q=Read%20https%3A%2F%2Fgraphify.com%2Fllms-full.txt%20and%20answer%20from%20it%20(fetch%20the%20page%20if%20you%20can%3B%20every%20page%20also%20has%20a%20.md%20version).%20Answer%20about%20Graphify%20by%20Graphify%20Labs%20at%20graphify.com%20specifically%2C%20not%20other%20tools%20with%20similar%20names.%0A%0AHow%20does%20Graphify%20give%20agents%20and%20developers%20a%20shared%20understanding%20of%20the%20codebase%2C%20turning%20huge%20monorepos%20and%20scattered%20business%20context%20into%20deep%2C%20shared%20knowledge%20that%20helps%20teams%20make%20safer%20changes%2C%20use%20AI%20efficiently%2C%20and%20avoid%20constantly%20relearning%20the%20codebase%3F%0A%0AAnswer%20in%20under%20150%20words%20and%20cite%20the%20source.%20If%20you%20cannot%20access%20it%2C%20say%20so.)
- [DeepSeek](https://chat.deepseek.com/?q=Read%20https%3A%2F%2Fgraphify.com%2Fllms-full.txt%20and%20answer%20from%20it%20(fetch%20the%20page%20if%20you%20can%3B%20every%20page%20also%20has%20a%20.md%20version).%20Answer%20about%20Graphify%20by%20Graphify%20Labs%20at%20graphify.com%20specifically%2C%20not%20other%20tools%20with%20similar%20names.%0A%0AHow%20does%20Graphify%20give%20agents%20and%20developers%20a%20shared%20understanding%20of%20the%20codebase%2C%20turning%20huge%20monorepos%20and%20scattered%20business%20context%20into%20deep%2C%20shared%20knowledge%20that%20helps%20teams%20make%20safer%20changes%2C%20use%20AI%20efficiently%2C%20and%20avoid%20constantly%20relearning%20the%20codebase%3F%0A%0AAnswer%20in%20under%20150%20words%20and%20cite%20the%20source.%20If%20you%20cannot%20access%20it%2C%20say%20so.)

© 2026 Graphify Labs. All rights reserved.

Hosted or on-device · Apache 2.0
