You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Graph-sitter](https://graph-sitter.com) is a python library for manipulating codebases.
26
26
27
27
```python
28
-
fromcodegenimport Codebase
28
+
fromgraph_sitterimport Codebase
29
29
30
30
# Graph-sitter builds a complete graph connecting
31
31
# functions, classes, imports and their relationships
@@ -67,7 +67,7 @@ gs create test-function
67
67
# Run the codemod
68
68
gs run test-function
69
69
70
-
# Create an isolated venv with codegen => open jupyter
70
+
# Create an isolated venv with graph-sitter => open jupyter
71
71
gs notebook
72
72
```
73
73
@@ -84,7 +84,7 @@ from graph_sitter import Codebase
84
84
Having issues? Here are some common problems and their solutions:
85
85
86
86
-**I'm hitting an UV error related to `[[ packages ]]`**: This means you're likely using an outdated version of UV. Try updating to the latest version with: `uv self update`.
87
-
-**I'm hitting an error about `No module named 'codegen.sdk.extensions.utils'`**: The compiled cython extensions are out of sync. Update them with `uv sync --reinstall-package codegen`.
87
+
-**I'm hitting an error about `No module named 'graph_sitter.sdk.extensions.utils'`**: The compiled cython extensions are out of sync. Update them with `uv sync --reinstall-package graph-sitter`.
88
88
-**I'm hitting a `RecursionError: maximum recursion depth exceeded` error while parsing my codebase**: If you are using python 3.12, try upgrading to 3.13. If you are already on 3.13, try upping the recursion limit with `sys.setrecursionlimit(10000)`.
89
89
90
90
If you run into additional issues not listed here, please [join our slack community](https://community.codegen.com) and we'll help you out!
Copy file name to clipboardExpand all lines: architecture/3. imports-exports/A. Imports.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Import resolution follows AST construction in the code analysis pipeline. It identifies dependencies between modules and builds a graph of relationships across the codebase.
4
4
5
-
> NOTE: This is an actively evolving part of Codegen SDK, so some details here may be imcomplete, outdated, or incorrect.
5
+
> NOTE: This is an actively evolving part of Graph-sitter SDK, so some details here may be imcomplete, outdated, or incorrect.
Copy file name to clipboardExpand all lines: architecture/architecture.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Architecture of the Codegen SDK
1
+
# Architecture of the Graph-sitter SDK
2
2
3
-
This is a technical document explaining the architecture of the Codegen SDK.
3
+
This is a technical document explaining the architecture of the Graph-sitter SDK.
4
4
5
5
## Purpose of the SDK
6
6
@@ -17,7 +17,7 @@ This SDK is designed to accomplish a large set of use cases in one tool:
17
17
18
18
### Performance
19
19
20
-
A key problem is performance. We must be able to quickly respond to user requests on enterprise codebases (IE: renaming a symbol). However, we don't know what those requests are in advance and the scope of these requests can be quite massive (They may choose to iterate over a large number of symbols and their usages). To respond to these problems, we introduced codegen cloud. We split operations into two parts:
20
+
A key problem is performance. We must be able to quickly respond to user requests on enterprise codebases (IE: renaming a symbol). However, we don't know what those requests are in advance and the scope of these requests can be quite massive (They may choose to iterate over a large number of symbols and their usages). To respond to these problems, we introduced graph-sitter cloud. We split operations into two parts:
21
21
22
22
- A "parse" step that builds up a graph of the codebase
23
23
- This can take a long time to complete, but it only needs to be done once
@@ -34,12 +34,12 @@ To accomplish these goals, we can look at existing classes of solutions:
34
34
35
35
### Language Server Architecture
36
36
37
-
The immediate question is: why not use a language server? They have a lot of the same goals as codegen, but do not address many of our goals:
37
+
The immediate question is: why not use a language server? They have a lot of the same goals as graph-sitter, but do not address many of our goals:
38
38
39
39
- Language servers can handle many of these same use cases, but they are not as performant as we need.
40
40
- Generally, language servers compute their results lazily. This doesn't work for us because we need to perform a large number of operations on the codebase.
41
-
- While the LSP protocol is powerful, it is not designed to be scriptable the way codegen is.
42
-
- In Python, many of the language servers are an aglamation of many different tools and libraries. None are very good at refactoring or offer the comprehensive set of features that codegen does.
41
+
- While the LSP protocol is powerful, it is not designed to be scriptable the way graph-sitter is.
42
+
- In Python, many of the language servers are an aglamation of many different tools and libraries. None are very good at refactoring or offer the comprehensive set of features that graph-sitter does.
43
43
44
44
Generally language servers parse codebases in response to user actions. This is not a good fit for us because we need to perform a large number of operations on the codebase without knowing which symbols are being changed or queried.
45
45
@@ -56,7 +56,7 @@ Generally compilers build up knowledge of the entire codebase in a single pass.
56
56
57
57
## Architecture
58
58
59
-
The codegen SDK combines aspects of both systems to accomplish our goals.
59
+
The graph-sitter SDK combines aspects of both systems to accomplish our goals.
Copy file name to clipboardExpand all lines: architecture/external/dependency-manager.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Dependency Manager
2
2
3
-
> WARNING: Dependency manager is an experimental feature designed for Codegen Cloud! The current implementation WILL delete any existing `node_modules` folder!
3
+
> WARNING: Dependency manager is an experimental feature designed for Graph-sitter Cloud! The current implementation WILL delete any existing `node_modules` folder!
This is a collection of examples using [Codegen](https://codegen.com). You can use these examples to learn how to use Codegen and build custom code transformations.
5
+
This is a collection of examples using [Graph-sitter](https://graph-sitter.com). You can use these examples to learn how to use Graph-sitter and build custom code transformations.
6
6
7
7
## Setup
8
8
@@ -32,7 +32,7 @@ Your environment is now ready to run example codemods.
32
32
33
33
### IDE Configuration (Optional)
34
34
35
-
To configure your IDE for optimal use with Codegen, follow our [IDE setup guide](https://graph-sitter.com/introduction/ide-usage#configuring-your-ide-interpreter).
35
+
To configure your IDE for optimal use with Graph-sitter, follow our [IDE setup guide](https://graph-sitter.com/introduction/ide-usage#configuring-your-ide-interpreter).
Copy file name to clipboardExpand all lines: examples/STRUCTURE.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Your `run.py` should follow this structure, demonstrated well in the `generate_t
27
27
```python
28
28
import graph_sitter
29
29
from graph_sitter import Codebase
30
-
fromcodegen.sdk.core import Function
30
+
fromgraph_sitter.core import Function
31
31
# ... other imports
32
32
```
33
33
@@ -177,4 +177,4 @@ Before submitting:
177
177
1. Ensure the example runs with minimal setup
178
178
1. Check that documentation is clear and accurate
179
179
180
-
Remember: Your example might be used by both humans and AI to understand Codegen's capabilities. Clear structure and documentation help everyone use your code effectively.
180
+
Remember: Your example might be used by both humans and AI to understand Graph-sitter's capabilities. Clear structure and documentation help everyone use your code effectively.
Copy file name to clipboardExpand all lines: examples/examples/codegen-mcp-server/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
</p>
8
8
9
9
<h2align="center">
10
-
An MCP server implementation that integrates the codegen sdk.
10
+
An MCP server implementation that integrates the graph-sitter sdk.
11
11
12
12
</h2>
13
13
@@ -18,10 +18,10 @@
18
18
19
19
</div>
20
20
21
-
This example demonstrates how to run a Model Control Protocol (MCP) server that integrates with Codegen. The server provides:
21
+
This example demonstrates how to run a Model Control Protocol (MCP) server that integrates with Graph-sitter. The server provides:
22
22
23
23
1. A standardized interface for model inference
24
-
1. Integration with Codegen's core functionality, parsing codebases and executing codemods
24
+
1. Integration with Graph-sitter's core functionality, parsing codebases and executing codemods
25
25
1. Support for various LLM providers through the MCP protocol
26
26
27
27
## Quick Start
@@ -64,4 +64,4 @@ Here is an example mcp config that can be used with Cline or Claude desktop to i
64
64
65
65
-`parse_codebase`: Parses a codebase located at the provided path.
66
66
-`check_parse_status`: Provides the current parsing status for the provided codebase.
67
-
-`execute_codemod`: Executes a codemod script on a parsed codebase. This is where the codegen sdk leveraged to run simple or sophisticated codemods on the codebase.
67
+
-`execute_codemod`: Executes a codemod script on a parsed codebase. This is where the graph-sitter sdk leveraged to run simple or sophisticated codemods on the codebase.
Copy file name to clipboardExpand all lines: examples/examples/cyclomatic_complexity/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Cyclomatic Complexity Analyzer
2
2
3
-
This example demonstrates how to analyze the cyclomatic complexity of Python codebases using Codegen. The script provides detailed insights into code complexity by analyzing control flow structures and providing a comprehensive report.
3
+
This example demonstrates how to analyze the cyclomatic complexity of Python codebases using Graph-sitter. The script provides detailed insights into code complexity by analyzing control flow structures and providing a comprehensive report.
4
4
5
5
> [!NOTE]
6
6
> The cyclomatic complexity metric helps identify complex code that might need refactoring. A higher score indicates more complex code with multiple decision points.
@@ -15,7 +15,7 @@ The script (`run.py`) performs the complexity analysis in several key steps:
15
15
codebase = Codebase.from_repo("fastapi/fastapi")
16
16
```
17
17
18
-
- Loads any Python codebase into Codegen's analysis engine
18
+
- Loads any Python codebase into Graph-sitter's analysis engine
0 commit comments