Repository navigation
fix(lk): --dev with an API key or secret is an error - #1084
Merged
Topherhindman merged 2 commits intoOct 27, 2026
Merged
Conversation
--api-key and --api-secret also read LIVEKIT_API_KEY and LIVEKIT_API_SECRET, so --dev in a shell with those set made resolveProject fail with "both api-key and dev flags are set". requireProjectWithOpts treated that like nothing resolving and fell back to selectProject, which in non-interactive mode quietly used the only configured project: lk acted on a cloud project instead of the local dev server. It now returns the error, as it does for a --project or --subdomain that doesn't resolve. The error names what to remove: the env var when the value is the env var's, the flag otherwise, e.g. "--dev can't be combined with API key credentials; unset LIVEKIT_API_KEY or drop --dev". Commands using loadProjectDetails already failed here, and now get the same message. --dev alone, or with --url, is unchanged.
In API-key mode, --dev with an API key or secret from a flag or the environment is now an error for every command, so the property requires lk to fail without naming a project, instead of letting room list fall back to the only configured project.
rektdeckard
approved these changes
Oct 27, 2026
Topherhindman
deleted the
topherhindman/lk-dev-with-api-key-is-an-error
branch
October 27, 2026 22:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--api-key and --api-secret also read LIVEKIT_API_KEY and LIVEKIT_API_SECRET. So
lk --dev room listin a shell with those set made project resolution fail with "both api-key and dev flags are set". Commands that pick a project (room, sip, number, token create, app, cloud agents) treated that failure like nothing resolving and fell back to project selection. Non-interactive with one configured project, lk quietly acted on that cloud project instead of the local dev server. In a terminal you got the project picker instead.This makes the conflict an error everywhere, in the same way #1076 did for a --project or --subdomain that doesn't resolve. The message names what to remove:
It says "remove --api-key" when the value came from the flag. Commands that already failed here (egress, ingress, dispatch) now get the same message. --dev alone, or with --url, is unchanged.
Tests: