> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fly.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Installation

<Frame>
  <img src="https://mintcdn.com/fly-io/RkpeOaMN_WxQUxWf/sprites/images/install-cli.png?fit=max&auto=format&n=RkpeOaMN_WxQUxWf&q=85&s=bab8764546a00c4ff707d48afa863fd9" alt="A round green creature connected by a cable to a laptop displaying the word Install" width="1600" height="710" data-path="sprites/images/install-cli.png" />
</Frame>

The Sprites CLI (`sprite`) is available for macOS, Linux, and Windows.

## Quick Install (Recommended)

The easiest way to install the CLI is with our install script:

```bash theme={null}
curl -fsSL https://sprites.dev/install.sh | sh
```

The install script automatically:

* Detects your operating system and architecture
* Downloads the latest release binary
* Verifies the SHA256 checksum
* Installs to `~/.local/bin`

<Info>
  After installation, you may need to add `~/.local/bin` to your PATH if it's not already included. The script will provide instructions if needed.
</Info>

## Manual Installation

Latest CLI release: `v0.0.1-rc48`. For Apple Silicon/Intel or ARM64/x86-64 variants not shown, swap the architecture in the URL (`arm64` ↔ `amd64`).

<Tabs>
  <Tab title="macOS">
    <Tabs>
      <Tab title="Apple Silicon">
        ```bash Download theme={null}
        curl -LO https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-darwin-arm64.tar.gz
        ```

        ```bash Verify checksum (recommended) theme={null}
        curl -sL https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-darwin-arm64.tar.gz.sha256 | awk '{print $1 "  sprite-darwin-arm64.tar.gz"}' | shasum -a 256 -c
        ```

        ```bash Extract and install theme={null}
        tar xzf sprite-darwin-arm64.tar.gz
        sudo mv sprite /usr/local/bin/
        ```
      </Tab>

      <Tab title="Intel">
        ```bash Download theme={null}
        curl -LO https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-darwin-amd64.tar.gz
        ```

        ```bash Verify checksum (recommended) theme={null}
        curl -sL https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-darwin-amd64.tar.gz.sha256 | awk '{print $1 "  sprite-darwin-amd64.tar.gz"}' | shasum -a 256 -c
        ```

        ```bash Extract and install theme={null}
        tar xzf sprite-darwin-amd64.tar.gz
        sudo mv sprite /usr/local/bin/
        ```
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Linux">
    <Tabs>
      <Tab title="x86-64">
        ```bash Download theme={null}
        curl -LO https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-linux-amd64.tar.gz
        ```

        ```bash Verify checksum (recommended) theme={null}
        curl -sL https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-linux-amd64.tar.gz.sha256 | awk '{print $1 "  sprite-linux-amd64.tar.gz"}' | sha256sum -c
        ```

        ```bash Extract and install theme={null}
        tar xzf sprite-linux-amd64.tar.gz
        sudo mv sprite /usr/local/bin/
        ```
      </Tab>

      <Tab title="ARM64">
        ```bash Download theme={null}
        curl -LO https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-linux-arm64.tar.gz
        ```

        ```bash Verify checksum (recommended) theme={null}
        curl -sL https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-linux-arm64.tar.gz.sha256 | awk '{print $1 "  sprite-linux-arm64.tar.gz"}' | sha256sum -c
        ```

        ```bash Extract and install theme={null}
        tar xzf sprite-linux-arm64.tar.gz
        sudo mv sprite /usr/local/bin/
        ```
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Windows">
    <Tabs>
      <Tab title="x86-64">
        ```powershell Download theme={null}
        Invoke-WebRequest -Uri "https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-windows-amd64.zip" -OutFile "sprite-windows-amd64.zip"
        ```

        ```powershell Extract to your bin directory theme={null}
        Expand-Archive sprite-windows-amd64.zip -DestinationPath $env:USERPROFILE\bin
        ```

        ```powershell Add to PATH (run as Administrator) theme={null}
        [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\bin", "User")
        ```

        *For ARM64 Windows, replace `amd64` with `arm64` in the URL above.*
      </Tab>

      <Tab title="ARM64">
        ```powershell Download theme={null}
        Invoke-WebRequest -Uri "https://sprites-binaries.t3.storage.dev/client/v0.0.1-rc48/sprite-windows-arm64.zip" -OutFile "sprite-windows-arm64.zip"
        ```

        ```powershell Extract to your bin directory theme={null}
        Expand-Archive sprite-windows-arm64.zip -DestinationPath $env:USERPROFILE\bin
        ```

        ```powershell Add to PATH (run as Administrator) theme={null}
        [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\bin", "User")
        ```

        *For ARM64 Windows, replace `amd64` with `arm64` in the URL above.*
      </Tab>
    </Tabs>
  </Tab>
</Tabs>

## Verify Installation

```bash theme={null}
sprite --help
```

You should see the help output with available commands.

## Upgrading

If you installed from the direct download links, upgrade to the latest version:

```bash theme={null}
sprite upgrade
```

To check for updates without installing:

```bash theme={null}
sprite upgrade --check
```

## Configuration

The CLI stores configuration in `~/.sprites/sprites.json`. This includes:

* Organization tokens
* Current organization selection
* Current sprite selection

### Config File Location

| Platform    | Location                              |
| ----------- | ------------------------------------- |
| macOS/Linux | `~/.sprites/sprites.json`             |
| Windows     | `%USERPROFILE%\.sprites\sprites.json` |

> **Note:** `config.json` is kept for backward compatibility with older clients, but current versions read/write `sprites.json`.

## Optional: Local Directory Context

The CLI supports a `.sprite` file in your project directory to remember which sprite to use:

```bash theme={null}
# Set the sprite for current directory
sprite use my-project-sprite
```

This creates a `.sprite` file that the CLI reads automatically. Add `.sprite` to your `.gitignore` as it's user-specific.

## Optional: Install Shell Completions

The CLI provides completion scripts for various shells. Run `sprite help completion` for more information.

### bash

Install the bash completion script by adding it to your `.bashrc`:

```bash theme={null}
echo 'eval "$(sprite completion bash)"' >> ~/.bashrc
```

### zsh

If you haven't enabled completions in your `.zshrc` yet:

```bash theme={null}
echo "autoload -U compinit; compinit -i" >> ~/.zshrc
```

Install the zsh completion script by adding it to your local functions:

```bash theme={null}
sprite completion zsh > ~/.local/share/zsh/site-functions/_sprite

# If the local functions directory isn't in your fpath
echo "fpath=(\"$HOME/.local/share/zsh/site-functions\" \$fpath)" >> ~/.zshrc
```

### fish

Install the fish completion script:

```bash theme={null}
sprite completion fish > ~/.config/fish/completions/sprite.fish
```

### PowerShell

Install the PowerShell completion script by appending it to your profile:

```powershell theme={null}
Add-Content $PROFILE "`nsprite completion powershell | Out-String | Invoke-Expression"
```

## Troubleshooting

### Permission Denied

If you get a permission denied error on macOS or Linux:

```bash theme={null}
chmod +x sprite
sudo mv sprite /usr/local/bin/
```

### Command Not Found

Ensure the binary is in your PATH:

```bash theme={null}
# Check if sprite is in PATH
which sprite

# If not, add /usr/local/bin to PATH
export PATH="/usr/local/bin:$PATH"
```

### macOS Security Warning

On macOS, you may see a security warning when first running the CLI. To allow it:

1. Open System Preferences > Security & Privacy
2. Click "Allow Anyway" next to the message about `sprite`
3. Run `sprite` again and click "Open"

Or use the command line:

```bash theme={null}
xattr -d com.apple.quarantine /usr/local/bin/sprite
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="gear" href="/sprites/cli/authentication">
    Set up your Fly.io account and manage tokens
  </Card>

  <Card title="Commands Reference" icon="terminal" href="/sprites/cli/commands">
    Full CLI documentation and examples
  </Card>
</CardGroup>
