Skip to main content

Project management

Add, list, and manage the projects the LiveKit CLI uses, and bootstrap apps with project credentials.

Overview

Use the lk project commands to manage LiveKit projects used by the CLI. A project is composed of a URL, API key, and API secret that point to a LiveKit deployment, plus a name to reference the project in the CLI. You can set a default project that is used by other commands when no project is specified.

These commands only edit your local CLI configuration. To create a LiveKit Cloud project, use the LiveKit Cloud dashboard .

To install the CLI, see Install the CLI.

lk project [command [command options]]

LiveKit Cloud projects

Use the lk cloud command to authenticate with LiveKit Cloud and link your Cloud-hosted projects to the CLI. LiveKit Cloud automatically generates a new API key for your CLI instance and performs a project add for you.

lk cloud [command [command options]]

Authentication

Authenticate a LiveKit Cloud account to link a single project. The command opens a browser-based flow to sign in to LiveKit Cloud and select a single project. To link multiple projects, run this command multiple times.

lk cloud auth [options]

Options for cloud auth:

  • --timeout SECONDS, -t SECONDS: Number of seconds to attempt authentication before giving up. Default: 900.
  • --poll-interval SECONDS, -i SECONDS: Number of seconds between poll requests while waiting. Default: 4.

Examples

Link your LiveKit Cloud account and import a project.

lk cloud auth

Revoke

Revoke an authorization for an existing project. This revokes the API keys that were issued with lk cloud auth, and then performs a project remove for you.

lk cloud auth --revoke

Options for cloud auth --revoke:

  • --project PROJECT_NAME: Name of the project to revoke. Default: default project.
Warning

Revoking an authorization also revokes the API keys stored in your CLI instance. Any copies of these keys previously made with lk app env or lk app create are also revoked.

Project subcommands

The following project subcommands are available:

Add

Add a new project to your CLI instance.

For LiveKit Cloud projects, use the cloud auth command to link your account and import projects through your browser.

lk project add PROJECT_NAME --url LIVEKIT_URL --api-key API_KEY --api-secret API_SECRET [--default]

Options for add:

  • PROJECT_NAME: Name of the project. Must be unique in your CLI instance.
  • --url URL: websocket URL of the LiveKit server.
  • --api-key KEY: Project API key.
  • --api-secret SECRET: Project API secret.
  • --default: Set this project as the default. Default: false.

Examples

Add a self-hosted project and set it as default:

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

List

List all configured projects.

lk project list [options]

Options for list:

  • --json, -j: Output as JSON, including API key and secret. Default: false.

Examples

Human-readable output (current default is marked with *):

lk project list

Example output:

┌──────────────────────┬──────────────────────────────────────────────────┬───────────────┐
│ Name │ URL │ API Key │
├──────────────────────┼──────────────────────────────────────────────────┼───────────────┤
│ dev-local │ http://localhost:7880 │ APIxxxxxxxxxx │
│ staging │ wss://staging-abc123.livekit.cloud │ APIyyyyyyyyyy │
│ * production │ wss://production-xyz789.livekit.cloud │ APIzzzzzzzzzz │
└──────────────────────┴──────────────────────────────────────────────────┴───────────────┘

JSON output:

lk project list --json

Example output:

[
{
"Name": "dev-local",
"URL": "http://localhost:7880",
"APIKey": "APIxxxxxxxxxx",
"APISecret": "abc123"
},
{
"Name": "staging",
"URL": "wss://staging-abc123.livekit.cloud",
"APIKey": "APIyyyyyyyyyy",
"APISecret": "abc123"
},
{
"Name": "production",
"URL": "wss://production-xyz789.livekit.cloud",
"APIKey": "APIzzzzzzzzzz",
"APISecret": "abc123"
}
]

Remove

Remove an existing project from your local CLI configuration. This does not affect the project in LiveKit Cloud.

For LiveKit Cloud projects, use the cloud auth revoke command to revoke the API keys and remove the project from the CLI.

lk project remove PROJECT_NAME

Examples

lk project remove dev-local

Set-default

Set a project as the default to use with other commands.

lk project set-default PROJECT_NAME

Examples

lk project set-default production

List projects to see the current default, change it, then list again:

lk project list

Example output:

┌──────────────────────┬──────────────────────────────────────────────────┬───────────────┐
│ Name │ URL │ API Key │
├──────────────────────┼──────────────────────────────────────────────────┼───────────────┤
│ dev-local │ http://localhost:7880 │ APIxxxxxxxxxx │
│ * staging │ wss://staging-abc123.livekit.cloud │ APIyyyyyyyyyy │
│ production │ wss://production-xyz789.livekit.cloud │ APIzzzzzzzzzz │
└──────────────────────┴──────────────────────────────────────────────────┴───────────────┘

Change the default to production:

lk project set-default production

List again to confirm the change:

lk project list

Example output:

┌──────────────────────┬──────────────────────────────────────────────────┬───────────────┐
│ Name │ URL │ API Key │
├──────────────────────┼──────────────────────────────────────────────────┼───────────────┤
│ dev-local │ http://localhost:7880 │ APIxxxxxxxxxx │
│ staging │ wss://staging-abc123.livekit.cloud │ APIyyyyyyyyyy │
│ * production │ wss://production-xyz789.livekit.cloud │ APIzzzzzzzzzz │
└──────────────────────┴──────────────────────────────────────────────────┴───────────────┘

App commands

Use the lk app commands to create an app from a template and fill its environment variables with credentials from --project or the default project. For agent templates, use lk agent init instead.

lk app [command [command options]]

Create

Create a new app from a template, with its environment variables filled from your project. For first-party templates, see App templates.

lk app create [options] APP_NAME

Options for app create:

  • APP_NAME: Name of the app directory. Prompts if omitted.
  • --template TEMPLATE: Template name from list-templates. Prompts if neither this nor --template-url is set.
  • --template-url URL: URL of a template repository containing a taskfile.yaml. Can't be used with --template.
  • --install: Install dependencies without prompting. Default: false.

Examples

Create a Next.js voice AI frontend and install its dependencies:

lk app create --template agent-starter-react --install my-frontend

Create an app from your own template repository:

lk app create --template-url https://github.com/<your-org>/<your-template> my-app

List templates

List the templates available to lk app create.

lk app list-templates [options]

Options for app list-templates:

  • --json, -j: Output as JSON. Default: false.

Examples

lk app list-templates

Env

Generate environment variables for an existing app. The CLI fills the LiveKit URL and credentials from your project, prompts for any other variables in .env.example, and prints the result.

lk app env [options] [DIR]

Options for app env:

  • DIR: App directory. Default: the current directory.
  • --write, -w: Write to the destination file instead of printing. Merges into an existing file, keeping its values except the LiveKit credentials. Default: false.
  • --destination FILE, -d FILE: File to write to, relative to DIR. Default: .env.local.
  • --overwrite, -o: Replace the destination file instead of merging. Default: false.
  • --example FILE, -e FILE: Example file to read variable names from, relative to DIR. Default: .env.example.

Examples

Print the variables for the app in the current directory:

lk app env

Write the variables for the staging project to .env.local in my-app:

lk app env --project staging --write my-app