mcpField
L
livekit-cli

livekit-cli

github.com/codestackrCloud & DevOps370 installsUpdated 40w ago
Repository

About livekit-cli

livekit-cli is a command-line skill for managing LiveKit Cloud projects, creating apps from templates, and deploying agents. It combines local reference material with LiveKit MCP tools for current documentation and examples.

Key features

  1. 01Manage LiveKit projects and credentials
  2. 02Create apps from templates
  3. 03Generate room access tokens
  4. 04Deploy and monitor agents
  5. 05Configure phone numbers and SIP

Use cases

  1. 01Bootstrap a LiveKit application
  2. 02Deploy an agent to LiveKit Cloud
  3. 03Test a room with a simulated participant

MCP support

Works alongside the LiveKit MCP server, whose tools search documentation and code, retrieve pages and changelogs, and browse Python agent examples.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/codestackr/livekit-skills --skill livekit-cli

After installing, type/livekit-cliin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
agent-commands.md
livekit-overview.md
project-commands.md
telephony-commands.md

Details

From the project README

LiveKit CLI

The LiveKit CLI (lk) provides command-line tools for managing LiveKit Cloud projects, creating applications from templates, deploying agents, and configuring telephony.

LiveKit MCP server tools

This skill works alongside the LiveKit MCP server, which provides direct access to the latest LiveKit documentation, code examples, and changelogs. Use these tools when you need up-to-date information that may have changed since this skill was created.

Available MCP tools:

  • docs_search - Search the LiveKit docs site
  • get_pages - Fetch specific documentation pages by path
  • get_changelog - Get recent releases and updates for LiveKit packages
  • code_search - Search LiveKit repositories for code examples
  • get_python_agent_example - Browse 100+ Python agent examples

When to use MCP tools:

  • You need the latest API documentation or feature updates
  • You're looking for recent examples or code patterns
  • You want to check if a feature has been added in recent releases
  • The local references don't cover a specific topic

When to use local references:

  • You need quick access to core concepts covered in this skill
  • You're working offline or want faster access to common patterns
  • The information in the references is sufficient for your needs

Use MCP tools and local references together for the best experience.

References

Consult these resources as needed:

  • ./references/livekit-overview.md -- LiveKit ecosystem overview
  • ./references/project-commands.md -- Project management and token generation
  • ./references/agent-commands.md -- Agent deployment and management
  • ./references/telephony-commands.md -- Phone numbers and SIP configuration

Installation

macOS (Homebrew):

brew install livekit-cli

Linux:

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

Windows (winget):

winget install LiveKit.LiveKitCLI

Update the CLI regularly to get the latest features:

# macOS
brew update && brew upgrade livekit-cli

# Linux
curl -sSL https://get.livekit.io/cli | bash

# Windows
winget upgrade LiveKit.LiveKitCLI

Authentication

Link your LiveKit Cloud project to the CLI:

lk cloud auth

This opens a browser window to sign in to LiveKit Cloud and select a project. The CLI stores your credentials locally and generates API keys for your CLI instance.

To revoke authorization:

lk cloud auth --revoke

Project management

List all configured projects (default marked with *):

lk project list

Set a different project as default:

lk project set-default <project-name>

Add a self-hosted project manually:

lk project add my-project \
  --url http://localhost:7880 \
  --api-key <my-api-key> \
  --api-secret <my-api-secret> \
  --default

Remove a project from the CLI:

lk project remove <project-name>

Environment variables

Load LiveKit Cloud credentials into a .env.local file:

lk app env -w

This writes LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET to your local environment file.

Create apps from templates

Bootstrap a new application from a template:

lk app create --template <template_name> my-app

Run without --template to see all available templates:

lk app create

Available templates:

TemplateDescription
agent-starter-pythonPython voice agent starter
agent-starter-reactNext.js voice AI frontend
agent-starter-androidAndroid voice AI app
agent-starter-swiftSwift voice AI app
agent-starter-flutterFlutter voice AI app
agent-starter-react-nativeReact Native/Expo voice AI app
agent-starter-embedEmbeddable voice AI widget
token-serverNode.js token server
meetVideo conferencing app
multi-agent-pythonMulti-agent workflow example
outbound-caller-pythonOutbound calling agent

Note: Templates may be updated over time. Run lk app create without arguments to see the current list interactively.

Generate access tokens

Create an access token for joining rooms:

# For LiveKit Cloud
lk token create \
  --api-key <PROJECT_KEY> --api-secret <PROJECT_SECRET> \
  --join --room test_room --identity test_user \
  --valid-for 24h
# For local development (dev mode)
lk token create \
  --api-key devkey --api-secret secret \
  --join --room test_room --identity test_user \
  --valid-for 24h

Test with simulated participants

Join a room as a simulated participant with demo video:

# For LiveKit Cloud
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
# For local development
lk room join \
  --url ws://localhost:7880 \
  --api-key devkey --api-secret secret \
  --publish-demo --identity bot_user \
  my_first_room

Deploy agents

Deploy your first agent to LiveKit Cloud:

cd your-agent-project
lk cloud auth
lk agent create

This registers your agent, creates a livekit.toml configuration file, builds a container image, and deploys it.

Deploy a new version:

lk agent deploy

Monitor your agent:

lk agent status   # Check status and replicas
lk agent logs     # View runtime logs

For more agent commands, see ./references/agent-commands.md.

Phone numbers

Search and purchase US phone numbers:

lk number search --country-code US --area-code 415
lk number purchase --numbers +14155550100
lk number list

For more telephony commands, see ./references/telephony-commands.md.

Best practices

  1. Keep the CLI updated to access the latest features and bug fixes.
  2. Use lk app env -w to load credentials into your local environment instead of hardcoding them.
  3. Use templates to bootstrap new projects with best practices already configured.
  4. Test locally first with lk room join before deploying to production.
  5. Monitor deployments with lk agent status and lk agent logs after deploying.

Comments

Markdown supported