Prerequisites
Before installing OAuth Init, ensure you have one of the following package managers installed:- Node.js 18+ (for npm)
- Bun 1.0+ (recommended for best performance)
- pnpm 8+
For Google OAuth setup, you’ll also need the gcloud CLI installed and authenticated. This is not required for GitHub or Discord providers.
Install OAuth Init
Choose your preferred package manager to install OAuth Init globally:-g flag installs the CLI globally, making the oauth-init command available from anywhere in your terminal.
Verify Installation
Confirm that OAuth Init was installed successfully by running:Provider-Specific Setup
Google OAuth Requirements
To set up Google OAuth, you need the gcloud CLI installed and authenticated:Install gcloud CLI
Download and install the Google Cloud CLI for your operating system
Authenticate with Google Cloud
Run the following command and complete the browser authentication flow:
GitHub OAuth Requirements
No special setup required! OAuth Init will:- Open GitHub pages in your browser for authentication
- Guide you through creating either a GitHub App or OAuth App
- Automatically exchange credentials (for GitHub Apps)
For GitHub App setup (one-click method), OAuth Init starts a temporary local server on port 3004 to receive the OAuth callback. Make sure this port is available.
Discord OAuth Requirements
No special setup required! You just need:- A Discord account
- Access to the Discord Developer Portal
CLI Flags
OAuth Init supports several command-line flags to customize behavior:--help or -h
Display help information and exit:
--quiet or -q
Reduce output verbosity for minimal logging:
- Step messages are suppressed
- Info messages are hidden
- Only critical prompts and errors are shown
--no-open or -n
Prevent OAuth Init from automatically opening browser URLs:
- Running in a headless environment
- Using a remote server via SSH
- Configuring OAuth in CI/CD pipelines
- You prefer to manually copy and paste URLs
Update OAuth Init
To update to the latest version of OAuth Init:Uninstall
If you need to uninstall OAuth Init:Troubleshooting
Command not found after installation
Command not found after installation
If
oauth-init is not found after installation, ensure that your global package binaries are in your PATH:- For npm: Check that
npm config get prefix/bin is in your PATH - For bun: Ensure
~/.bun/binis in your PATH - For pnpm: Check that pnpm’s global bin directory is in your PATH
Permission errors during installation
Permission errors during installation
If you encounter permission errors with npm:Consider using nvm (Node Version Manager) to avoid permission issues.
gcloud CLI not found
gcloud CLI not found
If OAuth Init reports that gcloud CLI is not found:
- Install gcloud CLI from https://cloud.google.com/sdk/docs/install
- Initialize it by running:
gcloud init - Authenticate by running:
gcloud auth login - Verify installation:
gcloud version
Next Steps
Now that OAuth Init is installed, you’re ready to configure your first OAuth provider:Quickstart Tutorial
Follow our step-by-step guide to set up Google, GitHub, or Discord OAuth in minutes