Problem
Current behavior in LiveKit CLI binds all commands (e.g. lk room list) to the active default project. Switching context requires mutating global state via lk project set-default, then restoring it. This introduces friction, breaks command composability, and is unsafe in scripted or concurrent workflows.
Use Case
Multiple environments (localhost, dev, dev1, prod) used in parallel. Need to query or act on a non-default project without altering global selection.
Proposed Solution
Add a --project <name> (alias: -p) flag to all project-scoped commands.
Examples
lk room list --project dev1
lk room create test-room -p dev
lk participant list my-room --project agent-dev
Behavior
-
--projectoverrides the currently selected default project for that command only -
Validation: fail fast if project does not exist in
lk project list.
Optional Extensions
-
--urland--api-keyflags for fully stateless invocation. -
Environment variable override:
LK_PROJECT=dev1 lk room list. -
Support for scripting: no mutation of global config when flags are used.
Benefits
-
Eliminates context switching overhead.
-
Safe for automation and CI pipelines.
-
Aligns with standard CLI patterns (kubectl, aws, gcloud).
-
Enables parallel operations across multiple environments.