Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ jobs:
uses: ./.github/actions/setup-environment

- name: Generate API reference
run: uv run python src/graph-sitter/gscli/cli.py generate docs
run: uv run python src/graph_sitter/gscli/cli.py generate docs

- name: Generate System Prompt
run: uv run python src/graph-sitter/gscli/cli.py generate system-prompt
run: uv run python src/graph_sitter/gscli/cli.py generate system-prompt

- name: Commit changes
run: |
git config --local user.email ${{ secrets.DOCS_USER_EMAIL }}
git config --local user.name ${{ secrets.DOCS_USER_NAME }}
git add docs/ src/codegen/sdk/system-prompt.txt
git add docs/ src/graph_sitter/system-prompt.txt
git diff --staged --quiet || git commit -m "docs: updated API reference"

- name: Push changes
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<br />

<p align="center">
<a href="https://docs.codegen.com">
<a href="https://graph-sitter.com">
<img src="https://i.imgur.com/6RF9W0z.jpeg" />
</a>
</p>
Expand All @@ -13,7 +13,7 @@
<div align="center">

[![PyPI](https://img.shields.io/badge/PyPi-codegen-gray?style=flat-square&color=blue)](https://pypi.org/project/codegen/)
[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com)
[![Documentation](https://img.shields.io/badge/Docs-graph-sitter.com-purple?style=flat-square)](https://graph-sitter.com)
[![Slack Community](https://img.shields.io/badge/Slack-Join-4A154B?logo=slack&style=flat-square)](https://community.codegen.com)
[![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file)
[![Follow on X](https://img.shields.io/twitter/follow/codegen?style=social)](https://x.com/codegen)
Expand All @@ -22,7 +22,7 @@

<br />

[Codegen](https://docs.codegen.com) is a python library for manipulating codebases.
[Codegen](https://graph-sitter.com) is a python library for manipulating codebases.

```python
from codegen import Codebase
Expand All @@ -49,7 +49,7 @@ We support
- macOS and Linux
- macOS is supported
- Linux is supported on x86_64 and aarch64 with glibc 2.34+
- Windows is supported via WSL. See [here](https://docs.codegen.com/building-with-codegen/codegen-with-wsl) for more details.
- Windows is supported via WSL. See [here](https://graph-sitter.com/building-with-codegen/codegen-with-wsl) for more details.
- Python, Typescript, Javascript and React codebases

```
Expand All @@ -73,7 +73,7 @@ gs notebook

## Usage

See [Getting Started](https://docs.codegen.com/introduction/getting-started) for a full tutorial.
See [Getting Started](https://graph-sitter.com/introduction/getting-started) for a full tutorial.

```
from codegen import Codebase
Expand All @@ -91,8 +91,8 @@ If you run into additional issues not listed here, please [join our slack commun

## Resources

- [Docs](https://docs.codegen.com)
- [Getting Started](https://docs.codegen.com/introduction/getting-started)
- [Docs](https://graph-sitter.com)
- [Getting Started](https://graph-sitter.com/introduction/getting-started)
- [Contributing](CONTRIBUTING.md)
- [Contact Us](https://codegen.com/contact)

Expand Down
14 changes: 7 additions & 7 deletions codegen-examples/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Codegen Examples

[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com)
[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com)

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.

## Setup

We recommend using [`uv`](https://github.com/astral-sh/uv) with Python 3.13 for the best experience.

To install Codegen, please follow the [official installation guide](https://docs.codegen.com/introduction/installation). Once Codegen is installed, use these steps to run the examples in this repository:
To install Codegen, please follow the [official installation guide](https://graph-sitter.com/introduction/installation). Once Codegen is installed, use these steps to run the examples in this repository:

Install the graph_sitter.cli globally

Expand All @@ -32,7 +32,7 @@ Your environment is now ready to run example codemods.

### IDE Configuration (Optional)

To configure your IDE for optimal use with Codegen, follow our [IDE setup guide](https://docs.codegen.com/introduction/ide-usage#configuring-your-ide-interpreter).
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).

## Examples

Expand All @@ -46,10 +46,10 @@ To see a transformation, simply run the `run.py` script within the desired direc

## Learn More

- [Documentation](https://docs.codegen.com)
- [Getting Started Guide](https://docs.codegen.com/introduction/getting-started)
- [Tutorials](https://docs.codegen.com/tutorials/at-a-glance)
- [API Reference](https://docs.codegen.com/api-reference)
- [Documentation](https://graph-sitter.com)
- [Getting Started Guide](https://graph-sitter.com/introduction/getting-started)
- [Tutorials](https://graph-sitter.com/tutorials/at-a-glance)
- [API Reference](https://graph-sitter.com/api-reference)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions codegen-examples/examples/ai_impact_analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ After running the analysis, symbols in the codebase will have the following attr

## Learn More

- [Attributions](https://docs.codegen.com/tutorials/attributions)
- [Codegen Documentation](https://docs.codegen.com)
- [Attributions](https://graph-sitter.com/tutorials/attributions)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ The dashboard will display:

## Learn More

- [AI Impact Analysis Documentation](https://docs.codegen.com/tutorials/attributions)
- [Codegen Documentation](https://docs.codegen.com)
- [AI Impact Analysis Documentation](https://graph-sitter.com/tutorials/attributions)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions codegen-examples/examples/codegen-mcp-server/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Codegen MCP Server

<p align="center">
<a href="https://docs.codegen.com">
<a href="https://graph-sitter.com">
<img src="https://i.imgur.com/6RF9W0z.jpeg" />
</a>
</p>
Expand All @@ -13,7 +13,7 @@

<div align="center">

[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com)
[![Documentation](https://img.shields.io/badge/Docs-graph-sitter.com-purple?style=flat-square)](https://graph-sitter.com)
[![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file)

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Please read two things before trying to install this codegen MCP server:

- This contains the instructions for setting up the mcp server

2. [Documentation Index for Agents](https://docs.codegen.com/llms.txt)
2. [Documentation Index for Agents](https://graph-sitter.com/llms.txt)

- This contains a list of urls to the documentation for topics related to creating codegen codemods

Please use a CURL command to retrieve the contents of the readme and documentation and read both before starting to install the server.

1. curl -sL "https://raw.githubusercontent.com/codegen-sh/graph-sitter/refs/heads/develop/README.md" | cat

1. curl -sL "https://docs.codegen.com/llms.txt" | cat
1. curl -sL "https://graph-sitter.com/llms.txt" | cat

This should give you all the context you need to successfully install and utilize the server.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ python run.py
## Learn More

- [About Cyclomatic Complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity)
- [Codegen Documentation](https://docs.codegen.com)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions codegen-examples/examples/delete_dead_code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ python run.py

## Learn More

- [Deleting Dead Code](https://docs.codegen.com/tutorials/deleting-dead-code)
- [Codegen Documentation](https://docs.codegen.com)
- [Deleting Dead Code](https://graph-sitter.com/tutorials/deleting-dead-code)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion codegen-examples/examples/dict_to_schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ python run.py
## Learn More

- [Pydantic Documentation](https://docs.pydantic.dev/)
- [Codegen Documentation](https://docs.codegen.com)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions codegen-examples/examples/document_functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ The script provides detailed progress information:

## Learn More

- [Creating Documentation](https://docs.codegen.com/tutorials/creating-documentation#creating-documentation)
- [Codegen Documentation](https://docs.codegen.com)
- [Creating Documentation](https://graph-sitter.com/tutorials/creating-documentation#creating-documentation)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Flask to FastAPI Migration Example

[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com/tutorials/flask-to-fastapi)
[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com/tutorials/flask-to-fastapi)

This example demonstrates how to use Codegen to automatically migrate a Flask application to FastAPI. For a complete walkthrough, check out our [tutorial](https://docs.codegen.com/tutorials/flask-to-fastapi).
This example demonstrates how to use Codegen to automatically migrate a Flask application to FastAPI. For a complete walkthrough, check out our [tutorial](https://graph-sitter.com/tutorials/flask-to-fastapi).

## What This Example Does

Expand Down Expand Up @@ -70,7 +70,7 @@ The script will process all Python files in the `repo-before` directory and appl

## Learn More

- [Full Tutorial](https://docs.codegen.com/tutorials/flask-to-fastapi)
- [Full Tutorial](https://graph-sitter.com/tutorials/flask-to-fastapi)
- [Flask Documentation](https://flask.palletsprojects.com/)
- [FastAPI Documentation](https://fastapi.tiangolo.com/)
- [Codegen Documentation](https://docs.codegen.com)
- [Codegen Documentation](https://graph-sitter.com)
4 changes: 2 additions & 2 deletions codegen-examples/examples/fragment_to_shorthand/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ The script will:

- [React Fragments](https://react.dev/reference/react/Fragment)
- [JSX Fragments](https://react.dev/reference/jsx#jsx-fragments)
- [Codegen Documentation](https://docs.codegen.com)
- [More on Codegen SDK jsx elements API](https://docs.codegen.com/api-reference/typescript/JSXElement#jsxelement)
- [Codegen Documentation](https://graph-sitter.com)
- [More on Codegen SDK jsx elements API](https://graph-sitter.com/api-reference/typescript/JSXElement#jsxelement)

## Contributing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ python run.py

- [TimeMachine Documentation](https://github.com/adamchainz/time-machine)
- [FreezeGun Documentation](https://github.com/spulec/freezegun)
- [Codegen Documentation](https://docs.codegen.com)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions codegen-examples/examples/generate_training_data/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generate Codebase Pre-Training Data

[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com/tutorials/generate-training-data)
[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com/tutorials/generate-training-data)

This example demonstrates how to use Codegen to generate training data for large-scale LLM pre-training by extracting function implementations along with their dependencies and usages. The approach is inspired by node2vec, leveraging code graphs for learning.

Expand Down Expand Up @@ -87,6 +87,6 @@ The generated `training_data.json` follows this structure:

## Learn More

- [Full Tutorial](https://docs.codegen.com/tutorials/generate-training-data)
- [Code Model Pre-training](https://docs.codegen.com/concepts/code-model-training)
- [Codegen Documentation](https://docs.codegen.com)
- [Full Tutorial](https://graph-sitter.com/tutorials/generate-training-data)
- [Code Model Pre-training](https://graph-sitter.com/concepts/code-model-training)
- [Codegen Documentation](https://graph-sitter.com)
4 changes: 2 additions & 2 deletions codegen-examples/examples/github_checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ The analysis results are posted as a markdown-formatted comment on the pull requ

## Learn More

- [Codegen Documentation](https://docs.codegen.com)
- [Detecting Import Loops](https://docs.codegen.com/blog/fixing-import-loops)
- [Codegen Documentation](https://graph-sitter.com)
- [Detecting Import Loops](https://graph-sitter.com/blog/fixing-import-loops)

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions codegen-examples/examples/modal_repo_rag/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Codegen RAG Q&A API

<p align="center">
<a href="https://docs.codegen.com">
<a href="https://graph-sitter.com">
<img src="https://i.imgur.com/6RF9W0z.jpeg" />
</a>
</p>
Expand All @@ -12,7 +12,7 @@

<div align="center">

[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com)
[![Documentation](https://img.shields.io/badge/Docs-graph-sitter.com-purple?style=flat-square)](https://graph-sitter.com)
[![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file)

</div>
Expand Down Expand Up @@ -115,6 +115,6 @@ Required environment variables:

## Learn More

- [Codegen Documentation](https://docs.codegen.com)
- [Codegen Documentation](https://graph-sitter.com)
- [Modal Documentation](https://modal.com/docs)
- [VectorIndex Tutorial](https://docs.codegen.com/building-with-codegen/semantic-code-search)
- [VectorIndex Tutorial](https://graph-sitter.com/building-with-codegen/semantic-code-search)
4 changes: 2 additions & 2 deletions codegen-examples/examples/modules_dependencies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ You can customize the analysis by:

- [NetworkX Documentation](https://networkx.org/)
- [Python Import System](https://docs.python.org/3/reference/import.html)
- [Codegen Documentation](https://docs.codegen.com)
- [Graph visualization](https://docs.codegen.com/building-with-codegen/codebase-visualization)
- [Codegen Documentation](https://graph-sitter.com)
- [Graph visualization](https://graph-sitter.com/building-with-codegen/codebase-visualization)

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion codegen-examples/examples/openapi_decorators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ The script will:

- [Flask-RESTx Documentation](https://flask-restx.readthedocs.io/)
- [OpenAPI Specification](https://swagger.io/specification/)
- [Codegen Documentation](https://docs.codegen.com)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions codegen-examples/examples/python2_to_python3/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Python 2 to Python 3 Migration Example

[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com/tutorials/python2-to-python3)
[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com/tutorials/python2-to-python3)

This example demonstrates how to use Codegen to automatically migrate Python 2 code to Python 3. For a complete walkthrough, check out our [tutorial](https://docs.codegen.com/tutorials/python2-to-python3).
This example demonstrates how to use Codegen to automatically migrate Python 2 code to Python 3. For a complete walkthrough, check out our [tutorial](https://graph-sitter.com/tutorials/python2-to-python3).

## What This Example Does

Expand Down Expand Up @@ -94,7 +94,7 @@ The script will process all Python files in the `repo-before` directory and appl

## Learn More

- [Full Tutorial](https://docs.codegen.com/tutorials/python2-to-python3)
- [Full Tutorial](https://graph-sitter.com/tutorials/python2-to-python3)
- [Python 3 Documentation](https://docs.python.org/3/)
- [What's New in Python 3](https://docs.python.org/3/whatsnew/3.0.html)
- [Codegen Documentation](https://docs.codegen.com)
- [Codegen Documentation](https://graph-sitter.com)
6 changes: 3 additions & 3 deletions codegen-examples/examples/reexport_management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ The script will:

- [TypeScript Modules](https://www.typescriptlang.org/docs/handbook/modules.html)
- [Export/Import Documentation](https://www.typescriptlang.org/docs/handbook/modules.html#export)
- [Codegen Documentation](https://docs.codegen.com)
- [Tutorial on Analyzing and Organizing Re-exports](https://docs.codegen.com/tutorials/managing-typescript-exports)
- [More on exports ](https://docs.codegen.com/building-with-codegen/exports)
- [Codegen Documentation](https://graph-sitter.com)
- [Tutorial on Analyzing and Organizing Re-exports](https://graph-sitter.com/tutorials/managing-typescript-exports)
- [More on exports ](https://graph-sitter.com/building-with-codegen/exports)

## Contributing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ python run.py
## Learn More

- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
- [Codegen Documentation](https://docs.codegen.com)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
6 changes: 3 additions & 3 deletions codegen-examples/examples/repo_analytics/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Repository Analytics

This example demonstrates how to use Codegen to analyze repository metrics and generate comprehensive codebase analytics. For a complete walkthrough, check out our [tutorial](https://docs.codegen.com/tutorials/codebase-analytics-dashboard).
This example demonstrates how to use Codegen to analyze repository metrics and generate comprehensive codebase analytics. For a complete walkthrough, check out our [tutorial](https://graph-sitter.com/tutorials/codebase-analytics-dashboard).

## How the Analytics Script Works

Expand Down Expand Up @@ -132,8 +132,8 @@ The script will output a detailed report including:

## Learn More

- [Analytics Tutorial](https://docs.codegen.com/tutorials/codebase-analytics-dashboard)
- [Codegen Documentation](https://docs.codegen.com)
- [Analytics Tutorial](https://graph-sitter.com/tutorials/codebase-analytics-dashboard)
- [Codegen Documentation](https://graph-sitter.com)

## Contributing

Expand Down
Loading