feat: persist API keys via quorum auth config file#8
Merged
Conversation
Adds an `auth` command and config-file layer so users no longer need to `export` CURSOR_API_KEY / ANTHROPIC_API_KEY / QUORUM_PROVIDER in every shell. Keys are saved to ~/.config/quorum/credentials.json (0o600, XDG-aware, QUORUM_CONFIG override). Run-time precedence remains --api-key flag > process.env > config file, so env/CI still overrides. 💘 Generated with Crush Assisted-by: Crush:glm-5.2
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit be0792b. Configure here.
| if (stdin.isTTY) stdin.setRawMode(wasRaw); | ||
| }; | ||
| stdin.on("data", onData); | ||
| }); |
There was a problem hiding this comment.
Hidden input hangs on EOF
Medium Severity
In interactive quorum auth, askHidden only finishes on Enter or Ctrl-C. Ctrl-D (EOF) is ignored, so the promise never resolves, the data listener stays attached, and stdin can remain in raw mode until the process is killed.
Reviewed by Cursor Bugbot for commit be0792b. Configure here.
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.


Summary
quorum authcommand — interactive menu (hidden input, masked display) and non-interactive flags (--cursor-key,--anthropic-key,--provider,--show,--clear) to persist API keys and default provider to~/.config/quorum/credentials.json(0o600, XDG-aware,QUORUM_CONFIGoverride).--api-keyflag andprocess.env, so the resolution order is now:--api-key> env var > config file.setupandresolveProviderread the config file too.src/config.ts— sync cached loader,saveCredentialswithchmod 600, input sanitization (allowlist),maskSecretfor display. 15 new unit tests intest/config.test.ts(path resolution, load/save round-trip, caching, sanitization, masking, permissions).Test plan
npm run typecheck— cleannpm test— 50/50 pass (35 existing + 15 new config tests)quorum auth --cursor-key K --provider cursor→ writes file, mode 600, masked summaryquorum auth --show→ prints masked valuesquorum auth --clear→ empties filequorum setup→ detects keys from config file ([PASS] CURSOR_API_KEY (set))quorum authmenu (TTY hidden input) — cannot test in non-TTY CI💘 Generated with Crush
Note
Medium Risk
Stores API keys on disk (mitigated by 0o600 and sanitization); changes how all exploration commands resolve credentials, though flags and env still override the file.
Overview
Adds
quorum authso users can storeCURSOR_API_KEY,ANTHROPIC_API_KEY, andQUORUM_PROVIDERin an XDG-stylecredentials.json(mode0o600, overridable viaQUORUM_CONFIG), with interactive hidden input,--show/--clear, and non-interactive setters.src/config.tsimplements cached load/save, allowlist sanitization, atomic writes, andmaskSecretfor display. Live runs andquorum setupnow fall back to the file after--api-keyand environment variables; provider resolution follows the same pattern.Docs (README, AGENTS.md) and CLI help document the new command and precedence.
test/config.test.tscovers path resolution, load/save, permissions, masking, and non-interactiveauth.Reviewed by Cursor Bugbot for commit f6f06b7. Bugbot is set up for automated code reviews on this repo. Configure here.