- 2. Open the Command Palette (Cmd/Ctrl + Shift + P)
- 3. Type "Python: Select Interpreter"
-
- 4. Choose "Enter interpreter path"
- 5. Navigate to and select:
- ```bash
- .codegen/.venv/bin/python
- ```
-
- Alternatively, create a `.vscode/settings.json`:
- ```json
- {
- "python.defaultInterpreterPath": "${workspaceFolder}/.codegen/.venv/bin/python",
- "python.analysis.extraPaths": [
- "${workspaceFolder}/.codegen/.venv/lib/python3.12/site-packages"
- ]
- }
- ```
-
- Collaborating with Cursor's assistant and the Graph-sitter system prompt
-
-
-In addition, when you [create](/cli/create) a codemod with "-d", Graph-sitter generates an optimized system prompt in `.codegen/codemods/{name}/{name}-system-prompt.txt`. This prompt contains:
-- Relevant Codegen API documentation
-- Examples of relevant transformations
-- Context about your specific task
-
-
-
-
-# Neo4j Graph
-
-Graph-sitter can export codebase graphs to Neo4j for visualization and analysis.
-
-## Installation
-In order to use Neo4j you will need to install it and run it locally using Docker.
-
-### Neo4j
-First, install Neo4j using the official [installation guide](https://neo4j.com/docs/desktop-manual/current/installation/download-installation/).
-
-### Docker
-To run Neo4j locally using Docker, follow the instructions [here](https://neo4j.com/docs/apoc/current/installation/#docker).
-
-## Launch Neo4j Locally
-
-```bash
-docker run \
- -p 7474:7474 -p 7687:7687 \
- -v $PWD/data:/data -v $PWD/plugins:/plugins \
- --name neo4j-apoc \
- -e NEO4J_apoc_export_file_enabled=true \
- -e NEO4J_apoc_import_file_enabled=true \
- -e NEO4J_apoc_import_file_use__neo4j__config=true \
- -e NEO4J_PLUGINS=\[\"apoc\"\] \
- neo4j:latest
-```
-## Usage
-
-```python
-from graph_sitter import Codebase
-from graph_sitter.extensions.graph.main import visualize_codebase
-
-# parse codebase
-codebase = Codebase("path/to/codebase")
-
-# export to Neo4j
-visualize_codebase(codebase, "bolt://localhost:7687", "neo4j", "password")
-```
-
-## Visualization
-
-Once exported, you can open the Neo4j browser at `http://localhost:7474`, sign in with the username `neo4j` and the password `password`, and use the following Cypher queries to visualize the codebase:
-
-### Class Hierarchy
-
-```cypher
-Match (s: Class )-[r: INHERITS_FROM*]-> (e:Class) RETURN s, e LIMIT 10
-```
-
-
-
-
-### Methods Defined by Each Class
-
-```cypher
-Match (s: Class )-[r: DEFINES]-> (e:Method) RETURN s, e LIMIT 10
-```
-
-
-
-
-### Function Calls
-
-```cypher
-Match (s: Func )-[r: CALLS]-> (e:Func) RETURN s, e LIMIT 10
-```
-
-
-
-
-
-### Call Graph
-
-```cypher
-Match path = (:(Method|Func)) -[:CALLS*5..10]-> (:(Method|Func))
-Return path
-LIMIT 20
-```
-
-
-
-
\ No newline at end of file
diff --git a/docs/tutorials/python2-to-python3.mdx b/docs/tutorials/python2-to-python3.mdx
index b119a73ce..70826a60e 100644
--- a/docs/tutorials/python2-to-python3.mdx
+++ b/docs/tutorials/python2-to-python3.mdx
@@ -246,7 +246,6 @@ Check out these related tutorials:
- [Increase Type Coverage](/tutorials/increase-type-coverage)
- [Organizing Your Codebase](/tutorials/organize-your-codebase)
-- [Creating Documentation](/tutorials/creating-documentation)
## Learn More
diff --git a/docs/use-cases/I. Upgrading APIs.md b/docs/use-cases/I. Upgrading APIs.md
deleted file mode 100644
index e69de29bb..000000000
diff --git a/docs/use-cases/II. Improving Codebase Modularity.md b/docs/use-cases/II. Improving Codebase Modularity.md
deleted file mode 100644
index e69de29bb..000000000
diff --git a/docs/use-cases/III. Improving Type Coverage.md b/docs/use-cases/III. Improving Type Coverage.md
deleted file mode 100644
index e69de29bb..000000000
diff --git a/docs/use-cases/IV. Analyzing Critical Code Paths.md b/docs/use-cases/IV. Analyzing Critical Code Paths.md
deleted file mode 100644
index e69de29bb..000000000
diff --git a/docs/users/get-user.mdx b/docs/users/get-user.mdx
deleted file mode 100644
index 8fde95c28..000000000
--- a/docs/users/get-user.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
----
-openapi: get /v1/organizations/{org_id}/users/{user_id}
----
\ No newline at end of file
diff --git a/docs/users/get-users.mdx b/docs/users/get-users.mdx
deleted file mode 100644
index 8448ef000..000000000
--- a/docs/users/get-users.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
----
-openapi: get /v1/organizations/{org_id}/users
----
\ No newline at end of file
diff --git a/site/app/page.tsx b/site/app/page.tsx
index 690129979..0ab99db4a 100644
--- a/site/app/page.tsx
+++ b/site/app/page.tsx
@@ -1,99 +1,72 @@
import {
ArrowRight,
BookOpen,
- Code2,
+ Bot,
+ Database,
ExternalLink,
- FileCode2,
- GitBranch,
- Network,
- ShieldCheck,
+ FolderTree,
+ Share2,
TerminalSquare,
+ Trash2,
+ TreePine,
} from "lucide-react";
import Link from "next/link";
import { Logo, Wordmark } from "@/components/logo";
import { ThemeToggle } from "@/components/theme-toggle";
-import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
const docsUrl = "/docs";
const githubUrl = "https://github.com/codegen-sh/graph-sitter";
-const capabilities = [
+const pillars = [
{
- icon: FileCode2,
+ icon: Database,
tone: "text-aura-purple",
- title: "Parse real codebases",
- text: "Load Python, TypeScript, JavaScript, and React repositories into files, directories, and language-aware symbols.",
+ title: "Fast, in-memory index",
+ text: "Parse a whole repository into an in-memory index that captures more than the AST — imports, exports, usages, references, and call relationships.",
},
{
- icon: GitBranch,
+ icon: TreePine,
tone: "text-aura-green",
- title: "Build the graph",
- text: "Index imports, exports, function calls, references, usages, and dependencies before touching any source text.",
+ title: "Backed by tree-sitter",
+ text: "Built on tree-sitter parsing for Python, TypeScript, JavaScript, and React, with the heaviest indexes moving into Rust for scale.",
},
{
- icon: ShieldCheck,
+ icon: Bot,
tone: "text-aura-blue",
- title: "Run guarded codemods",
- text: "Write transformations that move, rename, delete, and rewrite code while keeping the related graph edges in sync.",
+ title: "Optimized for coding agents",
+ text: "A clean, scriptable API designed for AI coding agents to explore code and make safe, graph-aware edits without breaking imports.",
},
];
-const architecture = [
+const useCases = [
{
- icon: Code2,
+ icon: FolderTree,
tone: "text-aura-purple",
- title: "Python stays the shell",
- text: "The authoring experience remains Python: notebooks, scripts, reusable codemods, and the high-level editable API.",
+ title: "Large-scale reorganization",
+ text: "Restructure directories and move symbols across a codebase while every import and reference is repaired automatically.",
+ href: `${docsUrl}/tutorials/organize-your-codebase`,
+ cta: "Reorganize a codebase",
},
{
- icon: Network,
- tone: "text-aura-green",
- title: "Rust handles scale",
- text: "The rewrite path moves the massive parse and index data structure into a compact Rust backend for large repositories.",
+ icon: Trash2,
+ tone: "text-aura-red",
+ title: "Dead code monitoring & deletion",
+ text: "Find functions, classes, and imports with no usages across the index, then remove them with confidence in a single pass.",
+ href: `${docsUrl}/tutorials/deleting-dead-code`,
+ cta: "Delete dead code",
},
{
- icon: TerminalSquare,
- tone: "text-aura-blue",
- title: "uvx is the entrypoint",
- text: "The target command is uvx graph-sitter for repository parsing, graph inspection, and guarded transformations.",
+ icon: Share2,
+ tone: "text-aura-green",
+ title: "Codebase visualization",
+ text: "Turn the dependency and call graph into interactive visualizations to understand structure and blast radius before you change it.",
+ href: `${docsUrl}/tutorials/codebase-visualization`,
+ cta: "Visualize a codebase",
},
];
-const useCases = [
- "Delete dead code with usage checks",
- "Move symbols while repairing imports",
- "Trace API impact across a repo",
- "Inspect import and reference graphs",
- "Build custom codebase analytics",
- "Run checked codemods before writes",
-];
-
-const graphNodes = [
- { label: "user.py", dot: "bg-aura-purple", x: 17, y: 24 },
- { label: "UserService", dot: "bg-aura-blue", x: 63, y: 17 },
- { label: "create_user()", dot: "bg-aura-orange", x: 72, y: 56 },
- { label: "usages", dot: "bg-aura-green", x: 23, y: 72 },
-];
-
-function CheckIcon({ className }: { className?: string }) {
- return (
-
- );
-}
-
export default function Home() {
return (
- Graph-sitter lets Python programs parse whole repositories, - build reference and import graphs, query code relationships, and - make targeted source edits — with the largest indexes moving - into Rust for scale. + Graph-sitter parses whole repositories into an in-memory index + of imports, usages, and references — backed by tree-sitter and + optimized for coding agents that need to analyze and safely + rewrite code.
+ +
- $ uvx
- graph-sitter parse .
-
- parse any repo
- - Everything resolves through one editable model of your repository — - so analysis and rewrites stay consistent. -
-- Reach for graph-sitter when a change is too mechanical for hands - and too structural for find-and-replace. -
-+ Reach for graph-sitter when a change is too mechanical for hands + and too structural for find-and-replace. +
+- The resurrection keeps the Python shell intact while moving the - heavy lifting into Rust. -
-- {item.text} -
-+ {item.text} +
+ + {item.cta} +
- The release target is{" "}
-
- uvx graph-sitter
-
- : start with fast parse summaries and graph inspection, then run
- codemods in explicit check and write modes.
+ Run it with no install. Start with fast parse summaries, then
+ run codemods in explicit check and write modes — with the
+ heaviest indexes moving into Rust for scale.
+
+
+ ${" "}
+ uvx graph-sitter parse .
+
+
+ ${" "}
+ uvx graph-sitter
+ transform delete_dead_code.py:run .{" "}
+ --check
+
+
+ ${" "}
+ uvx graph-sitter
+ transform delete_dead_code.py:run .{" "}
+ --write
+
+
+
+
-
-
- from graph_sitter{" "}
- import{" "}
- Codebase
-
-
- codebase ={" "}
- Codebase(
- "./")
-
- {" "}
-
- for fn{" "}
- in codebase.
- functions:
-
-
- if{" "}
- not fn.
- usages:
-
-
- fn.remove()
-
- {" "}
-
- # python stays the control plane
-
-
- codebase.commit()
-
-
-
-
-
+
+
+ from graph_sitter{" "}
+ import{" "}
+ Codebase
+
+
+
+ # Parse the repo into a fast, in-memory index
+
+
+ codebase ={" "}
+ Codebase(
+ "./")
+
+
+
+ # Delete functions with no usages anywhere
+
+
+ for function{" "}
+ in codebase.
+ functions:
+
+
+ if{" "}
+ not function.
+ usages:
+
+
+ function.remove()
+
+
+
+ codebase.commit()
+
+
+
@@ -453,18 +386,19 @@ function Terminal() {
--language auto --backend rust --format summary
- {" "}
+
+
+ # run a codemod in check mode, then write
+
uvx graph-sitter
- transform ./codemods/rename.py{" "}
+ transform delete_dead_code.py:run .{" "}
--check
- {" "}
-
- # branch wheel proof:
-
-
- # uvx --from dist/*.whl graph-sitter parse . --backend rust
+
+ uvx graph-sitter
+ transform delete_dead_code.py:run .{" "}
+ --write
diff --git a/site/lib/docs.ts b/site/lib/docs.ts
index 42fd59e4c..5086c15a1 100644
--- a/site/lib/docs.ts
+++ b/site/lib/docs.ts
@@ -263,9 +263,6 @@ const docsSectionOrder = [
["blog", "Blog"],
["api-reference", "API Reference"],
["graph-sitter", "Graph-sitter"],
- ["use-cases", "Use Cases"],
- ["organizations", "Organizations"],
- ["users", "Users"],
] as const;
const sectionTitleBySlug = new Map