diff --git a/docs/building-with-graph-sitter/files-and-directories.mdx b/docs/building-with-graph-sitter/files-and-directories.mdx index 50e5ecc00..428a9f164 100644 --- a/docs/building-with-graph-sitter/files-and-directories.mdx +++ b/docs/building-with-graph-sitter/files-and-directories.mdx @@ -57,9 +57,9 @@ exists = codebase.has_directory("path/to/dir") ## Differences between SourceFile and File - [File](/api-reference/core/File) - a general purpose class that represents any file in the codebase including non-code files like README.md, .env, .json, image files, etc. -- [SourceFile](/api-reference/core/SourceFile) - a subclass of [File](/api-reference/core/File) that provides additional functionality for source code files written in languages supported by the [codegen-sdk](/introduction/overview) (Python, TypeScript, JavaScript, React). +- [SourceFile](/api-reference/core/SourceFile) - a subclass of [File](/api-reference/core/File) that provides additional functionality for source code files written in languages supported by [graph-sitter](/introduction/overview) (Python, TypeScript, JavaScript, React). -The majority of intended use cases involve using exclusively [SourceFile](/api-reference/core/SourceFile) objects as these contain code that can be parsed and manipulated by the [codegen-sdk](/introduction/overview). However, there may be cases where it will be necessary to work with non-code files. In these cases, the [File](/api-reference/core/File) class can be used. +The majority of intended use cases involve using exclusively [SourceFile](/api-reference/core/SourceFile) objects as these contain code that can be parsed and manipulated by [graph-sitter](/introduction/overview). However, there may be cases where it will be necessary to work with non-code files. In these cases, the [File](/api-reference/core/File) class can be used. By default, the `codebase.files` property will only return [SourceFile](/api-reference/core/SourceFile) objects. To include non-code files the `extensions='*'` argument must be used. diff --git a/docs/building-with-graph-sitter/function-decorator.mdx b/docs/building-with-graph-sitter/function-decorator.mdx index 4ded11a7c..647eb8af8 100644 --- a/docs/building-with-graph-sitter/function-decorator.mdx +++ b/docs/building-with-graph-sitter/function-decorator.mdx @@ -7,7 +7,7 @@ iconType: "solid" # Function Decorator -The `function` decorator is used to define codegen functions within your application. It allows you to specify a name for the function that will be ran making it easier to run specific codemods +The `function` decorator is used to define graph-sitter functions within your application. It allows you to specify a name for the function that will be ran making it easier to run specific codemods ## Usage @@ -29,7 +29,7 @@ In this example, the function `run` is decorated with `@graph_sitter.function` a ## Description -The `function` decorator is part of the codegen SDK CLI and is used to mark functions that are intended to be ran as part of a code generation process. It ensures that the function is properly registered and can be invoked with the specified name. +The `function` decorator is part of the graph-sitter SDK CLI and is used to mark functions that are intended to be ran as part of a code generation process. It ensures that the function is properly registered and can be invoked with the specified name. ## CLI Examples diff --git a/docs/building-with-graph-sitter/imports.mdx b/docs/building-with-graph-sitter/imports.mdx index 853dcab32..f3a383e16 100644 --- a/docs/building-with-graph-sitter/imports.mdx +++ b/docs/building-with-graph-sitter/imports.mdx @@ -20,7 +20,7 @@ for imp in file.imports: imp = file.get_import('math') # Grab and filter from a codebase -from codegen.sdk import ExternalModule +from graph_sitter.sdk import ExternalModule external_imports = [i for i in codebase.imports if isinstance(i, ExternalModule)] ``` diff --git a/docs/building-with-graph-sitter/parsing-codebases.mdx b/docs/building-with-graph-sitter/parsing-codebases.mdx index 413102ebc..d1a93c809 100644 --- a/docs/building-with-graph-sitter/parsing-codebases.mdx +++ b/docs/building-with-graph-sitter/parsing-codebases.mdx @@ -69,8 +69,8 @@ You can customize the behavior of your Codebase instance by passing a `CodebaseC ```python from graph_sitter import Codebase -from codegen.configs.models.codebase import CodebaseConfig -from codegen.configs.models.secrets import SecretsConfig +from graph_sitter.configs.models.codebase import CodebaseConfig +from graph_sitter.configs.models.secrets import SecretsConfig codebase = Codebase( "path/to/repository", @@ -97,9 +97,9 @@ Here's an example: ```python from graph_sitter import Codebase -from codegen.git.repo_operator.local_repo_operator import LocalRepoOperator -from codegen.git.schemas.repo_config import BaseRepoConfig -from codegen.sdk.codebase.config import ProjectConfig +from graph_sitter.git.repo_operator.local_repo_operator import LocalRepoOperator +from graph_sitter.git.schemas.repo_config import BaseRepoConfig +from graph_sitter.sdk.codebase.config import ProjectConfig codebase = Codebase( projects = [ diff --git a/docs/building-with-graph-sitter/traversing-the-call-graph.mdx b/docs/building-with-graph-sitter/traversing-the-call-graph.mdx index 369674ced..52815e7cb 100644 --- a/docs/building-with-graph-sitter/traversing-the-call-graph.mdx +++ b/docs/building-with-graph-sitter/traversing-the-call-graph.mdx @@ -30,9 +30,9 @@ Here's how to build a directed graph of function calls using NetworkX: ```python import networkx as nx -from codegen.sdk.core.interfaces.callable import FunctionCallDefinition -from codegen.sdk.core.function import Function -from codegen.sdk.core.external_module import ExternalModule +from graph_sitter.sdk.core.interfaces.callable import FunctionCallDefinition +from graph_sitter.sdk.core.function import Function +from graph_sitter.sdk.core.external_module import ExternalModule def create_call_graph(start_func, end_func, max_depth=5): G = nx.DiGraph() diff --git a/docs/graph-sitter/getting-started.mdx b/docs/graph-sitter/getting-started.mdx index aa38e1fa0..7c6dfce85 100644 --- a/docs/graph-sitter/getting-started.mdx +++ b/docs/graph-sitter/getting-started.mdx @@ -284,7 +284,7 @@ These flags are helpful for debugging problematic repos, optimizing Codegen’s ```python from graph_sitter import Codebase -from codegen.configs import CodebaseConfig +from graph_sitter.configs import CodebaseConfig # Initialize a Codebase with custom configuration codebase = Codebase( diff --git a/docs/introduction/advanced-settings.mdx b/docs/introduction/advanced-settings.mdx index 742d0262c..4aa48cc9c 100644 --- a/docs/introduction/advanced-settings.mdx +++ b/docs/introduction/advanced-settings.mdx @@ -27,7 +27,7 @@ You can customize the behavior of the graph construction process when initializi ```python from graph_sitter import Codebase -from codegen.configs import CodebaseConfig +from graph_sitter.configs import CodebaseConfig # Initialize a Codebase with custom configuration codebase = Codebase( @@ -216,7 +216,7 @@ This experimental flag pushes the graph creation back until the graph is needed. **Example Codemod:** ```python from graph_sitter import Codebase -from codegen.configs import CodebaseConfig +from graph_sitter.configs import CodebaseConfig # Enable lazy graph parsing codebase = Codebase("", config=CodebaseConfig(exp_lazy_graph=True)) diff --git a/docs/introduction/api.mdx b/docs/introduction/api.mdx index f87c77bce..82604e315 100644 --- a/docs/introduction/api.mdx +++ b/docs/introduction/api.mdx @@ -12,7 +12,7 @@ The [Codegen SDK](https://github.com/codegen-sh/graph-sitter) enables developers ```python -from codegen import Agent +from graph_sitter import Agent # Initialize the Agent with your organization ID and API token agent = Agent(org_id="...", token="...") diff --git a/docs/introduction/getting-started.mdx b/docs/introduction/getting-started.mdx index aa38e1fa0..7c6dfce85 100644 --- a/docs/introduction/getting-started.mdx +++ b/docs/introduction/getting-started.mdx @@ -284,7 +284,7 @@ These flags are helpful for debugging problematic repos, optimizing Codegen’s ```python from graph_sitter import Codebase -from codegen.configs import CodebaseConfig +from graph_sitter.configs import CodebaseConfig # Initialize a Codebase with custom configuration codebase = Codebase( diff --git a/docs/introduction/installation.mdx b/docs/introduction/installation.mdx index 52f53bda1..635df2163 100644 --- a/docs/introduction/installation.mdx +++ b/docs/introduction/installation.mdx @@ -22,7 +22,7 @@ We recommend using [uv](https://github.com/astral-sh/uv) for installation. If yo curl -LsSf https://astral.sh/uv/install.sh | sh ``` -## Installing Codegen +## Installing Graph-sitter ```bash uv tool install graph-sitter --python 3.13 @@ -30,7 +30,7 @@ uv tool install graph-sitter --python 3.13 -This makes the `codegen` command available globally in your terminal, while keeping its dependencies isolated. +This makes the `graph-sitter` command available globally in your terminal, while keeping its dependencies isolated. ## Quick Start @@ -83,7 +83,7 @@ Let's walk through a minimal example of using Graph-sitter in a project: Having issues? Here are some common problems and their solutions: - **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`. -- **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`. +- **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`. - **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)`. @@ -119,7 +119,7 @@ For more help, join our [community Slack](/introduction/community) or check the icon="hammer" href="/building-with-graph-sitter/at-a-glance" > - Learn more about building with Codegen + Learn more about building with Graph-sitter diff --git a/docs/introduction/overview.mdx b/docs/introduction/overview.mdx index c02d1d93c..02174af04 100644 --- a/docs/introduction/overview.mdx +++ b/docs/introduction/overview.mdx @@ -1,16 +1,16 @@ --- -title: "Codegen" +title: "Graph-sitter" sidebarTitle: "Overview" icon: "robot" iconType: "solid" --- -[Codegen](https://github.com/codegen-sh/graph-sitter) is a python library for manipulating codebases. +[Graph-sitter](https://github.com/codegen-sh/graph-sitter) is a python library for manipulating codebases. It provides a scriptable interface to a powerful, multi-lingual language server built on top of [Tree-sitter](https://tree-sitter.github.io/tree-sitter/). ```python -from codegen import Codebase +from graph_sitter import Codebase # Graph-sitter builds a complete graph connecting # functions, classes, imports and their relationships @@ -59,9 +59,9 @@ pipx install graph-sitter For further & more in depth installation instructions, see the [installation guide](/introduction/installation). -## What can I do with Codegen? +## What can I do with Graph-sitter? -Codegen's simple yet powerful APIs enable a range of applications, including: +Graph-sitter's simple yet powerful APIs enable a range of applications, including: -See below for an example call graph visualization generated with Codegen. +See below for an example call graph visualization generated with Graph-sitter.