# Install CLI
URL: /en-US/docs/install/cli

Install the Spirit Agent CLI with the install script, SPIRIT_HOME, and SPIRIT_VERSION.



The CLI is a terminal host with a TUI and a non-interactive `-p` mode. It talks to the same local daemon as [Desktop](./desktop.mdx).

## Install script [#install-script]

macOS and Linux:

```bash
curl -fsSL https://spirit.fast/install | bash
```

Windows (PowerShell):

```powershell
irm https://spirit.fast/install.ps1 | iex
```

The script downloads a build from `download.spirit.fast`, unpacks it, and puts `spirit` on your `PATH`.

Open a new terminal, then:

```bash
spirit --version
```

## Where it lands [#where-it-lands]

The install root is **not** the Spirit Agent data directory.

|                                    | Default                                                                                                                     | Override                |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| CLI binaries                       | Unix: `~/.spirit` · Windows: `%LOCALAPPDATA%\Spirit`                                                                        | `SPIRIT_HOME`           |
| Sessions, config, keyring pointers | macOS: `~/Library/Application Support/SpiritAgent` · Windows: `%APPDATA%\SpiritAgent` · Linux: `~/.local/share/SpiritAgent` | `SPIRIT_AGENT_DATA_DIR` |

On Unix the script links `$SPIRIT_HOME/bin/spirit` → `$SPIRIT_HOME/cli/current/bin/spirit` and appends `export PATH="$SPIRIT_HOME/bin:$PATH"` to `~/.profile`, `~/.bashrc`, and `~/.zshrc` (marker `# spirit-agent cli`).

## Pin a version or mirror [#pin-a-version-or-mirror]

| Variable               | Default                                | Role                                |
| ---------------------- | -------------------------------------- | ----------------------------------- |
| `SPIRIT_HOME`          | `~/.spirit` or `%LOCALAPPDATA%\Spirit` | Install root for CLI binaries       |
| `SPIRIT_VERSION`       | `latest`                               | Version segment in the download URL |
| `SPIRIT_DOWNLOAD_HOST` | `download.spirit.fast`                 | CDN host                            |

```bash
SPIRIT_VERSION=0.1.0 curl -fsSL https://spirit.fast/install | bash
```

You can also download a CLI archive from the [download page](/en-US/download) or [GitHub Releases](https://github.com/SpiritAgents/SpiritAgent/releases/latest) and unpack it yourself.

## First run [#first-run]

```bash
cd /path/to/your/project
spirit
```

That opens the TUI. Add a provider with `/model add`, or from the shell with `spirit model add`. See the [quickstart](../quickstart.mdx).
