# packages.install

Source: https://docs.lightair.app/developers/remote-api/packages.install

> Installs a package from a file or a catalog; one that asks for permissions opens Lightair's install screen for the person instead.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Packages and plugins. Script plugins need the `project.write` permission.

A package that asks for nothing installs at once. One that asks for permissions, optional permissions or full access is never granted over the API: Lightair's install screen opens, and the answer says so with `pending: true`.

Catalogs are added only by the person, in the Plugins panel. A withdrawn version is refused.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `file` | `string` | no | A `.airpkg`, `.lwidget` or package folder on this computer. |
| `id` | `string` | no | A package's id in a catalog, instead of `file`. |
| `version` | `string` | no | Which version. Default: the newest. |
| `catalog` | `string` | no | An added catalog's name or address. Default: the one that offers it. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | no | The package's id. |
| `version` | `string` | no | Its version, when installed. |
| `already` | `boolean` | no | Whether it was already installed. |
| `pending` | `boolean` | no | true when the install screen opened for the person. |
| `message` | `string` | no | With `pending`. |

## Errors

Invalid params (-32602) without `file` or `id`, or for a file that isn't a package. Not found (-32004) for a package no added catalog offers. A state error (-32005) for a withdrawn version, or when Lightair's window isn't open. Fails (-32000) when the install fails.

## From an AI agent

The MCP server's `plugins (action: install)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "packages.install", "params": { "id": "app.example.countdown" } }
```

Result:

```json
{ "id": "app.example.countdown", "version": "1.2.0", "already": false }
```

## Related

- [packages.search](https://docs.lightair.app/developers/remote-api/packages.search.md)
- [packages.remove](https://docs.lightair.app/developers/remote-api/packages.remove.md)
