> ## Documentation Index
> Fetch the complete documentation index at: https://assembly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Get up and running with AssemblyAI's CLI

The AssemblyAI CLI lets you interact with the AssemblyAI production-ready AI models with a single command. With the CLI, you can transcribe and understand audio files, generate subtitles, and perform a variety of other tasks right from your Terminal.

You can also learn the content on this page from [Summarize any video using only ONE command!](https://www.youtube.com/watch?v=4K9jCFhRwlc) on [AssemblyAI's YouTube channel](https://www.youtube.com/@AssemblyAI).

## Installing the CLI

The AssemblyAI CLI supports Windows, macOS, and Linux. You can get the CLI via the [Homebrew](https://brew.sh/) package manager or install it directly, depending on your platform.

<CodeGroup>
  ```sh Homebrew theme={"system"}
  brew tap assemblyai/assemblyai
  brew install assemblyai
  ```

  ```sh macOS or Linux theme={"system"}
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/AssemblyAI/assemblyai-cli/main/install.sh)"
  ```

  ```sh Windows theme={"system"}
  # Installing using Scoop
  scoop bucket add assemblyai https://github.com/assemblyai/scoop-assemblyai.git
  scoop install assemblyai

  # Or via PowerShell as an administrator
  Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
  irm https://raw.githubusercontent.com/AssemblyAI/assemblyai-cli/main/install.ps1 | iex
  New-Alias -Name assemblyai -Value $Env:Programfiles/AssemblyAI/assemblyai.exe
  ```
</CodeGroup>

## Getting started

### Set up your API key

Before you can use the AssemblyAI CLI, you'll need to obtain an API key by [signing up](https://www.assemblyai.com/dashboard/signup) to AssemblyAI. You can then set it up by running the following command:

```sh theme={"system"}
assemblyai config YOUR_API_KEY
```

### Transcribe an audio file

To transcribe an audio file, use the `transcribe` command, followed by the path to your audio file or YouTube video link. For example, if your audio file is located in the `~/audio` directory, you would run the following command:

**Note**: The CLI accepts YouTube links, but the API does not work with YouTube links! When working with the API, you need to provide a local file or a URL that points to a publicly accessible audio/video file. For example, files in an S3 bucket, on your server, etc.

```sh theme={"system"}
assemblyai transcribe ~/audio/my_audio_file.mp3
```

### Using a video link

The AssemblyAI CLI accepts YouTube video links as input and can process videos of up to 4 hours.

```sh theme={"system"}
assemblyai transcribe "https://www.youtube.com/watch?v=UdgRUCVUts0"
```

## Advanced

In addition to its basic functionality, the AssemblyAI CLI offers several advanced flags that allow you to explore different AI models and customize the transcription result. These flags can be used to control the formatting, timing, and other aspects of the output.

Some of the available flags include `--summarization` and `--dual_channel`, which can be used to generate a single abstractive summary of entire file, and to transcribe audio from both the left and right channels of a stereo recording, respectively.

To see the full list of available flags, use the `--help` argument.

```sh theme={"system"}
assemblyai transcribe --help
```

You can learn more about the commands and flags at [the AssemblyAI CLI documentation on GitHub](https://github.com/assemblyai/assemblyai-cli).

We recommend that you experiment with them to find the models that work best for your needs.

## Troubleshooting

If you experience any issues when using the AssemblyAI CLI, we encourage you to consult the [GitHub repository](https://github.com/assemblyai/assemblyai-cli), reporting problems you encounter by creating a [new issue](https://github.com/AssemblyAI/assemblyai-cli/issues/new/choose) in there.

Make sure to review the existing issues in the repository to ensure that your problem hasn't already been reported or resolved. Please include as much detail as possible, such as the exact command you ran, the error message you received, and any relevant logs.

You can also follow us on Twitter at [@AssemblyAI](https://twitter.com/assemblyai) or check our [changelog](https://www.assemblyai.com/changelog) to stay up to date on the latest releases.
