Documentation menu

graph_sitter.cli

The Graph-sitter CLI helps you:

  • Parse a local repository into graph summary data
  • Diagnose parse time, memory use, and graph size for a local repository
  • Initialize Graph-sitter in your repository
  • Create and run codemods
  • Run one-shot transformations by import path
  • Work with AI assistance

For installation instructions, see our Getting Started guide.

Getting Started

  1. Parse a repository without project initialization:
graph-sitter parse . --format json

Run the same command from a published package with uvx:

uvx --python 3.13 graph-sitter parse . --format json

See uvx workflows for branch-built wheel validation and release gate details.

  1. Diagnose a repository with timing and memory stats:
uvx --python 3.13 graph-sitter diagnose .
  1. Initialize Graph-sitter in your repository:
graph-sitter init
  1. Create your first codemod:
graph-sitter 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

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.