> **Experimental**
>
> `@aws-cdk/aws-lambda-python-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# ICommandHooks

Command hooks.

These commands will run in the environment in which bundling occurs: inside
the container for Docker bundling or on the host OS for local bundling.

Commands are chained with `&&`.

```text
{
  // Run tests prior to bundling
  beforeBundling(inputDir: string, outputDir: string): string[] {
    return [`pytest`];
  }
  // ...
}
```

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/types.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-lambda-python-alpha/lib/types.ts#L128)

## Methods

- `afterBundling(inputDir: string, outputDir: string): string[]` — Returns commands to run after bundling.

  Commands are chained with `&&`.

- `beforeBundling(inputDir: string, outputDir: string): string[]` — Returns commands to run before bundling.

  Commands are chained with `&&`.
