# Install the CLI (/cli/install)

## Shell installer

### macOS / Linux

```sh
curl -LsSf https://lumis.sh/install.sh | sh
```

Pin a CLI version by putting it in the URL:

```sh
curl -LsSf https://lumis.sh/0.5.1/install.sh | sh
```

### Windows

In PowerShell:

```powershell
powershell -ExecutionPolicy ByPass `
  -c "irm https://lumis.sh/install.ps1 | iex"
```

Pin a CLI version by putting it in the URL:

```powershell
powershell -ExecutionPolicy ByPass `
  -c "irm https://lumis.sh/0.5.1/install.ps1 | iex"
```


The installers download the matching archive from GitHub Releases and verify its
published SHA-256 checksum before unpacking it. The default install directory is
`~/.local/bin`.

Set `LUMIS_INSTALL_DIR` to choose another directory. Set
`LUMIS_NO_MODIFY_PATH=1` to install without changing `PATH`.

## Package managers

Homebrew:

```sh
brew trust --tap leandrocp/lumis
brew tap leandrocp/lumis
brew install lumis
```

Download a release binary through Cargo without compiling Lumis:

```sh
cargo binstall lumis-cli
```

Use the GitHub release through mise's GitHub backend. The options select only
CLI releases and their platform archives from this multi-package repository:

```sh
mise use 'github:leandrocp/lumis[version_prefix=cargo-lumis-cli/v,matching_regex=^lumis-(aarch64|x86_64)-]@latest'
```

From npm:

```sh
npm install -g @lumis-sh/cli
```

From crates.io:

```sh
cargo install lumis-cli
```

## Building from source

Download a source archive from a
[`cargo-lumis-cli/v*` release](https://github.com/leandrocp/lumis/releases?q=cargo-lumis-cli%2F&expanded=true)
and extract it. From the extracted repository root, run:

```sh
cargo build --release --locked -p lumis-cli
cargo test --release --locked -p lumis-cli
```

The executable is `target/release/lumis`, or `target/release/lumis.exe` on
Windows. Building requires Rust and a C/C++ toolchain. Use the MSVC toolchain
on Windows.

CLI releases are tagged `cargo-lumis-cli/v<version>`. Other tags in the
repository belong to other packages.