### Install LiveKit CLI on Windows Source: https://github.com/livekit/livekit-cli/blob/main/README.md Use winget to install the LiveKit CLI on Windows. ```shell winget install LiveKit.LiveKitCLI ``` -------------------------------- ### Quickstart LiveKit Load Test Source: https://github.com/livekit/livekit-cli/blob/main/README.md Simulate 8 video publishers with simulcast to a LiveKit room for load testing. Requires a LiveKit server instance. ```shell lk load-test \ --room test-room \ --video-publishers 8 ``` -------------------------------- ### Browse LiveKit Documentation Overview Source: https://github.com/livekit/livekit-cli/blob/main/README.md Get a complete overview of the LiveKit documentation site directly from the terminal. ```shell lk docs overview ``` -------------------------------- ### Install LiveKit CLI on Linux Source: https://github.com/livekit/livekit-cli/blob/main/README.md Download and install the LiveKit CLI on Linux using a curl script. ```shell curl -sSL https://get.livekit.io/cli | bash ``` -------------------------------- ### Install LiveKit CLI on macOS Source: https://github.com/livekit/livekit-cli/blob/main/README.md Use Homebrew to install the LiveKit CLI on macOS. ```shell brew install livekit-cli ``` -------------------------------- ### Build LiveKit CLI from Source Source: https://github.com/livekit/livekit-cli/blob/main/README.md Build the LiveKit CLI from source using Go. Ensure Git LFS is installed and platform headers/libraries for C compilation are available. ```shell git clone https://github.com/livekit/livekit-cli && cd livekit-cli go build ./cmd/lk ``` -------------------------------- ### Start LiveKit Egress Services Source: https://github.com/livekit/livekit-cli/blob/main/README.md Initiate different types of egress recordings for a LiveKit room. Requires the egress service to be set up. ```shell lk egress start --type room-composite ``` ```shell lk egress start --type track-composite ``` ```shell lk egress start --type track ``` -------------------------------- ### Get Recent SDK Releases Source: https://github.com/livekit/livekit-cli/blob/main/README.md Fetch recent release information for a specific LiveKit SDK. ```shell lk docs changelog pypi:livekit-agents ``` -------------------------------- ### Participant Attributes JSON Structure Source: https://github.com/livekit/livekit-cli/blob/main/README.md Example JSON structure for defining participant attributes when joining a room. ```json { "key1": "value1", "key2": "value2" } ``` -------------------------------- ### Agent Load Testing Source: https://github.com/livekit/livekit-cli/blob/main/README.md Dispatch a running agent to multiple rooms to simulate a user in each room that echoes the agent's speech. Ensure the agent is running and configured to speak before starting the test. ```shell lk perf agent-load-test \ --rooms 5 \ --agent-name test-agent \ --echo-speech-delay 10s \ --duration 5m --attribute key1=value1 ``` -------------------------------- ### Search Code Across LiveKit GitHub Repos Source: https://github.com/livekit/livekit-cli/blob/main/README.md Search for code across LiveKit GitHub repositories, useful for finding specific implementations or examples. ```shell lk docs code-search "class AgentSession" --repo livekit/agents ``` -------------------------------- ### Create LiveKit Application from Template Source: https://github.com/livekit/livekit-cli/blob/main/README.md Bootstrap a new application from a LiveKit template repository. The CLI will use project credentials to set up environment variables. ```shell lk app create --template my-app ``` -------------------------------- ### List All LiveKit SDKs Source: https://github.com/livekit/livekit-cli/blob/main/README.md List all available LiveKit SDKs supported by the documentation command. ```shell lk docs list-sdks ``` -------------------------------- ### List Available Application Templates Source: https://github.com/livekit/livekit-cli/blob/main/README.md List all available application templates that can be used with `lk app create`. ```shell lk app list-templates ``` -------------------------------- ### Use Staging Server for Docs Source: https://github.com/livekit/livekit-cli/blob/main/README.md Override the default LiveKit documentation server URL to use a staging or preview deployment. ```shell lk docs --server-url https://docs-staging.example.com/mcp/ search "agents" ``` -------------------------------- ### Simulate Audio Publishers for Load Test Source: https://github.com/livekit/livekit-cli/blob/main/README.md Simulate 5 concurrent audio publishers playing pre-recorded samples to test audio capabilities in a LiveKit room. ```shell lk load-test \ --room test-room \ --audio-publishers 5 ``` -------------------------------- ### Publish Demo Video Track to Room Source: https://github.com/livekit/livekit-cli/blob/main/README.md Join a LiveKit room and publish a demo video track. This command automatically configures simulcast at multiple resolutions. ```shell lk room join --identity publisher --publish-demo ``` -------------------------------- ### Simulate Load Test with Publishers and Subscribers Source: https://github.com/livekit/livekit-cli/blob/main/README.md Use this command to simulate a load test with a specified number of publishers and subscribers for a given duration. This helps in measuring LiveKit SFU's performance. ```shell lk load-test \ --duration 1m \ --video-publishers 5 \ --subscribers 500 ``` -------------------------------- ### Configure System Settings for Load Testing Source: https://github.com/livekit/livekit-cli/blob/main/README.md Adjust system settings for file descriptor limits and network buffer sizes to optimize load testing performance. ```shell ulimit -n 65535 sysctl -w fs.file-max=2097152 sysctl -w net.core.somaxconn=65535 sysctl -w net.core.rmem_max=25165824 sysctl -w net.core.wmem_max=25165824 ``` -------------------------------- ### Build LiveKit CLI for Windows with Zig Source: https://github.com/livekit/livekit-cli/blob/main/README.md Build the LiveKit CLI for Windows or cross-compile using Zig as the C/C++ toolchain. This command uses GoReleaser for a snapshot build. ```shell goreleaser build --single-target --snapshot --clean ``` -------------------------------- ### List Configured LiveKit Projects Source: https://github.com/livekit/livekit-cli/blob/main/README.md List all LiveKit projects that have been added to the CLI configuration. ```shell lk project list ``` -------------------------------- ### Search LiveKit Documentation Source: https://github.com/livekit/livekit-cli/blob/main/README.md Search the LiveKit documentation for specific terms or topics. ```shell lk docs search "voice agents" ``` -------------------------------- ### Join Room with Attributes from JSON File Source: https://github.com/livekit/livekit-cli/blob/main/README.md Join a LiveKit room and specify participant attributes by providing a JSON file. The JSON file should contain key-value pairs for the attributes. ```shell lk room join --identity publisher \ --attribute-file attributes.json \ ``` -------------------------------- ### Transcode with FFmpeg for Publishing Source: https://github.com/livekit/livekit-cli/blob/main/README.md Use FFmpeg to transcode various sources (files or live streams) into supported codecs and publish them to a Unix socket. LiveKit CLI then reads from the socket to publish the stream. ```shell ffmpeg -i \ -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -profile:v baseline -pix_fmt yuv420p \ -x264-params keyint=120 -max_delay 0 -bf 0 \ -listen 1 -f h264 unix:/tmp/myvideo.sock \ -c:a libopus -page_duration 20000 -vn \ -listen 1 -f opus unix:/tmp/myaudio.sock ``` ```shell lk room join --identity bot \ --publish h264:///tmp/myvideo.sock \ --publish opus:///tmp/myaudio.sock \ ``` -------------------------------- ### Generate Token to Join Simulated Room Source: https://github.com/livekit/livekit-cli/blob/main/README.md Create a token to join a LiveKit room and optionally open the Meet application. Useful for observing load tests. ```shell lk token create --join \ --room test-room \ --identity test-user \ --open meet ``` -------------------------------- ### Submit Feedback on LiveKit Documentation Source: https://github.com/livekit/livekit-cli/blob/main/README.md Submit feedback or suggestions for a specific LiveKit documentation page directly through the CLI. ```shell lk docs submit-feedback --page /agents/build/tools "Missing info about error handling" ``` -------------------------------- ### Fetch Specific LiveKit Documentation Page Source: https://github.com/livekit/livekit-cli/blob/main/README.md Retrieve a specific LiveKit documentation page in markdown format. ```shell lk docs get-page /agents/start/voice-ai-quickstart ``` -------------------------------- ### Access Private Vercel Preview Deployments Source: https://github.com/livekit/livekit-cli/blob/main/README.md Access private Vercel preview deployments of LiveKit documentation by setting the required Vercel header. ```shell lk docs --server-url https://docs-abc123.vercel.app/mcp/ --vercel-header overview ``` -------------------------------- ### Publish H.264/H.265 Simulcast Track from TCP Source: https://github.com/livekit/livekit-cli/blob/main/README.md Create a single simulcast track by publishing multiple H.264 or H.265 streams from different TCP ports. Each stream is defined with its codec, host, port, and resolution. ```shell # Note: this is just an example of a Gstreamer pipeline structure # It uses a `tee` element to split the raw frame input to 3 pipelines for # scaling to a specific resolution then encoding to H.264 byte stream. gst-launch-1.0 -e -v \ v4l2src device= \ tee name=t \ t. ! ! \ tcpserversink host=0.0.0.0 port=5005 sync=false async=false \ t. ! ! \ tcpserversink host=0.0.0.0 port=5006 sync=false async=false \ t. ! ! \ tcpserversink host=0.0.0.0 port=5007 sync=false async=false ``` ```shell lk room join --identity --url "" --api-key "" --api-secret "" \ --publish h264://127.0.0.1:5005/1920x1080 \ --publish h264://127.0.0.1:5006/1280x720 \ --publish h264://127.0.0.1:5007/640x480 ``` -------------------------------- ### Authenticate LiveKit Cloud Project Source: https://github.com/livekit/livekit-cli/blob/main/README.md Authenticate with your LiveKit Cloud account and link an existing project. This command will open a browser for authentication. ```shell lk cloud auth ``` -------------------------------- ### Publish Pre-encoded Media Files Source: https://github.com/livekit/livekit-cli/blob/main/README.md Publish local audio and video files to a LiveKit room. Ensure files are encoded with supported codecs. Note that CLI-published pre-encoded videos may have an initial delay. ```shell lk room join --identity publisher \ --publish \ --publish \ --fps 23.98 \ ``` -------------------------------- ### Publish from TCP Socket Source: https://github.com/livekit/livekit-cli/blob/main/README.md Publish a video stream from a TCP socket, such as one provided by a gstreamer pipeline. LiveKit CLI acts as a TCP client to receive the stream. ```shell lk room join \ --identity bot \ --publish h264:///127.0.0.1:16400 \ ``` -------------------------------- ### Test LiveKit Egress Templates Source: https://github.com/livekit/livekit-cli/blob/main/README.md Validate egress recording templates by simulating virtual publishers and opening a browser to the template URL. ```shell lk egress test-template \ --base-url http://localhost:3000 \ --room test-room \ --layout speaker \ --video-publishers 3 ``` -------------------------------- ### Add LiveKit Project Manually Source: https://github.com/livekit/livekit-cli/blob/main/README.md Manually add a LiveKit project to the CLI configuration using your API key and secret. ```shell lk project add --api-key --api-secret ``` -------------------------------- ### Join Room and Set Participant Attributes Source: https://github.com/livekit/livekit-cli/blob/main/README.md Join a LiveKit room as a participant and set custom attributes for the participant. Attributes can be specified as key-value pairs. ```shell lk room join --identity publisher \ --attribute key1=value1 \ --attribute key2=value2 \ ``` -------------------------------- ### Generate Token with Dynamic Identity and Room Name Source: https://github.com/livekit/livekit-cli/blob/main/README.md Use this command to create a token with an identity based on the current user and hostname, and a room name with a random suffix. Template strings are substituted at runtime. ```shell lk token create --join \ --identity "%U@%h" \ --room "room-%x" ``` -------------------------------- ### Set Default LiveKit Project Source: https://github.com/livekit/livekit-cli/blob/main/README.md Set a specific LiveKit project as the default for subsequent CLI commands. ```shell lk project set-default ``` -------------------------------- ### Test FFplay Stream from Unix Socket Source: https://github.com/livekit/livekit-cli/blob/main/README.md Use ffplay to test a stream being written to a Unix socket. Ensure tracks are encoded in a WebRTC compatible format. ```shell ffplay -i unix:/tmp/myvideo.sock ``` -------------------------------- ### Encode 1080p H.264 Video Source: https://github.com/livekit/livekit-cli/blob/main/pkg/provider/resources/README.md Encodes a video to 1080p resolution at 30fps with a target bitrate of 3Mbps. Uses baseline profile for broad compatibility. ```shell ffmpeg -i butterfly.mp4 \ -c:v libx264 -bsf:v h264_mp4toannexb \ -b:v 3M -vf "scale=1920:1080, fps=30" \ -profile baseline -pix_fmt yuv420p \ -x264-params keyint=120 -max_delay 0 -bf 0 \ butterfly_1080_3000.h264 ``` -------------------------------- ### Encode 360p H.264 Video Source: https://github.com/livekit/livekit-cli/blob/main/pkg/provider/resources/README.md Encodes a video to 360p resolution at 20fps with a target bitrate of 400Kbps. Uses baseline profile for broad compatibility. ```shell ffmpeg -i butterfly.mp4 \ -c:v libx264 -bsf:v h264_mp4toannexb \ -b:v 400K -vf "scale=640:360, fps=20" \ -profile baseline -pix_fmt yuv420p \ -x264-params keyint=120 -max_delay 0 -bf 0 \ butterfly_360_400.h264 ``` -------------------------------- ### Encode 540p H.264 Video Source: https://github.com/livekit/livekit-cli/blob/main/pkg/provider/resources/README.md Encodes a video to 540p resolution at 25fps with a target bitrate of 800Kbps. Uses baseline profile for broad compatibility. ```shell ffmpeg -i butterfly.mp4 \ -c:v libx264 -bsf:v h264_mp4toannexb \ -b:v 800K -vf "scale=960:540, fps=25" \ -profile baseline -pix_fmt yuv420p \ -x264-params keyint=120 -max_delay 0 -bf 0 \ butterfly_540_800.h264 ``` -------------------------------- ### Encode 180p H.264 Video Source: https://github.com/livekit/livekit-cli/blob/main/pkg/provider/resources/README.md Encodes a video to 180p resolution at 15fps with a target bitrate of 150Kbps. Uses baseline profile for broad compatibility. ```shell ffmpeg -i butterfly.mp4 \ -c:v libx264 -bsf:v h264_mp4toannexb \ -b:v 150K -vf "scale=320:180, fps=15" \ -profile baseline -pix_fmt yuv420p \ -x264-params keyint=120 -max_delay 0 -bf 0 \ butterfly_180_150.h264 ``` -------------------------------- ### Encode 720p H.264 Video Source: https://github.com/livekit/livekit-cli/blob/main/pkg/provider/resources/README.md Encodes a video to 720p resolution at 30fps with a target bitrate of 2Mbps. Uses baseline profile for broad compatibility. ```shell ffmpeg -i butterfly.mp4 \ -c:v libx264 -bsf:v h264_mp4toannexb \ -b:v 2M -vf "scale=1280:720, fps=30" \ -profile baseline -pix_fmt yuv420p \ -x264-params keyint=120 -max_delay 0 -bf 0 \ butterfly_720_2000.h264 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.