feat(auth): Add welcome screen and claw auth command for provider setup#2975
Closed
bloodf wants to merge 1 commit intoultraworkers:mainfrom
Closed
feat(auth): Add welcome screen and claw auth command for provider setup#2975bloodf wants to merge 1 commit intoultraworkers:mainfrom
bloodf wants to merge 1 commit intoultraworkers:mainfrom
Conversation
When opening claw without a configured provider API key, users now see an interactive welcome screen instead of a hard error. They can select a provider, enter their API key, and continue using claw immediately. ## Changes ### Welcome Screen - Automatically shown at REPL startup or prompt mode when auth is missing - Lists built-in providers (Anthropic, OpenAI, xAI) - Sets the env var for the current process so claw works immediately - Optionally saves the model choice to ~/.claw/settings.json - Supports cancellation (press Enter without entering a key) ### New CLI Command: `claw auth [PROVIDER]` - Authenticate with a specific provider directly: `claw auth openai` - Without a provider argument, shows the interactive picker - Sets env vars for the current session ### Implementation - Added `BuiltinProvider` struct and constants for built-in providers - Added `check_model_auth_available()` to detect missing credentials - Added `run_provider_welcome()` for the interactive onboarding flow - Added `run_auth_command()` for the CLI subcommand - Hooked welcome screen into `run_repl()` and `Prompt` mode dispatch - Added `CliAction::Auth` variant and `parse_args` support - Updated help text and typo-suggestion list - Added unit tests for auth subcommand parsing ## Testing - `cargo check --workspace` passes - New unit tests: `parse_args_auth_without_provider`, `parse_args_auth_with_provider`
Contributor
|
REQUEST_CHANGES from dogfood/review on head Blockers:
Dogfood evidence:
Required delta: either persist auth intentionally and securely, or change the UX/copy so — |
Author
|
Superseded by #2977 which combines provider profiles, auth, and OAuth into a single PR. |
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
When opening claw without a configured provider API key, users now see an interactive welcome screen instead of a hard error. They can select a provider, enter their API key, and continue using claw immediately.
Changes
Welcome Screen
New CLI Command:
claw auth [PROVIDER]claw auth openaiImplementation
BuiltinProviderstruct and constants for built-in providerscheck_model_auth_available()to detect missing credentialsrun_provider_welcome()for the interactive onboarding flowrun_auth_command()for the CLI subcommandrun_repl()andPromptmode dispatchCliAction::Authvariant andparse_argssupportTesting
cargo check --workspacepassesparse_args_auth_without_provider,parse_args_auth_with_provider