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

> Print the local or deployed persona, list persona versions, and make a version live in production

`lua persona` inspects the [persona](/concepts/persona) in your code and the persona versions on the server, and makes one version live. Deploying changes the persona for every end user immediately.

*Verified against lua-cli 3.33.0.*

## Synopsis

```bash theme={null}
lua persona [sandbox|production] [view|versions|deploy] [--persona-version <n>|latest] [--force]
```

## Description

The persona is the `persona` field of your [`LuaAgent`](/reference/sdk/luaagent). [`lua push agent`](/reference/cli/push) uploads it and creates a numbered persona version (an integer, not a semver). `lua persona` works on those versions.

With no arguments the command asks for an environment and opens a menu.

`lua persona sandbox view` prints the persona from the compiled manifest in `dist-v2/` and exits; run [`lua compile`](/reference/cli/compile) first. Any other `sandbox` form opens a menu whose entries are: view the full text; edit it in your editor, which rewrites the `persona` value in your source; create a version, which uploads the text as a new persona version; and list versions.

`lua persona production view` prints the deployed version number, date, creator, and text. `production versions` lists every version newest first, marking the deployed one `⭐ CURRENT` and unpublished ones `[DRAFT]`. `production deploy --persona-version <n>` makes that version live; `latest` picks the newest. It asks for confirmation (default No) unless `--force` is given, and prints `✅ Persona version <n> deployed successfully to production`. Deploying the version that is already live prints `ℹ️  Version <n> is already deployed.` and changes nothing, with exit `0`.

`lua deploy persona --set-version <n|latest> --force` is the same operation from [`lua deploy`](/reference/cli/deploy). `lua push agent` also offers to deploy the version it just created (default No); `--auto-deploy` deploys without asking, and `--force` alone skips the question. Either way the pushed persona is already served from the agent's next message, so that deploy changes nothing; `production deploy` matters when you switch back to an earlier version, which `lua version promote` does not do.

Every form needs a project directory and a credential.

## Arguments

| Argument | Values                       | Description                                                                     |
| -------- | ---------------------------- | ------------------------------------------------------------------------------- |
| `env`    | `sandbox`, `production`      | Prompted for when omitted.                                                      |
| `action` | `view`, `versions`, `deploy` | Non-interactive for `production`; only `view` is non-interactive for `sandbox`. |

Accepted spellings: `staging`, `stage`, `stg`, `sb` → `sandbox`; `prod`, `prd`, `live` → `production`; `show`, `info` → `view`; `list-versions`, `history` → `versions`; `publish` → `deploy`.

## Options

| Option                  | Description                                                                | Default |
| ----------------------- | -------------------------------------------------------------------------- | ------- |
| `--persona-version <n>` | Version number to deploy, or `latest`. Required for `deploy`.              | —       |
| `--force`               | Skip the `deploy` confirmation.                                            | off     |
| `--ci`                  | Global flag. Refuse any prompt with exit `1` instead of waiting for input. | off     |

## Examples

Print the persona from your compiled code.

```bash theme={null}
lua persona sandbox view
```

```text Output theme={null}
You are Acme Helpdesk Triage. Create, look up and escalate support tickets. Be concise, confirm ticket ids, never ask for passwords.
```

List the persona versions on the server.

```bash theme={null}
lua persona production versions
```

```text Output theme={null}
============================================================
🌙 Persona Versions
============================================================

  Version 3 - 12/09/2026 13:49:48 ⭐ CURRENT
  Version 2 - 12/09/2026 13:29:45
  Version 1 - 12/09/2026 13:27:53

============================================================
Total: 3 version(s)
```

Print the deployed persona.

```bash theme={null}
lua persona production view
```

```text Output theme={null}
============================================================
🤖 Current Production Persona
============================================================

Version: 3 ⭐
Deployed: 12/09/2026, 13:49:48
Created by: system

------------------------------------------------------------

You are Acme Helpdesk Triage. Create, look up and escalate support tickets. Be concise, confirm ticket ids, never ask for passwords.

============================================================
```

Make the newest version live from CI, then roll back to version 2.

```bash theme={null}
lua persona production deploy --persona-version latest --force --ci
lua persona production deploy --persona-version 2 --force --ci
```

## Exit codes

| Code | Meaning     | When                                                                                                                                                    |
| ---- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0`  | OK          | The action completed, including a `deploy` of the version that is already live.                                                                         |
| `1`  | Error       | The versions could not be loaded, the server refused the deploy, or a prompt was needed under `--ci` (`deploy` without `--force`, or a `sandbox` menu). |
| `2`  | Usage       | Unknown environment or action, `deploy` without `--persona-version`, or a version that is not a number or `latest`.                                     |
| `3`  | Not found   | `--persona-version` names a version that does not exist, or `latest` with no versions.                                                                  |
| `9`  | Auth        | No valid credential.                                                                                                                                    |
| `10` | Forbidden   | The credential cannot manage this agent.                                                                                                                |
| `11` | Unavailable | Network error or a server 5xx.                                                                                                                          |

The full table is in [Errors and exit codes](/reference/cli/errors-and-exit-codes).

## See also

* [About the persona](/concepts/persona) — writing guidance and channel-specific personas
* [`lua push`](/reference/cli/push) — `lua push agent` creates persona versions
* [`lua deploy`](/reference/cli/deploy) — `lua deploy persona`
* [`lua production`](/reference/cli/production) — the deployed persona in the production summary
* [Release an agent](/ship/releasing)
