fix(cli): add early validation for Cursor API key format#20
Open
DhruvTilva wants to merge 5 commits intocursor:mainfrom
Open
fix(cli): add early validation for Cursor API key format#20DhruvTilva wants to merge 5 commits intocursor:mainfrom
DhruvTilva wants to merge 5 commits intocursor:mainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high mode and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 7e50b0f. Configure here.
Author
|
Cursor[bot] Suggested things was fixed and PR updated.. |
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.

Adds a simple check to ensure
CURSOR_API_KEYstarts withcrsr_.Right now, invalid keys only fail after an API call, which can be confusing. This change catches mistakes early and shows a clear error message.
For example:
abc123→ fails immediately with clear messagecrsr_xxx...→ works as expectedThis matches the validation already used in app-builder, so behavior stays consistent.
no risk only blocks keys that would fail anyway.
Note
Low Risk
Low risk: adds a simple preflight check on an environment variable and fails fast with a clearer error, without changing any API behavior beyond earlier rejection of invalid keys.
Overview
Adds early validation in the
coding-agent-clientrypoint to trimCURSOR_API_KEYand reject keys that don’t start withcrsr_, surfacing a clear error before any prompt/session work begins.Reviewed by Cursor Bugbot for commit b192d33. Bugbot is set up for automated code reviews on this repo. Configure here.