Repository navigation
feat: add excalidraw login and logout - #3
Merged
Merged
Conversation
- login asks for a sign-in method (API key; OAuth is listed as coming soon), reads the key without echoing it, checks it with GET /workspaces and saves it; a key the API rejects isn't saved - login --api-key <key> saves a key without asking; without a terminal, login says how to pass one instead of saving EXCALIDRAW_API_KEY - keys are saved per API origin in ~/.config/excalidraw-cli/credentials.json (%APPDATA% on Windows), readable only by the user; the file is versioned, so an older CLI refuses a newer file instead of misreading or overwriting it, and login replaces a damaged one - --api-key and EXCALIDRAW_API_KEY take precedence over the saved key; whoami reports which one is in use as credentialSource - logout removes the key for the origin; login and logout print a confirmation instead of JSON - on Windows, writes wait briefly while another program has the file open and never leave the temporary copy behind - the prompts come from @clack/prompts, bundled into a chunk only login loads - tests run with an empty config directory, so a developer's saved key can't reach them Opus 5.5 (xhigh)
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.
excalidraw loginasks how to sign in, then for the key, without echoing it:GET /workspacesand saved only if the API accepts itlogin --api-key <key>saves a key without asking; without a terminal,loginsays how to pass one instead of savingEXCALIDRAW_API_KEY~/.config/excalidraw-cli/credentials.json(%APPDATA%on Windows), readable only by the user, so a staging key never goes to productionloginreplaces a damaged file--api-keyandEXCALIDRAW_API_KEYstill win over the saved key;whoamireports which one is in use ascredentialSource(flag,env,login), andlogin/logoutwarn when the variable is setlogoutremoves the key for the origin;loginandlogoutprint a confirmation instead of JSON@clack/prompts, bundled into a 61 KB chunk that onlyloginloadsOpus 5.5 (xhigh)