fix(cli): drop dead API key prompt and tighten TTY detection in onboarding - #7
Merged
Merged
Conversation
The provider picker previously prompted for an API key with masked input
and then discarded the typed value, writing only a ${{ secrets.NAME }}
reference into config.yaml. The user reasonably expects the key they just
typed to be saved, but it was thrown away.
Replace the apiKey step with a confirm step that shows the env var the
user needs to set and waits for any keypress. The matching
README, CHANGELOG, and spec/onboarding.md are updated to drop the
"enter the API key" wording and document the env-var reminder.
Add ink-testing-library coverage for the picker to prevent regressions
on the navigation, escape, simple-provider confirm, and apiBase flows.
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
runOnboardingFlow only checked process.stdin.isTTY. In some CI/container setups stdin looks like a TTY while stdout is redirected, which would cause Ink to hang on useInput. Add process.stdout.isTTY to the non-interactive heuristic and a comment explaining why the check is conservative, plus a regression test. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.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.
Summary
Two fixes plus a regression-test sweep for the new provider-picker onboarding flow.
fix(cli): stop collecting API key in provider picker
The picker previously prompted for an API key with masked input and then silently discarded the typed value, writing only a
${{ secrets.NAME }}reference into~/.continue/config.yaml. The user reasonably expects the key they just typed to be saved, but it was thrown away.apiKeystep and replace it with aconfirmstep that names the env var the user needs to set (Set OPENAI_API_KEY in your shell, ~/.continue/.env, or your project .env before running the CLI.) and waits for any keypress.modelstate and thesecretmasking branch onInputLine.README.md,CHANGELOG.md, andspec/onboarding.mdto drop the "enter the API key" wording and document the env-var reminder.fix(cli): also treat missing stdout TTY as non-interactive
runOnboardingFlowonly checkedprocess.stdin.isTTY. In some CI/container setups stdin looks like a TTY while stdout is redirected, which would cause Ink to hang onuseInput. Addprocess.stdout.isTTYto the heuristic and a comment explaining the conservative choice. Add a regression test.Test coverage
Add
ink-testing-librarycoverage forProviderPicker(none existed) to prevent the cascade of fix-after-fix commits we saw in this area:jonSelectwith the correctapiKeySecret, and shows the env-var reminder (catches the bug fixed above)apiBasefor providers that need one and passes it through toonSelectValidation
npx prettier --checkon all 7 touched files: cleannpx eslintonProviderPicker.tsx,ProviderPicker.test.tsx,onboarding.ts,onboarding.test.ts: cleannpx tsc --noEmit -p tsconfig.jsonfiltered to my files: no new errors (othertscerrors are pre-existing incore/from missing local-package builds)npx vitest run src/ui/components/ProviderPicker.test.tsx src/onboardingProviders.test.ts: 9/9 passOut of scope (not changed, called out for reviewers)
claude-sonnet-4-6is the intended Anthropic model identifier across the repo (core/llm/llms/Anthropic.ts,packages/llm-info/src/providers/anthropic.ts, etc.). No change.fixcommit" suggestsnpm run format/npm run lint/npm testare not being run before opening a PR, contrary toextensions/cli/AGENTS.md. Husky + lint-staged only runsprettier --writeon staged files. Consider strengthening the pre-push or CI gate.Files changed