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

# lua deploy

> Make a pushed version of one primitive live in production

`lua deploy` makes one already-pushed version of a primitive the version production serves. It takes effect for every end user as soon as the command reports success, for every type on any agent. A deployed skill is the one exception in durability: the next [`lua version promote`](/reference/cli/version) resets every skill to the version pinned in the promoted [agent version](/concepts/releases-and-versions), so a skill deployed without a new agent version is reverted by the next promote.

*Verified against lua-cli 3.33.0.*

## Synopsis

```bash theme={null}
lua deploy <type> [--name <name>] [--set-version <ver>|latest] [--force]
lua deploy all --force
```

## Description

The command reads the primitive's versions from the server, selects one, asks for confirmation, and deploys it. `--set-version latest` selects the most recently created version, not the highest semver. Persona versions are integers. The deployed version is written back to [`lua.skill.yaml`](/reference/cli/lua-skill-yaml). The primitive must have been pushed: a row without an id, or an entity with no versions, fails with a `Push it first using: lua push <type>` message.

How the change reaches production depends on the primitive and on whether the agent has [agent versions](/concepts/releases-and-versions). `lua push skill` uploads a version and changes nothing for end users; `lua deploy skill --name <skill> --set-version <v>` serves that version from the agent's next turn, on any agent, but the next `lua version promote` resets every skill to the version pinned in the promoted agent version. A pushed persona is already served from the agent's next message, so `lua deploy persona` is the persona's rollback, and `lua version promote` does not change the served persona.

| Type                                                         | Agent under versioning                                                                                                   | Agent with no version     | Agent version created?                                       | Success line                                                                                                                        | Rollback                                                                                                  |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `skill`                                                      | Sets the skill's active version, served from the next turn; the next `lua version promote` resets it to the promoted pin | Served from the next turn | No                                                           | `✅ Skill "<name>" v<version> deployed successfully`                                                                                 | `lua deploy skill --set-version <old>`; durable change: push, `lua version create`, `lua version promote` |
| `webhook`, `job`, `preprocessor`, `postprocessor`, `trigger` | Creates an agent version identical to the active one except this primitive, and promotes it                              | Served directly           | Yes, under versioning                                        | `✔ deployed <name>@<version> — agent version <n> promoted`; without versioning `✅ <Type> "<name>" v<version> deployed successfully` | `lua version promote <previous>`, or deploy the earlier version                                           |
| `persona`                                                    | Switches the served persona at once; `lua version promote` records but does not change it                                | Switches at once          | No                                                           | `✅ Persona v<n> deployed successfully`                                                                                              | `lua deploy persona --set-version <old>`                                                                  |
| `all`                                                        | Each listed primitive as in its row, then the latest persona version                                                     | Each switched directly    | One per webhook, job, processor, or trigger under versioning | One line per item, then `✅ Deployed <n> primitives successfully`                                                                    | `lua version promote <previous>` plus `lua deploy persona --set-version <old>`                            |

To switch several primitives atomically, or to roll back everything except the persona, promote an agent version. The per-primitive spellings `lua skills deploy`, `lua jobs deploy`, and `lua webhooks deploy` neither write the version back to `lua.skill.yaml` nor print the agent version. `--ci` does not stop the version picker or the confirmation; pass `--set-version` and `--force`. The type menu and the entity picker do exit 1 under `--ci`; pass the type and `--name`.

`lua deploy all --force` deploys the most recently created version of every skill, webhook, trigger, job, preprocessor, and postprocessor listed in `lua.skill.yaml`, then the latest persona version, with the same per-type behavior. Items without an id or without versions are skipped with a note. Failures are summarized with `Re-deploy failed items with: lua deploy all --force`, and the command exits 0 either way.

The confirmation prompt states the impact, `This version will be deployed to all users.` Declining exits 0 with `Deployment cancelled.`

## Arguments

| Argument | Values                                                                                  | Description                                                                                                                                         |
| -------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`   | `skill`, `webhook`, `trigger`, `job`, `preprocessor`, `postprocessor`, `persona`, `all` | Prompted when omitted; the menu does not list `trigger`, so pass it explicitly. Plurals, `pre`, `post`, `pp`, `hook`, and `everything` are accepted |

## Options

| Option                  | Description                                                     | Default                    |
| ----------------------- | --------------------------------------------------------------- | -------------------------- |
| `--name <name>`         | Entity to deploy                                                | prompt, or the only entity |
| `--set-version <ver>`   | Version to deploy, or `latest` for the most recently created    | prompt                     |
| `--force`               | Skip the confirmation; required by `all`                        | prompt                     |
| `--skill-name <name>`   | Deprecated: use `--name`. Implies `skill` when no type is given | —                          |
| `--skill-version <ver>` | Deprecated: use `--set-version`                                 | —                          |

## Examples

Deploy a specific skill version without prompts:

```bash theme={null}
lua deploy skill --name tickets --set-version 1.1.0 --force --ci
```

Deploy the newest pushed webhook version:

```bash theme={null}
lua deploy webhook --name ticket-status-webhook --set-version latest --force --ci
```

Switch the served persona back to version 3 (a pushed persona is served without a deploy):

```bash theme={null}
lua deploy persona --set-version 3 --force --ci
```

Deploy the newest version of everything after `lua push all --force`:

```bash theme={null}
lua deploy all --force --ci
```

Roll a skill back by deploying its previous version:

```bash theme={null}
lua deploy skill --name tickets --set-version 1.0.9 --force --ci
```

## Exit codes

| Code | When                                                                                                                                                                                             |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `0`  | Deployed; a declined confirmation; an `all` run in which some items failed                                                                                                                       |
| `1`  | No project (`No lua.skill.yaml found. Please run this command from a skill directory.`); unknown `--name` or version; nothing pushed yet; `all` without `--force`; the server refused the deploy |
| `2`  | Unknown type                                                                                                                                                                                     |
| `9`  | No credential, or the platform refused it                                                                                                                                                        |
| `10` | The credential may not deploy to this agent                                                                                                                                                      |
| `11` | Platform or network unavailable                                                                                                                                                                  |

## See also

* [Release an agent](/ship/releasing)
* [`lua version`](/reference/cli/version) — create, promote, roll back
* [`lua push`](/reference/cli/push)
* [Releases and versions](/concepts/releases-and-versions)
