The expert command gives you direct access to Codegen’s AI expert, which is specifically trained to help with codemods, transformations, and Codegen’s APIs.

Usage

codegen expert --query "your question here"

Options

  • --query, -q: The question to ask the expert

Examples

Ask about a specific API:

codegen expert -q "How do I use codebase.find_function() to locate all async functions?"

Get help with a transformation:

codegen expert -q "What's the best way to rename a function and all its references?"

Ask about best practices:

codegen expert -q "What's the recommended way to handle error cases in codemods?"

Use Cases

The expert is particularly helpful for:

  • Understanding Codegen’s APIs and capabilities
  • Getting guidance on codemod implementation strategies
  • Learning best practices for code transformations
  • Troubleshooting common issues
  • Finding the right approach for complex refactoring tasks

The expert has deep knowledge of Codegen’s internals and common transformation patterns. For general programming questions, consider using standard AI assistants instead.

Tips

  1. Be specific in your questions
  2. Include relevant context about your codebase or transformation
  3. Ask follow-up questions if needed
  4. Use code examples in your questions when applicable
  • codegen create: Create new codemods with AI assistance
  • codegen run: Execute your codemods
  • codegen docs-search: Search documentation and examples

Was this page helpful?