feat(e13-s6): add --auto/-a one-flag local credential sweep with dedup - #64
Merged
Conversation
Collapse the five source flags into one --auto/-a that sweeps clipboard + env + ~/.claude + ~/.codex, dedups by (base_url, api_key) against existing profiles, and offers only new credentials. Amend ADR-0003 to admit read-only best-effort clipboard access for --auto. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Collapses the five source flags into one.
claudecm add <name> --auto(-a) sweeps every local source at once and skips credentials you already have — the "just find my key" path.~/.claude/settings.json→~/.codex/{auth.json,config.toml}.pbpaste/wl-paste/xclip/xsel/PowerShellGet-Clipboardbehind an injectable seam; absent tool → skipped with a reason, never fails.envextract; config files via the existing claude-code / codex adapterImport.(base_url, api_key)againstLoadAllProfiles()→ each candidate markedNEWoralready recorded as <profile>(secrets redacted).--from-*/--preset, and (post-review) with the identity flags--api-key/--base-url; reuses--dry-run/redaction/validation/overwrite; no auto-activation.Review trail
Fresh-context adversarial review → REQUEST_CHANGES (2 High + 3 Medium), all remediated in
9444f9a:--auto --api-key=could write a keyless profile (identity check ran before flag override). Fixed: no-key check now applies to the final merged draft including--auto.--auto --api-key <existing>could bypass dedup. Fixed:--autois now mutually exclusive with the identity flags (--api-key/--base-url);--modeletc. still allowed.:443vs none), JSON-mode disambiguation list missing, test harness couldn't simulate--api-key=. All fixed.Evidence
~/.claude/~/.codexcopied into an isolated HOME): sweep found env +~/.claudecandidates, clipboard + malformed codex config skipped with reasons, multi-NEW non-TTY refused; after recording one, re-run reportedalready recorded as envpand built the sole remaining NEW as a draft.--auto --api-key=refuses (exit 1);--auto --api-key/--base-urlrefuse (mutual exclusion);--auto --modelallowed.go test ./...+go vet ./...clean; adversarial review confirmed no secret leakage, no clipboard command-injection, best-effort source isolation.🤖 Generated with Claude Code