> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heylua.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Preprocessors Command

> Manage message preprocessor primitives — view, deploy, activate, and delete versions

## Overview

`lua preprocessors` manages **preprocessor** primitives — code that runs **before** a user message reaches your agent. Use preprocessors for content filtering, routing, rate limiting, validation, and message rewriting.

```bash theme={null}
lua preprocessors                            # Interactive management
lua preprocessors view                       # List all preprocessors
lua preprocessors deploy --preprocessor-name myPre --preprocessor-version 1.0.3
```

<Note>
  For defining preprocessors in code, see the [Preprocessor concept](/overview/preprocessors) and the [Preprocessor API](/api/preprocessor).
</Note>

## Subcommands

| Action       | What it does                                            |
| ------------ | ------------------------------------------------------- |
| `view`       | List all preprocessors defined on the agent.            |
| `versions`   | List every version of a specific preprocessor.          |
| `deploy`     | Promote a version to active.                            |
| `activate`   | Re-enable a deactivated preprocessor.                   |
| `deactivate` | Pause execution — messages bypass this preprocessor.    |
| `delete`     | Permanently remove a preprocessor and all its versions. |

## Options

| Option                         | Description                                                   |
| ------------------------------ | ------------------------------------------------------------- |
| `--preprocessor-name <name>`   | Preprocessor name. Required for most non-interactive actions. |
| `--preprocessor-version <ver>` | Version for `deploy`. Pass `latest` for the newest.           |

<Note>
  The shorthand `pre` resolves to `preprocessor` in most argument positions — e.g. `lua pre view`, `lua logs --type pre`.
</Note>

## Examples

```bash theme={null}
# Interactive
lua preprocessors

# List everything
lua preprocessors view

# List versions
lua preprocessors versions --preprocessor-name myPre

# Promote a specific version
lua preprocessors deploy --preprocessor-name myPre --preprocessor-version 1.0.3
lua preprocessors deploy --preprocessor-name myPre --preprocessor-version latest

# Pause and resume
lua preprocessors deactivate --preprocessor-name myPre
lua preprocessors activate   --preprocessor-name myPre

# Delete
lua preprocessors delete --preprocessor-name oldPre
```

## Common Workflow

```bash theme={null}
# Edit src/preprocessors/profanity-filter.ts, then:
lua push preprocessor                                            # Build + upload
lua preprocessors versions --preprocessor-name profanityFilter   # Confirm
lua preprocessors deploy --preprocessor-name profanityFilter --preprocessor-version latest
lua logs --type preprocessor --name profanityFilter --limit 20   # Verify execution
```

## Related

* [Preprocessor Concept](/overview/preprocessors)
* [Preprocessor API](/api/preprocessor)
* [Postprocessors Command](/cli/postprocessors-command)
* [Logs Command](/cli/logs-command)
