> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphify.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The PyPI package is graphifyy, with two y's. The command is graphify.
> /graphify . is typed in an assistant chat, not in a shell.
> Use only commands, flags, and endpoints shown on these pages. Do not invent one.
> Choose the surface before you open a page. Local (Graphify Local) is the graphifyy package on the machine: the skill, the CLI, and the ten-tool MCP. Its pages are the Open Source tab (/open-source/) and the Graphify Local tab on each Integrations page. Graphify is the hosted workspace and https://api.graphify.com/mcp (Streamable HTTP, OAuth, no API key). Its pages are the Graphify tab (/platform/, /concepts/) and the Graphify (hosted) tab on each Integrations page. Prefer Graphify unless the user asks for a local or offline setup. Cookbooks (/cookbooks/) and /mcp/docs-search apply to both. Each page's source frontmatter records this as surface: local, cloud, or both. Buildkite is the CI integration.
> In llms.txt, tell the surface from the page path. Graphify: /platform/ and /concepts/. Local: /open-source/. Most /integrations/ pages cover both, with a Graphify (hosted) tab and a Graphify Local tab. Everything else applies to both.
> graphifyy release notes are published at https://github.com/Graphify-Labs/graphify/releases and https://graphify.com/changelog. The current package version is on PyPI (https://pypi.org/project/graphifyy/).
> The official site is https://graphify.com. These docs are https://docs.graphify.com.
> The local MCP server is the ten tools in the MCP tool reference and reads a graph on the machine. The hosted server is https://api.graphify.com/mcp (Streamable HTTP, OAuth, no API key). The JetBrains, ChatGPT, Codex, and Dots, and Vercel pages use the hosted server, not the ten-tool list. On pages with tabs, the Graphify (hosted) tab uses the hosted server and the Graphify Local tab uses the local skill or the ten-tool server.
> Read https://docs.graphify.com/llms.txt, then open one page's .md link. Use https://docs.graphify.com/llms-full.txt only when one page is not enough.

# CLI quickstart: build and query a graph from the terminal

> Build a code knowledge graph with graphify extract, then query it with query, path, explain, and god-nodes. No agent or API key needed.

The `graphify` command does everything the agent skill does, from a terminal. Code extraction is deterministic and runs without an API key, so this is also the path for scripts and CI.

> [!NOTE]
>
> **Use the CLI when** you want to build graphs in a script or pipeline, inspect a codebase yourself, or check what your agent will see. To let an agent drive, use the [skill quickstart](https://docs.graphify.com/open-source/quickstart.md).

## Install

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
uv tool install graphifyy    # or: pipx install graphifyy / pip install graphifyy
graphify --help
```

## Build the graph

**1. Extract the code**

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
cd your-repo
graphify extract . --code-only
```

`--code-only` skips documents and media, so no model is called. On a copy of the Graphify package (98 code files) this took about 6 seconds.

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
[graphify extract] next: run `graphify cluster-only .` to generate GRAPH_REPORT.md and name communities
```

**2. Write the report and HTML view**

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify cluster-only . --no-label
```

This writes `graphify-out/GRAPH_REPORT.md` and `graphify-out/graph.html`. Drop `--no-label` to name communities with an LLM backend.

## Query the graph

**query**

Traverse from the nodes that match your words and return a token-budgeted subgraph.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify query "cluster leiden" --budget 300
```

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
Graph: graphify-out/graph.json (4856 nodes) | Traversal: BFS depth=2 | Start: ['cluster()', '_native_leiden()'] | 34 nodes found

[!] TRUNCATED: showing 12 of 34 nodes (~300-token budget). ...

NODE cluster() [src=corpus/cluster.py loc=L233 community=cluster.py]
NODE _native_leiden() [src=corpus/cluster.py loc=L23 community=cluster.py]
NODE dispatch_command() [src=corpus/cli.py loc=L1447 community=dispatch_command]
```

Add `--dfs` to follow one chain deeply instead of exploring broadly.

**path**

Find the shortest path between two symbols.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify path "cluster()" "build()" --undirected
```

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
Shortest path (3 hops):
  cluster() <--calls [INFERRED]-- dispatch_command() --calls [INFERRED]--> build_from_json() <--calls [EXTRACTED]-- build()
```

**explain**

Show one node, where it lives, and everything connected to it.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify explain "reflect()"
```

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
Node: reflect()
  ID:        corpus_reflect_reflect
  Source:    corpus/reflect.py L564
  Type:      code
  Community: reflect
  Degree:    25
```

**god-nodes**

List the most connected symbols, the ones most changes touch.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify god-nodes --top 5
```

Each edge shows its confidence: `EXTRACTED` was read from the source, `INFERRED` was derived by a resolver, and `AMBIGUOUS` had several possible targets.

## Keep it current

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify update .          # re-extract changed code files only
graphify hook install      # rebuild automatically after commit, checkout, merge, and rebase
```

`graphify update` re-parses only files whose hashes changed. `graphify hook install` adds `post-commit`, `post-checkout`, `post-merge`, and `post-rewrite` hooks and registers a git merge driver for `graph.json`.

## Troubleshooting

| Symptom | Fix |
| - | - |
| `No matching nodes found.` (exit code 4) | `query` matches words in node labels. Use symbol or file names, such as `"cluster leiden"`, rather than a full sentence. |
| Exit code 3 from `query` | Several nodes matched equally. Use a more specific term. |
| `No directed path` from `path` | Add `--undirected` to ignore edge direction. |
| `No unique node match` from `explain` or `affected` | Include the parentheses for functions, for example `"reflect()"`. |

## What's next

> **[MCP server quickstart](https://docs.graphify.com/open-source/mcp-server.md)**
>
> Give any MCP client the same queries as tools.

> **[Self-host with Docker](https://docs.graphify.com/open-source/self-host.md)**
>
> Share one graph with your team over HTTP.

> **[Try it in Graphify](https://docs.graphify.com/platform/quickstart.md)**
>
> We build and host the graph for you. Start with a 14-day Pro trial, then keep up to 3 repositories on Free. No card required.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.