Skip to main content
The graph_sitter.cli helps you:
  • Initialize Graph-sitter in your repository
  • Create and run codemods
  • Work with AI assistance
For installation instructions, see our Getting Started guide.

Getting Started

  1. Initialize Codegen in your repository:
gs init
  1. Create your first codemod:
gs create my-codemod --description "What you want to accomplish"
The --description flag enables AI assistance to help generate your codemod. Be as specific as possible about what you want to achieve.

Available Commands

init

Initialize Graph-sitter in your repository.

create

Create new codemods with optional AI assistance.

run

Execute codemods with various options.

expert

Get help from the Graph-sitter AI expert.

Working with AI

When using Cursor, you can mention @codegen-sh in any chat or composer window to get:
  • Documentation about available APIs
  • Context about your active codemod
  • Examples of similar codemods
  • Relevant code snippets
The AI uses this context to provide accurate and helpful responses about working with Codegen.