Skip to main content

Projects

Reference for the LiveKit CLI commands that manage your configured projects and create and configure LiveKit Cloud projects.

On this page

Overview

Use the lk project commands to manage projects. With the --user-auth option, the commands work with the projects in your LiveKit Cloud account. Without it, they work with the projects in your CLI configuration, which you add with lk cloud auth or lk project add.

The commands for LiveKit Cloud projects, members, API keys, and webhooks require LiveKit CLI v2.19.4 or later. To update the CLI, see Updates.

Other CLI commands use the project that you name with the --project option. If you don't name one, they use your default project. To install the CLI, see Install the CLI.

LiveKit Cloud projects

Available in
Beta

These commands, and the key, member, invite, and webhook subcommands in the sections that follow, need user authentication. Sign in with lk cloud auth --user-auth, and pass --user-auth to each command. What you can do depends on your role in the project.

Get

Get the details of a project.

lk project get PROJECT_ID --user-auth

Options for get:

  • --json (alias -j): Output as JSON.

Create

Create a project.

lk project create PROJECT_NAME [--private] [--pinned-regions REGIONS] ... --user-auth

Options for create:

  • --project-subdomain SUBDOMAIN: Project SUBDOMAIN (on create, generated from the name when not given).
  • --custom-domain DOMAIN: Custom DOMAIN for the project.
  • --private: Make the project private, visible only to you until you add members.
  • --discoverable-by-domain: Let users with your email domain find the project.
  • --joinable-by-domain: Let users with your email domain join the project.
  • --analytics: Collect analytics for the project.
  • --auto-create: Create rooms automatically when a participant joins.
  • --remote-unmute: Let admins unmute remote participants.
  • --egress-auto-retry: Retry failed egress automatically.
  • --egress-backup-storage: Use backup storage for egress uploads.
  • --inference-region-restriction: Restrict LiveKit Inference to the project's region.
  • --user-data-recording: Record traces, transcripts, and audio for agent observability.
  • --user-data-training: Allow session data to be used for model training.
  • --require-explicit-dispatch: Dispatch agents only when explicitly requested.
  • --sfu-allow-pause: Allow the SFU to pause video tracks.
  • --pii-redaction: Redact PII from transcripts.
  • --token-endpoint: Enable the project's token endpoint.
  • --pii-redaction-categories CATEGORIES: PII CATEGORIES to redact, such as ssn,credit-card,email-address (with --pii-redaction and none stored, the defaults apply).
  • --codecs CODECS: Enabled CODECS, such as video/VP8,audio/opus.
  • --pinned-regions REGIONS: SFU REGIONS to pin the project to, such as us (on update, pass "" to clear).
  • --user-data-region REGION: REGION where session data is stored, such as us; cannot be changed later.
  • --json (alias -j): Output as JSON.

Set the data region with --user-data-region when you create the project. You can't change it later. Agent observability is off unless you pass --user-data-recording.

Examples

Create a project that records session data for Agent insights, and stores it in the US:

lk project create my-project --user-data-recording --user-data-region us --user-auth

Update

Rename a project or change its settings. The command changes only the settings you pass. To turn a setting off, pass false, such as --user-data-recording=false.

lk project update PROJECT_ID [--name NEW_NAME] [--analytics=false] ... --user-auth

Options for update:

  • --name NAME: New project NAME.
  • --project-subdomain SUBDOMAIN: Project SUBDOMAIN (on create, generated from the name when not given).
  • --custom-domain DOMAIN: Custom DOMAIN for the project.
  • --discoverable-by-domain: Let users with your email domain find the project.
  • --joinable-by-domain: Let users with your email domain join the project.
  • --analytics: Collect analytics for the project.
  • --auto-create: Create rooms automatically when a participant joins.
  • --remote-unmute: Let admins unmute remote participants.
  • --egress-auto-retry: Retry failed egress automatically.
  • --egress-backup-storage: Use backup storage for egress uploads.
  • --inference-region-restriction: Restrict LiveKit Inference to the project's region.
  • --user-data-recording: Record traces, transcripts, and audio for agent observability.
  • --user-data-training: Allow session data to be used for model training.
  • --require-explicit-dispatch: Dispatch agents only when explicitly requested.
  • --sfu-allow-pause: Allow the SFU to pause video tracks.
  • --pii-redaction: Redact PII from transcripts.
  • --token-endpoint: Enable the project's token endpoint.
  • --pii-redaction-categories CATEGORIES: PII CATEGORIES to redact, such as ssn,credit-card,email-address (with --pii-redaction and none stored, the defaults apply).
  • --codecs CODECS: Enabled CODECS, such as video/VP8,audio/opus.
  • --pinned-regions REGIONS: SFU REGIONS to pin the project to, such as us (on update, pass "" to clear).
  • --json (alias -j): Output as JSON.

Examples

Turn on agent observability and PII redaction for an existing project:

lk project update my-project --user-data-recording --pii-redaction --user-auth

Delete

Delete a project. The command doesn't use your default project: name the project to delete, or pick it from the list. The CLI asks you to confirm. With the global --yes option, or when stdin isn't a terminal, it doesn't show the list or ask. If you don't name a project, it then deletes your only project, or fails if you have more than one.

lk project delete PROJECT_ID --user-auth

Options for delete:

  • --json (alias -j): Output as JSON.
Deleting is permanent

You can't undo a project delete.

API keys

An API key and its secret give full access to one project. Use them to sign access tokens on your server. To learn more about key types, see API keys.

List

List the API keys for a project.

lk project key list [--mine] [--include-agent-keys] --project PROJECT --user-auth

Options for key list:

  • --mine: Only list keys owned by you.
  • --include-agent-keys: Include keys created for cloud agents.
  • --json (alias -j): Output as JSON.

Create

Create an API key. The CLI prints the secret only once, so store it when you create the key.

A key you create belongs to you, and LiveKit Cloud revokes it when you lose access to the project. Add --service-account to create a key that belongs to the project instead. Use a service account key for servers and agents that must keep working after the person who created the key leaves the project.

lk project key create [--description TEXT] [--service-account] --project PROJECT --user-auth

Options for key create:

  • --description DESCRIPTION: Human-readable DESCRIPTION for the key.
  • --service-account: Create a project-owned key that is not tied to your user.
  • --json (alias -j): Output as JSON.

Examples

Create a service account key for a production token server:

lk project key create --service-account --description "Production token server" --project my-project --user-auth

Delete

Delete an API key. Anything that uses it stops working. The CLI asks you to confirm. With the global --yes option, or when stdin isn't a terminal, it doesn't ask.

lk project key delete API_KEY --project PROJECT --user-auth

Options for key delete:

  • --json (alias -j): Output as JSON.

Members

A project member is a user with the read, write, or admin role on the project. To assign the read or write role, the project must be on the Scale or Enterprise plan. To learn more, see Project members and Roles.

To find a user ID, run lk project member list.

List

lk project member list --project PROJECT --user-auth

Options for member list:

  • --json (alias -j): Output as JSON.

Get

lk project member get USER_ID --project PROJECT --user-auth

Options for member get:

  • --json (alias -j): Output as JSON.

Update

Change a member's role.

lk project member update USER_ID --role ROLE --project PROJECT --user-auth

Options for member update:

  • --role ROLE: Access ROLE: one of read, write, admin. Required.
  • --json (alias -j): Output as JSON.

Remove

Remove a member. This also deletes the API keys they own. When they own keys, the CLI tells you how many and asks you to confirm. To confirm without a prompt, pass the global --yes option. The CLI refuses a removal that leaves any project with no API key, and removes no one.

lk project member remove USER_ID --project PROJECT --user-auth

Options for member remove:

  • --json (alias -j): Output as JSON.

Invites

Invite someone to a project by email, even if they don't have a LiveKit Cloud account yet. The invite has a token that they use to accept or decline it. They become a member when they accept.

List

List the pending invites for a project.

lk project invite list --project PROJECT --user-auth

Options for invite list:

  • --json (alias -j): Output as JSON.

Get

Get an invite from its token.

lk project invite get INVITE_TOKEN --user-auth

Options for invite get:

  • --json (alias -j): Output as JSON.

Create

lk project invite create EMAIL --role ROLE --project PROJECT --user-auth

Options for invite create:

  • --role ROLE: Access ROLE: one of read, write, admin. Required.
  • --json (alias -j): Output as JSON.

Examples

Invite a teammate with the admin role:

lk project invite create teammate@example.com --role admin --project my-project --user-auth

Update

Change the role in a pending invite.

lk project invite update EMAIL --role ROLE --project PROJECT --user-auth

Options for invite update:

  • --role ROLE: Access ROLE: one of read, write, admin. Required.
  • --json (alias -j): Output as JSON.

Delete

Cancel a pending invite.

lk project invite delete EMAIL --project PROJECT --user-auth

Options for invite delete:

  • --json (alias -j): Output as JSON.

Answer

Accept an invite you received, or decline it with --decline.

lk project invite answer INVITE_TOKEN [--decline] --user-auth

Options for invite answer:

  • --decline: Decline the invite instead of accepting it.
  • --json (alias -j): Output as JSON.

Webhooks

A webhook sends the room, participant, track, egress, and ingress events of a project to a URL. For the events, see Webhooks.

List

lk project webhook list --project PROJECT --user-auth

Options for webhook list:

  • --json (alias -j): Output as JSON.

Events

List the events a webhook can subscribe to. Use these names with --include-event, --exclude-event, and --event.

lk project webhook events --project PROJECT --user-auth

Options for webhook events:

  • --json (alias -j): Output as JSON.

Create

Create a webhook. Without --include-event or --exclude-event, it gets every event.

lk project webhook create URL [--name NAME] [--signing-key API_KEY] [--include-event EVENT...] [--exclude-event EVENT...] --project PROJECT --user-auth

Options for webhook create:

  • --name NAME: Human-readable NAME for the webhook.
  • --signing-key API_KEY: API_KEY of this project whose secret signs deliveries.
  • --include-event EVENT: Only deliver EVENT (repeatable; see lk project webhook events).
  • --exclude-event EVENT: Never deliver EVENT (repeatable; see lk project webhook events).
  • --json (alias -j): Output as JSON.

Examples

Send only room events to a URL:

lk project webhook create https://example.com/livekit/webhook \
--name "Room events" \
--include-event room_started \
--include-event room_finished \
--project my-project \
--user-auth

Update

Change a webhook. --include-event and --exclude-event replace the whole event filter, so pass every event that you want to keep. To clear the filter, pass --all-events.

lk project webhook update WEBHOOK_ID [--name NAME] [--url URL] [--signing-key API_KEY] [--include-event EVENT...] [--exclude-event EVENT...] [--all-events] --project PROJECT --user-auth

Options for webhook update:

  • --name NAME: Human-readable NAME for the webhook.
  • --url URL: http(s) URL deliveries are POSTed to.
  • --signing-key API_KEY: API_KEY of this project whose secret signs deliveries.
  • --include-event EVENT: Only deliver EVENT (repeatable; see lk project webhook events).
  • --exclude-event EVENT: Never deliver EVENT (repeatable; see lk project webhook events).
  • --all-events: Clear the event filter so every event is delivered.
  • --json (alias -j): Output as JSON.

Test

Send an event with sample data to a webhook. The CLI sends the event even when the event filter of the webhook excludes it.

lk project webhook test WEBHOOK_ID --event EVENT --project PROJECT --user-auth

Options for webhook test:

  • --event EVENT: EVENT to send with sample data, regardless of the webhook's filter (see lk project webhook events). Required.
  • --json (alias -j): Output as JSON.

Examples

Send a sample room_started event:

lk project webhook test WEBHOOK_ID --event room_started --project my-project --user-auth

Delete

Delete a webhook. The CLI asks you to confirm. With the global --yes option, or when stdin isn't a terminal, it doesn't ask.

lk project webhook delete WEBHOOK_ID --project PROJECT --user-auth

Options for webhook delete:

  • --json (alias -j): Output as JSON.

Configured projects

Use these commands to manage the projects in your CLI configuration. With API key authentication, other commands use these projects.

Add

Add a project to your CLI configuration: a name, plus the URL, API key, and API secret of a LiveKit Cloud project or a self-hosted server.

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

lk project add [options] [PROJECT_NAME]

Options for add:

  • --url URL: WebSocket URL of the LiveKit server. If unset, the CLI asks for it. Required in non-interactive mode.
  • --api-key KEY: Project API KEY. If unset, the CLI asks for it. Required in non-interactive mode.
  • --api-secret SECRET: Project API SECRET. If unset, the CLI asks for it. Required in non-interactive mode.
  • --default: Set this project as the default.

PROJECT_NAME must be unique in your CLI instance. The first project you add becomes the default. When you add another project interactively without --default, the CLI asks whether to make it the default.

Examples

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

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

List

List the projects in your CLI configuration. With --user-auth, list every LiveKit Cloud project that your account can access instead.

lk project list [options]

Options for list:

  • --json (alias -j): Output as JSON, including each project's API key and secret.

Examples

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

lk project list

Example output:

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

To print the projects as JSON, pass --json. For the projects in your CLI configuration, the output includes each API key and secret. With --user-auth, it has no credentials.

Remove

Remove an existing project from your local CLI configuration. This doesn't affect the project in LiveKit Cloud.

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

lk project remove PROJECT_NAME

Examples

Remove a project from your CLI configuration:

lk project remove dev-local

Set default

Set a project as the default to use with other commands. Both authentication methods share one default project, so a change applies to both. With --user-auth, you can pass the ID, name, or alias of any LiveKit Cloud project that your account can access, including one that isn't in your configuration.

lk project set-default PROJECT_NAME

Examples

Make production the default project:

lk project set-default production