> ## Documentation Index
> Fetch the complete documentation index at: https://codegeninc-codegen-bot-sdk-docs-2-0.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Expert Command

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

```bash
codegen expert --query "your question here"
```

## Options

* `--query`, `-q`: The question to ask the expert

## Examples

Ask about a specific API:

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

Get help with a transformation:

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

Ask about best practices:

```bash
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

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

## 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

## Related Commands

* `codegen create`: Create new codemods with AI assistance
* `codegen run`: Execute your codemods
* `codegen docs-search`: Search documentation and examples
