Skip to content

feat(wizard): skip credential prompt when env var present (#24) - #254

Merged
Destynova2 merged 1 commit into
mainfrom
feat/wizard-env-skip
Apr 21, 2026
Merged

feat(wizard): skip credential prompt when env var present (#24)#254
Destynova2 merged 1 commit into
mainfrom
feat/wizard-env-skip

Conversation

@Destynova2

Copy link
Copy Markdown
Contributor

Summary

  • GH-CLI-style behavior: when a provider's env var (ANTHROPIC_API_KEY, OPENAI_API_KEY, …) is already exported, the wizard uses it silently instead of prompting a redundant choice.
  • One-line notice points to the opt-out: `GROB_SETUP_NO_ENV_SKIP=1` restores the legacy multi-choice prompt.

Test plan

  • 4 unit tests: default skip enabled, env opt-out, garbage-ignoring, override shape
  • `cargo clippy --lib --all-features -- -D warnings` clean
  • Manual: run `grob setup` twice, second run with `ANTHROPIC_API_KEY` exported

Audit item #24 (routine, N=3).

🤖 Generated with Claude Code

When an API-key environment variable (ANTHROPIC_API_KEY, OPENAI_API_KEY,
…) is already set, the wizard now behaves like the GitHub CLI: use the
detected key silently instead of offering a redundant prompt.

* Both `auth_env_with_oauth` and `auth_env_no_oauth` short-circuit to
  an auto-accept override that records the `$VAR` reference in config.
* A one-line notice tells the user what happened and points at the
  opt-out: `GROB_SETUP_NO_ENV_SKIP=1` restores the legacy multi-choice
  prompt (kept for users who want to mix env + OAuth).
* Four unit tests cover the env-var parser, the default state, the
  opt-out, and the override produced by auto-accept.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Destynova2
Destynova2 enabled auto-merge (squash) April 21, 2026 21:24
@Destynova2
Destynova2 merged commit 70c3820 into main Apr 21, 2026
42 checks passed
@Destynova2
Destynova2 deleted the feat/wizard-env-skip branch April 21, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant