The Codegen CLI helps you:

  • Initialize Codegen 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:
codegen init
  1. Create your first codemod:
codegen 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.

Was this page helpful?