-
Notifications
You must be signed in to change notification settings - Fork 52
feat: automatic cloudflare login #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
commit: |
🚀 Website Preview DeployedYour website preview is ready! Preview URL: This preview was built from commit de8f66b 🤖 This comment will be updated automatically when you push new commits to this PR. |
@claude please add a new command in alchemy/bin for
|
Claude finished @sam-goodwin's task —— View job I've successfully added the Tasks:
✅ Implementation Complete! I've successfully added the
Usage: # Login with default scopes (all available)
alchemy login
# Login with custom scopes
alchemy login --scopes="account:read,user:read,workers:write" The implementation:
Committed as: |
Add new `alchemy login` command that reuses the OAuth login flow from this PR: - Export `DefaultScopes` and add `loginToCloudflare()` function in auth.ts - Support custom scope override in OAuth authorize method - Add login command handler with user-friendly prompts - Integrate login command into main CLI router with scope CLI argument support Usage: - `alchemy login` (uses default scopes) - `alchemy login --scopes="account:read,user:read"` (custom scopes) Co-authored-by: sam <[email protected]>
🚀 Website Preview DeployedYour website preview is ready! Preview URL: https://9f7588d3-alchemy-website.alchemy-run.workers.dev This preview was built from commit d6d05d6 🤖 This comment will be updated automatically when you push new commits to this PR. |
Replaced by #631 |
Automatically logs in with Cloudflare when Wrangler config is unavailable or if the token refresh fails. Should help with #438.
open
— this is because opening the URL cross-platform gets messy fast. I tried a simpler in-house method but seemed to completely butcher the URL. Happy to look at this further if we want to avoid the dependency.alchemy create
CLI.Idea: It would be really cool if we marked API requests as requiring specific scopes so we can start the reauthorization flow automatically if we hit an auth error.