Skip to main content

LiveKit CLI

Install the LiveKit CLI, set up a project, and create apps from templates.

Overview

The LiveKit CLI (lk) is the primary interface for managing LiveKit Cloud projects, creating applications from templates, and deploying agents. For a conceptual overview of the CLI and its key workflows, see the CLI introduction.

GitHub

GitHub repository

Source code and releases for the LiveKit CLI.

Setup

Install the CLI, authenticate with LiveKit Cloud, and link a project to get started.

Install the CLI

Install the LiveKit CLI with Homebrew:

brew install livekit-cli
curl -sSL https://get.livekit.io/cli | bash
Tip

You can also download the latest precompiled binaries here.

winget install LiveKit.LiveKitCLI
Tip

You can also download the latest precompiled binaries here.

This repo uses Git LFS for embedded video resources. Please ensure git-lfs is installed on your machine before proceeding.

git clone github.com/livekit/livekit-cli
make install

Update the CLI

Update the CLI regularly to ensure you have the latest features and bug fixes:

Update the LiveKit CLI with Homebrew:

brew update && brew upgrade livekit-cli
curl -sSL https://get.livekit.io/cli | bash
Tip

You can also download the latest precompiled binaries here.

winget upgrade LiveKit.LiveKitCLI
Tip

You can also download the latest precompiled binaries here.

This repo uses Git LFS for embedded video resources. Please ensure git-lfs is installed on your machine before proceeding.

Before updating, make sure you've recently pulled the latest changes from main.

make install

Add a project

Link a LiveKit project to the CLI to use it. This can be a LiveKit Cloud project or a self-hosted LiveKit server instance.

To link a LiveKit Cloud project, run the following command then follow the instructions in your browser to authenticate:

lk cloud auth

To add a different project, see the Project management guide.

Tip

If you're looking to explore LiveKit's Agents framework, or want to prototype your app against a prebuilt frontend or token server, check out Sandboxes.

Generate access token

A participant creating or joining a LiveKit room needs an access token. You can generate one using the CLI:

lk token create \
--api-key devkey --api-secret secret \
--join --room test_room --identity test_user \
--valid-for 24h
Tip

Make sure you're running LiveKit server locally in dev mode.

lk token create \
--api-key <PROJECT_KEY> --api-secret <PROJECT_SECRET> \
--join --room test_room --identity test_user \
--valid-for 24h

You can also generate tokens from your project's dashboard.

Test with LiveKit Meet

Use LiveKit Meet to preview your LiveKit instance. Enter the token you previously generated in the "Custom" tab. After you connect, your microphone and camera stream in realtime, and any other participant who connects to the same room can see and hear you.

Tip

If you're testing a LiveKit Cloud instance, you can find your Project URL (it starts with wss://) in the project settings.

GitHub

LiveKit Meet

Full source code for the LiveKit Meet example app.

Simulating another publisher

One way to test a multi-user session is by generating a second token (ensure --identity is unique), opening the LiveKit Meet example app in another browser tab and connecting to the same room.

Another way is to use the CLI as a simulated participant and publish a prerecorded video to the room:

lk room join \
--url ws://localhost:7880 \
--api-key devkey --api-secret secret \
--publish-demo --identity bot_user \
my_first_room
lk room join \
--url <PROJECT_SECURE_WEBSOCKET_ADDRESS> \
--api-key <PROJECT_API_KEY> --api-secret <PROJECT_SECRET_KEY> \
--publish-demo --identity bot_user \
my_first_room

This command publishes a looped demo video to my_first_room. Due to how the file was encoded, expect a short delay before your browser has sufficient data to render frames.

App templates

The LiveKit CLI can help you bootstrap applications from a number of convenient template repositories, using your project credentials to set up required environment variables and other configuration automatically.

For agent templates (voice agents and other LiveKit Agents projects), use lk agent init:

lk agent init my-agent --template agent-starter-python
# or: --template agent-starter-node

Then follow the CLI prompts to finish your setup.

Omit the --template flag to see a list of all available templates.

First-party templates:

Template NameLanguage/FrameworkDescription
agent-starter-pythonPythonA starter project for Python, featuring a simple voice agent implementation
agent-starter-reactTypeScript/Next.jsA starter app for Next.js, featuring a flexible voice AI frontend
agent-starter-androidKotlin/AndroidA starter project for Android, featuring a flexible voice AI frontend
agent-starter-swiftSwiftA starter project for Swift, featuring a flexible voice AI frontend
agent-starter-flutterFlutterA starter project for Flutter, featuring a flexible voice AI frontend
agent-starter-react-nativeReact Native/ExpoA starter project for Expo, featuring a flexible voice AI frontend
agent-starter-embedTypeScript/Next.jsA starter project for a flexible voice AI that can be embedded in any website
token-serverNode.js/TypeScriptA hosted token server to help you prototype your mobile applications faster
meetTypeScript/Next.jsAn open source video conferencing app built on LiveKit Components and Next.js
multi-agent-pythonPythonA team of writing coach agents demonstrating multi-agent workflows
outbound-caller-pythonPythonAn agent that makes outbound calls using LiveKit SIP
GitHub

LiveKit Template Index

Browse all available first-party templates.