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

# Overview

The Ampersand Command Line Interface (CLI) enables you to deploy integrations and interact with the Ampersand platform.

## Installation

### For macOS using Homebrew

To install the CLI using Homebrew (macOS users):

```bash theme={null}
brew tap amp-labs/cli
brew update
brew install amp-labs/cli/cli
```

#### Updating to new version

If you already have the CLI installed, and want to upgrade to the latest version, run:

```
brew upgrade amp-labs/cli/cli
```

### For Windows

1. Visit [Ampersand CLI Releases](https://github.com/amp-labs/cli/releases).

2. Download the appropriate binary for your machine’s architecture.

3. Extract the downloaded folder containing the `exe` file.

4. To use the CLI, open Command Prompt in the extracted folder:
   * Navigate to the folder in File Explorer
   * Click in the address bar
   * Type `cmd` and press Enter

5. Verify the installation by running:

   ```cmd theme={null}
   amp
   ```

   This should display a list of commands or options available in the CLI, confirming that it is properly configured and ready for use.

6. To make the CLI accessible from anywhere, add the folder to your `PATH`:
   * Open the Start menu
   * Search for "Environment Variables"
   * Click "Edit the system environment variables"
   * Click "Environment Variables"
   * Under "System variables", select "Path" and click "Edit"
   * Click "New" and add the path to the folder containing the `exe` file
   * Click "OK" on all windows

### For other systems

1. Visit [Ampersand CLI Releases](https://github.com/amp-labs/cli/releases).
2. Download the appropriate binary for your machine’s architecture.
3. Place the binary somewhere on your `PATH` (e.g. `/usr/bin`).

**Note:**\
To ensure the CLI is accessible from anywhere, the binary must be placed in a directory listed in your `PATH`. You can inspect your current `PATH` using the following commands:

* **Linux/macOS:**
  ```bash theme={null}
  echo $PATH
  ```

## Using the CLI

### Checking the version

To check the version and build information of your CLI, run:

```
amp version
```

### Log into your Ampersand account

Ensure you have an Ampersand account. Create one on the [Ampersand Dashboard](https://dashboard.withampersand.com/sign-up) if you don't already have one.

To log into the CLI:

```
amp login
```

To log out:

```
amp logout
```

### Deploy integrations

Once you have defined your integrations in an `amp.yaml` file, use the following commands to deploy:

```bash theme={null}
amp login
amp deploy <folder_with_amp.yaml> --project <id-or-name>
```

### View all commands

To list all available commands and global flags:

```bash theme={null}
amp help
```

**Note:** For detailed explanations of each command and its options, refer to the [Command Reference](/cli/reference) section.

### Running in CI/CD Environments

#### Github Action

You can use the [official Ampersand Github Action](https://github.com/marketplace/actions/official-ampersand-github-action) to automatically deploy integrations from your repository.

#### Generate an API key

If you are using the official Github Action, or if you want to create your own CI/CD pipeline, you will need to generate an API key to run the CLI in a non-interactive mode that does not require a log in prompt.

1. Create an API key in the [Ampersand Dashboard](https://dashboard.withampersand.com/projects/_/api-keys).
2. Use the API key with the `key` flag.

```
amp list:integrations --key <api-key> --project <id-or-name>
```

Alternatively, you can set the API key as an environment variable:

```
export AMP_API_KEY=<api-key>
amp list:integrations --project <id-or-name>
```

### Debug mode

For more detailed output, run commands with the `debug` flag.

```
amp login --debug
```
