> ## Documentation Index
> Fetch the complete documentation index at: https://codegeninc-tawsif-change-additional-tools-to-tools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Command

The `run` command executes a codemod against your local codebase, showing you the changes and applying them to your filesystem.

```bash
codegen run rename-function
```

## Usage

```bash
codegen run LABEL [OPTIONS]
```

## Arguments

* `LABEL`: The name of the codemod to run (e.g., "rename-function")

## Options

* `--diff-preview N`: Show a preview of the first N lines of the diff
* `--arguments JSON`: Pass arguments to the codemod as a JSON string (required if the codemod expects arguments)

## Examples

Run a codemod:

```bash
codegen run rename-function
```

Run with a diff preview limited to 50 lines:

```bash
codegen run rename-function --diff-preview 50
```

Run with arguments (for codemods that require them):

```bash
codegen run rename-function --arguments '{"old_name": "getUserData", "new_name": "fetchUserProfile"}'
```

## Output

The command will:

1. Parse your codebase
2. Run the codemod
3. Show a diff preview (if requested)
4. Apply changes to your filesystem

## Execution Flow

When you run a codemod:

1. Codegen parses your entire codebase into a graph representation
2. The codemod function is executed against this graph
3. Any changes made by the codemod are tracked
4. Changes are automatically applied to your local files
5. A summary of changes is displayed

<Note>
  The codebase parsing step may take a few moments for larger codebases. Learn more in [How it Works](/introduction/how-it-works.mdx)
</Note>
