rich-monitor-70665
05/05/2026, 3:15 PMtall-airline-16756
05/05/2026, 3:15 PMtall-airline-16756
05/05/2026, 3:15 PM.env but lk room list still uses LiveKit Cloud. A few likely causes and quick checks:
1. .env is not automatically loaded by your shell. Source it or export variables:
◦ Run source .env (or export LIVEKIT_URL=... etc.), then run lk room list.
◦ Or prefix the command:
LIVEKIT_URL=http://localhost:7880 LIVEKIT_API_KEY=your-key LIVEKIT_API_SECRET=your-secret lk room list
1. CLI precedence: command flags override environment vars, and environment vars override stored config. If you previously authenticated to Cloud, stored credentials in ~/.livekit/ may be used. To force local:
◦ Use flags: lk room list --url http://localhost:7880 --api-key your-key --api-secret your-secret
1. Verify what the shell actually sees:
◦ echo $LIVEKIT_URL
◦ echo $LIVEKIT_API_KEY
If those echo the local values and it still hits cloud, tell me:
• The outputs of the two echo commands above
• Your OS / shell (bash, zsh, fish, Windows)
I’ll guide the next step.
, with interactive elementsrich-monitor-70665
05/05/2026, 3:16 PM$LIVEKIT_URL ...tall-airline-16756
05/05/2026, 3:16 PMecho $LIVEKIT_URL show exactly (include protocol, e.g., http:// or ws://)?
2. Check for higher-priority config:
◦ Do you have a livekit.toml in the current directory?
◦ Do you have a ~/.livekit/ config (list it with ls -la ~/.livekit)?
1. Try forcing the local instance once to see behavior:
lk room list --url http://localhost:7880 --api-key your-key --api-secret your-secret
1. If that works, remove or update stored cloud creds:
◦ Run lk logout or rename/remove ~/.livekit/ (e.g., mv ~/.livekit ~/.livekit.bak) and retry.
Tell me the exact output of echo $LIVEKIT_URL, whether lk room list --url ... succeeds, and the results of ls -la ~/.livekit. I'll guide the next step.
Sources: Troubleshooting 401 Unauthorized and Token Errors | LiveKit, with interactive elementsrich-monitor-70665
05/05/2026, 3:37 PMtall-airline-16756
05/05/2026, 3:38 PMlk room list against the cloud project while your default is localhost. You can do that per command without changing env or config.
1. Run the command with cloud credentials to override the default:
lk room list --url wss://your-project.livekit.cloud --api-key YOUR_CLOUD_API_KEY --api-secret YOUR_CLOUD_API_SECRET
1. If you prefer to authenticate once and make the cloud project available as a default, run:
lk cloud auth
This links the cloud project to the CLI (it may change your default project).
If you want, tell me:
• the cloud project's URL (example form: wss://...livekit.cloud) or
• whether you’d like a short alias/workflow to switch frequently and I’ll suggest a script or shell alias. Sources: Voice AI quickstart | LiveKit Documentation, with interactive elementsrich-monitor-70665
05/05/2026, 3:38 PMtall-airline-16756
05/05/2026, 3:38 PM--project cloud-style switch in the lk CLI.
The CLI does not provide a --project flag. To target a different project for a single command you must either:
• Pass the project's connection info on the command line:
lk room list --url wss://your-project.livekit.cloud --api-key YOUR_CLOUD_API_KEY --api-secret YOUR_CLOUD_API_SECRET
• Or authenticate the cloud project once so it becomes a CLI context:
lk cloud auth
(which can change your default project)
If you want a shorter workflow, I can help you create:
• shell aliases (e.g., alias lk-cloud="lk room list --url ... --api-key ... --api-secret ..."), or
• a small script to switch profiles and run lk commands.
Which option would you like help with (alias, script, or auth flow)?
, with interactive elements