What is OAuth Init?
OAuth Init is an interactive CLI tool that eliminates the pain of setting up OAuth providers for your web applications. Instead of manually navigating through multiple console pages, copying IDs, and managing credentials across different platforms, OAuth Init walks you through the entire process step-by-step. The CLI automatically detects your authentication library (next-auth, better-auth, lucia, arctic, etc.), suggests the correct callback URLs, opens the right console pages, validates your inputs, and saves credentials wherever you need them.Key Features
Smart Detection
Automatically detects your auth library and suggests appropriate callback URLs for next-auth, better-auth, lucia, arctic, and more
Interactive Setup
Beautiful CLI interface powered by @clack/prompts guides you through each step with clear instructions and validation
Multiple Providers
Support for Google OAuth 2.0, GitHub Apps, GitHub OAuth Apps, and Discord OAuth with more providers coming soon
Flexible Output
Save credentials to .env, .env.local, JSON files, or print directly to console - your choice
GCP Integration
Seamlessly integrates with gcloud CLI to fetch your Google Cloud projects and streamline OAuth setup
CI/CD Ready
Non-interactive mode with —no-open flag for automated environments and CI pipelines
Supported OAuth Providers
Google OAuth 2.0
Full integration with Google Cloud Console including project selection and consent screen setup
GitHub Apps
One-click GitHub App creation using manifest flow with automatic credential exchange
GitHub OAuth Apps
Traditional OAuth App setup with guided form completion
Discord OAuth
Discord Developer Portal integration with application creation and redirect configuration
Supported Auth Libraries
OAuth Init automatically detects and configures callback URLs for popular authentication libraries:- next-auth -
/api/auth/callback/[provider] - @auth/core -
/api/auth/callback/[provider] - better-auth -
/api/auth/callback/[provider] - lucia -
/auth/callback - arctic -
/auth/callback/[provider] - iron-session -
/api/auth/callback
If no auth library is detected, OAuth Init uses a generic callback pattern:
/oauth/callback/[provider]How It Works
The CLI orchestrates OAuth setup through a carefully designed workflow:Discovery
Detects your project’s authentication library from package.json and determines the appropriate callback URL pattern
Provider Selection
Presents an interactive multi-select menu to choose which OAuth providers you want to configure
Guided Setup
For each provider, opens the correct console pages and provides step-by-step instructions with validation
Credential Capture
Collects client IDs and secrets with format validation to ensure correct configuration
Quick Example
Here’s what the OAuth Init CLI looks like in action:Get Started
Ready to simplify your OAuth setup? Head over to the Installation guide to get started, or jump straight to the Quickstart tutorial to configure your first provider.Installation
Install OAuth Init globally via npm, bun, or pnpm
Quickstart
Follow a step-by-step tutorial to set up your first OAuth provider