Skip to main content
Learn how to use Codegen’s core APIs to analyze and transform code.

Core Concepts

Parsing Codebases

Understand how Codegen parses and analyzes different programming languages.

Files & Directories

Learn how to work with files, directories, and navigate the codebase structure.

The Editable API

Learn how to safely modify code while preserving formatting and comments.

Symbols, Functions and Classes

Master the core abstractions for manipulating code safely and effectively.

Dependencies & Usages

Analyze relationships between code elements and track symbol references.

Function Calls & Callsites

Understand function call patterns and manipulate call sites.

Imports

Work with module imports and manage dependencies.

Traversing the Call Graph

Navigate function call relationships and analyze code flow.

Code Manipulation

Moving Symbols

Relocate functions, classes, and other symbols while updating references.

Statements & Code Blocks

Work with code blocks, control flow, and statement manipulation.

Variable Assignments

Handle variable declarations, assignments, and scope.

Collections

Work with groups of related code elements like functions, classes, and imports.

Special Features

React & JSX

Work with React components, JSX syntax, and component transformations.

Local Variables

Analyze and manipulate local variable usage and scope.

Calling Out to LLMs

Integrate AI assistance into your code transformations.

Codebase Visualization

Visualize code relationships and dependencies.
Each guide includes practical examples and best practices. Start with core concepts or jump directly to the topics most relevant to your needs.