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

> Marketplace skills and agent templates: every skill and template action with its flags, which need --force, and which print JSON

`lua marketplace` publishes and installs [marketplace skills](/marketplace/skills) and [agent templates](/concepts/agent-templates). `template publish` and `template apply` change other people's agents; the rest acts on listings or on the current agent.

*Verified against lua-cli 3.33.0.*

## Synopsis

```bash theme={null}
lua marketplace [noun] [action] [options]
lua marketplace skill <list|publish|edit|unlist|unpublish|transfer|mine|org|search|view|install|update|uninstall|installed>
lua marketplace template <create|draft|publish|view|versions|install|apply|status|health|installed|uninstall>
```

## Description

The noun picks the domain: a marketplace skill is one reusable skill listed for other agents to install; an agent template is a frozen, versioned copy of a whole agent that other agents install and that its creator can push updates to. Without a noun or an action the command offers a menu; `skill view` and `template health` exist only as non-interactive actions.

Three flags carry the same meaning everywhere. `--force` confirms the actions that otherwise stop and ask for it: `skill unlist`, `unpublish`, `transfer`, `install`, `uninstall`, and `template install`, `uninstall`; `template apply` asks `Apply v<n> to <k> agent(s)?` in a terminal and needs `--force` under `--ci`. `template draft --force` instead replaces the authored `template:` sections wholesale. `--yes` confirms only the publish consequence prompt. `--json` is honored by the skill read actions `mine`, `org`, `search`, `view`, `installed` and by every template action except `uninstall`; `skill installed --json` prints a text line, not `[]`, when nothing is installed.

Under `--ci` any prompt fails with `✖ error: Interactive prompt required but --ci flag is set. Provide all required flags or arguments.` (exit 1); pass `--template-id` and, for `template create`, all four of `--name`, `--display-name`, `--description` and `--visibility`. The authored `template:` section of `lua.skill.yaml` is documented in the [template manifest](/marketplace/manifest).

<Warning>
  `template publish` pushes the new version onto every install that consented to creator updates unless you pass `--skip-auto-apply`, and `template apply` rewrites the target agents' live versions. Check `template status` first and keep `lua version promote <n>` in mind as the per-agent rollback.
</Warning>

## Arguments

| Argument | Values                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `noun`   | `skill`, `template`        | Aliases: `skills` → `skill`; `templates`, `agent-template`, `agent-templates` → `template`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `action` | A skill or template action | Skill aliases: `ls`, `l` → `list`; `new`, `submit` → `publish`; `modify` → `edit`; `hide`, `delist` → `unlist`; `retract`, `deprecate` → `unpublish`; `move` → `transfer`; `my`, `my-listings`, `listed`, `authored` → `mine`; `organization`, `managed`, `owned` → `org`; `find` → `search`; `show`, `info`, `details` → `view`; `add` → `install`; `upgrade` → `update`; `remove`, `rm`, `delete` → `uninstall`. Template aliases: `new` → `create`; `compose` → `draft`; `submit`, `publish_version` → `publish`; `show`, `info`, `details` → `view`; `history` → `versions`; `add` → `install`; `deploy`, `rollout`, `fleet-apply` → `apply`; `fleet-health` → `health`; `ls`, `list` → `installed`; `remove`, `rm`, `delete` → `uninstall` |

### Skill actions

| Action      | Flags                                                                   | Description                                                                                                                              |
| ----------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `list`      | `--skill-name` `--display-name` \[`--visibility public\|private`]       | List one of the agent's skills on the marketplace; prints the marketplace skill id                                                       |
| `publish`   | `--marketplace-id` `--version-id` \[`--changelog`] \[`--env-vars-json`] | Publish a version for review                                                                                                             |
| `edit`      | `--marketplace-id` `--display-name`                                     | Change the display name                                                                                                                  |
| `unlist`    | `--marketplace-id` `--force`                                            | Hide the listing; `list` re-lists it                                                                                                     |
| `unpublish` | `--marketplace-id` `--version-id` `--force`                             | Withdraw one version                                                                                                                     |
| `transfer`  | `--marketplace-id` `--new-org-id` `--force`                             | Hand the listing to another organization                                                                                                 |
| `mine`      | \[`--json`]                                                             | Skills you authored                                                                                                                      |
| `org`       | \[`--json`]                                                             | Skills the agent's organization owns                                                                                                     |
| `search`    | \[`--query`] \[`--page`] \[`--limit`] \[`--json`]                       | Search published skills                                                                                                                  |
| `view`      | `--marketplace-id` \[`--json`]                                          | One listing with its versions                                                                                                            |
| `install`   | `--marketplace-id` `--version-id` \[`--env-vars`] `--force`             | Install onto the agent as an active skill; then `lua version create` and `lua version promote <n>` so the live agent version includes it |
| `update`    | `--skill-name` \[`--version-id`] \[`--env-vars`]                        | Change an installed skill's version or env values; one of the two is required                                                            |
| `uninstall` | `--skill-name` `--force`                                                | Remove an installed skill                                                                                                                |
| `installed` | \[`--json`]                                                             | Skills installed on the agent                                                                                                            |

### Template actions

| Action      | Flags                                                                                                                         | Description                                                                                                                                                                                                                                     |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `create`    | `--name` `--display-name` \[`--description`] \[`--visibility public\|private`] \[`--json`]                                    | Create a template from the current agent; prints the template id                                                                                                                                                                                |
| `draft`     | `--template-id` \[`--source-version <n>`] \[`--force`] \[`--json`]                                                            | Write the `template:` section of `lua.skill.yaml` from the server's inference; merges additively and prints the added and kept keys. It writes six of the seven sections: a hand-written `installPolicy` is dropped, so re-add it after a draft |
| `publish`   | `--template-id` \[`--source-version <n>`] \[`--changelog`] \[`--env-contract`]… \[`--skip-auto-apply`] \[`--yes`] \[`--json`] | Freeze a template version from an agent version together with the authored sections; prints `✅ Published v<n>` and an `Auto-update:` line                                                                                                       |
| `view`      | `--template-id` \[`--version <n>`] \[`--json`]                                                                                | The template, or one version's manifest and env contract                                                                                                                                                                                        |
| `versions`  | `--template-id` \[`--json`]                                                                                                   | Every version, newest first                                                                                                                                                                                                                     |
| `install`   | `--template-id` \[`--version <n>`] \[`--env-vars`] \[`--allow-creator-updates`] `--force` \[`--json`]                         | Install onto the current agent; the body carries `version`, `envValues`, and `allowCreatorUpdates` only. Prints `✅ Template installed! (v<n>)` and, when the server applied it, `Applied as agent version v<n>.`                                |
| `apply`     | `--template-id` \[`--version <n>`] (`--agents` \| `--file` \| `--all-installed`) `--force` \[`--no-wait`] \[`--json`]         | Roll a version out to at most 500 target agents; polls every 3 seconds and exits 1 if any target failed, or after 30 minutes while the run continues server-side                                                                                |
| `status`    | `--template-id` \[`--json`]                                                                                                   | The install ledger: AGENT ID, TEMPLATE VERSION, AGENT VERSION, STATUS, APPLIED AT                                                                                                                                                               |
| `health`    | `--template-id` \[`--window-days <n>`] \[`--json`]                                                                            | One row per install and workflow: state, schedule, in-flight runs, terminal counts in the window, last failure                                                                                                                                  |
| `installed` | \[`--json`]                                                                                                                   | Templates installed on the current agent; `[]` as JSON when none                                                                                                                                                                                |
| `uninstall` | `--template-id` `--force`                                                                                                     | Remove the template's managed primitives from the current agent                                                                                                                                                                                 |

## Options

### Skill options

| Option                                        | Description                                                                                   | Default             |
| --------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------- |
| `--skill-name <name>`                         | A skill of the agent (`list`), or an installed skill by name or title (`update`, `uninstall`) | —                   |
| `--display-name <name>`                       | Listing name shown in the marketplace                                                         | —                   |
| `--visibility <public\|private>`              | `list`: who can find and install it                                                           | Marketplace default |
| `--marketplace-id <id>`                       | The listing                                                                                   | —                   |
| `--version-id <id>`                           | The skill version to publish, install or update to                                            | —                   |
| `--new-org-id <id>`                           | `transfer`: destination organization                                                          | —                   |
| `--changelog <text>`                          | `publish`: shown to installers                                                                | —                   |
| `--env-vars-json <json>`                      | `publish`: env var metadata as a JSON string                                                  | —                   |
| `--env-vars <k=v,...>`                        | `install`, `update`: values for the skill's env vars                                          | —                   |
| `--query <text>`, `--page <n>`, `--limit <n>` | `search`                                                                                      | Page 1, 10 results  |

### Template options

| Option                                                           | Description                                                                                                                                                      | Default                         |
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| `--template-id <id>`                                             | The template. Prompted from your own templates when omitted                                                                                                      | Prompt                          |
| `--name <name>`, `--display-name <name>`, `--description <text>` | `create`: identifier, display name, description. Each is prompted when omitted                                                                                   | Prompt                          |
| `--visibility <public\|private>`                                 | `create`: who can find and install it                                                                                                                            | Prompt, pre-selecting `private` |
| `--source-version <n>`                                           | `draft`, `publish`: the agent version to compose or freeze from; a positive integer                                                                              | The active agent version        |
| `--changelog <text>`                                             | `publish`: shown to installers                                                                                                                                   | —                               |
| `--env-contract <KEY=description>`                               | `publish`: one env var the template needs; repeatable, `KEY?=description` marks it optional                                                                      | —                               |
| `--skip-auto-apply`                                              | `publish`: do not push the version to consenting installs                                                                                                        | Push to them                    |
| `--yes`                                                          | `publish`: confirm the consequence prompt shown when a publish clears or narrows authored sections; headless runs (`--ci`, no TTY) proceed with the diff printed | Prompt                          |
| `--version <n>`                                                  | `view`, `install`, `apply`: a template version; `view` and `apply` exit 3 when it does not exist, `install` reports the server's refusal                         | Latest                          |
| `--env-vars <k=v,...>`                                           | `install`: values for the env contract                                                                                                                           | —                               |
| `--allow-creator-updates`                                        | `install`: let the creator's future publishes update this agent                                                                                                  | Off                             |
| `--skip-env-check`                                               | `install`, `apply`: deprecated; prints a warning, the env contract is enforced server-side                                                                       | —                               |
| `--agents <a,b,c>`, `--file <path>`, `--all-installed`           | `apply`: the targets, as a list, one id per line, or every agent with the template installed                                                                     | Required                        |
| `--no-wait`                                                      | `apply`: print the run id and return instead of polling                                                                                                          | Poll                            |
| `--window-days <n>`                                              | `health`: look-back window, a positive integer                                                                                                                   | 7 (server-side)                 |
| `--force`                                                        | Confirm `install`, `apply`, `uninstall`; also confirms the publish prompt; `draft`: replace authored sections wholesale                                          | —                               |
| `--json`                                                         | Machine-readable output                                                                                                                                          | Text                            |

## Examples

Create a template from the current agent, draft its authored sections, then publish the first version with its env contract.

```bash theme={null}
lua marketplace template create --name support-bot --display-name "Support Desk" \
  --description "Tier-1 support with refunds" --visibility private --ci
lua marketplace template draft --template-id <template-id> --ci
lua marketplace template publish --template-id <template-id> --changelog "First release" \
  --env-contract "STRIPE_KEY=Stripe secret key" --env-contract "SUPPORT_EMAIL?=Fallback contact" --yes --ci
```

Install a template onto this agent and let the creator update it later.

```bash theme={null}
lua marketplace template install --template-id <template-id> --env-vars "STRIPE_KEY=<value>" \
  --allow-creator-updates --force --ci
```

Roll version 2 out to every agent that has the template installed, then read the fleet.

```bash theme={null}
lua marketplace template apply --template-id <template-id> --version 2 --all-installed --force --ci
lua marketplace template status --template-id <template-id> --json --ci
lua marketplace template health --template-id <template-id> --window-days 30 --ci
```

Check what is installed on this agent.

```bash theme={null}
lua marketplace template installed --json --ci
```

```text Output theme={null}
[]
```

List one of the agent's skills, publish a version, and install a skill from the marketplace.

```bash theme={null}
lua marketplace skill list --skill-name order-lookup --display-name "Order Lookup" --visibility private --ci
lua marketplace skill publish --marketplace-id <marketplace-id> --version-id <version-id> --changelog "Adds EU VAT" --ci
lua marketplace skill install --marketplace-id mkt_def456 --version-id ver_def456 --env-vars "CRM_KEY=abc" --force --ci
```

## Exit codes

| Code | Meaning                                                                                                                                                                                                             |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0`  | Success                                                                                                                                                                                                             |
| `1`  | `template apply` without `--force` under `--ci`, an apply run with failed targets or still running after 30 minutes, an invalid `--visibility` on `template create`, a prompt under `--ci`, an already listed skill |
| `2`  | Usage: a skill action missing its flags or `--force`, `template install` or `uninstall` without `--force`, an invalid `--visibility` on `skill list`                                                                |
| `3`  | Not found: a skill, installed skill, template or template version                                                                                                                                                   |
| `9`  | Not signed in (401)                                                                                                                                                                                                 |
| `10` | Forbidden (403 or another 4xx)                                                                                                                                                                                      |
| `11` | Unavailable: 5xx, connection refused, timeout                                                                                                                                                                       |
| `12` | The model provider refused the request (424)                                                                                                                                                                        |

## See also

* [Publish a template](/marketplace/publish-a-template) — create, draft and publish end to end
* [Template manifest](/marketplace/manifest) — the `template:` section `draft` writes and `publish` reads
* [Install and apply](/marketplace/install-and-apply) and [Fleet health](/marketplace/fleet-health)
* [Marketplace skills](/marketplace/skills) — listing and installing skills
* [`lua version`](/reference/cli/version) — the rollback after an install or apply
