# Install, upgrade and uninstall

> The ways to install PrismaLens, how to keep it running, upgrade it and remove it.

PrismaLens is one command under two names, `pl` and `prismalens`. Install it one way and stick to that: every copy on a machine shares the workspace `~/.prismalens`, and an older copy refuses a database a newer one has upgraded.

## Install

* macOS and Linux

  ```bash
  curl -fsSL https://prismalens.io/install.sh | sh
  ```

  No Node needed: the installer brings its own and checks the download against the release’s `SHA256SUMS`.

* npm

  Needs Node.js. `pl doctor` says if yours is too old.

  ```bash
  npm install -g prismalens
  ```

* Homebrew

  ```bash
  brew install prismalens/tap/prismalens
  ```

* Windows (preview)

  WSL2 with the macOS and Linux installer is the supported path. Native Windows installs and runs, with rough edges. In PowerShell:

  ```powershell
  irm https://prismalens.io/install.ps1 | iex
  ```

  Scoop (preview) works too:

  ```powershell
  scoop bucket add prismalens https://github.com/prismalens/scoop-bucket
  scoop install prismalens
  ```

* Desktop app (preview)

  Download the zip for your OS from the [latest release](https://github.com/prismalens/prismalens/releases/latest).

## Keep it running

`pl up` runs until you stop it. On Linux and macOS, `pl service install` runs it in the background for your user and starts it when you log in. On Windows, turn on **Start at login** in the desktop app.

## Upgrade

```bash
pl upgrade
```

It upgrades the way you installed. Your database upgrades itself on the next start and is backed up first, as `prismalens.db.bak-<time>` in the workspace.

## Uninstall

Uninstalling leaves your workspace (`~/.prismalens`). To delete it as well, stop PrismaLens and run `pl reset` first. If you installed the background service, run `pl service uninstall` too.

| Installed with               | Uninstall                                                                       |
| ---------------------------- | ------------------------------------------------------------------------------- |
| The installer (macOS, Linux) | `curl -fsSL https://prismalens.io/install.sh \| sh -s -- --uninstall`           |
| The installer (Windows)      | `& ([scriptblock]::Create((irm https://prismalens.io/install.ps1))) -Uninstall` |
| npm                          | `npm uninstall -g prismalens`                                                   |
| Homebrew                     | `brew uninstall prismalens`                                                     |
| Scoop                        | `scoop uninstall prismalens`                                                    |
| The desktop app              | delete the app                                                                  |