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! on AssemblyAI's YouTube channel.
Getting started
Set up your API key
Before you can use the AssemblyAI CLI, you'll need to obtain an API key by to AssemblyAI. You can then set it up by running the following command:
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.
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.
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.
assemblyai transcribe --help
You can learn more about the commands and flags at the AssemblyAI CLI documentation on GitHub.
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, reporting problems you encounter by creating a new issue 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 or check our changelog to stay up to date on the latest releases.