Setup Options
When you runoauth-init and select GitHub, you’ll choose between:
- GitHub App (One click setup) - Automated setup using GitHub’s app manifest flow
- OAuth App (Manual setup) - Traditional OAuth app requiring form completion
GitHub App (Recommended)
The GitHub App flow uses GitHub’s app manifest API for automated credential generation.Choose Save Option
Select where to save credentials before the app is created:
.env- Save to.envfile.env.local- Save to.env.localfile.json- Save to JSON fileprint to the console- Display in terminal
Authorize in Browser
OAuth Init starts a local server on port GitHub will prompt you to authorize the app creation.
3004 and opens your browser to GitHub.A form is automatically submitted with this manifest:How It Works
The GitHub App flow:- Creates a local HTTP server on
http://localhost:3004 - Opens browser to
/callbackwhich auto-submits a form to GitHub - GitHub creates the app and redirects back with a temporary code
- The code is exchanged for permanent credentials via GitHub’s API
- Credentials are saved and the server shuts down
OAuth App (Manual)
The OAuth App flow requires manual form completion in GitHub’s developer settings.Create OAuth App
OAuth Init opens the GitHub OAuth app registration page:Complete the form:
- Application name - Choose any name for your app
- Homepage URL - Your application’s homepage (e.g.,
http://localhost:3000) - Authorization callback URL - The callback URL provided by OAuth Init
- Click Register application
Get Client Credentials
After creating the app, you’ll see your Client ID immediately.To get the Client Secret:
- Click Generate a new client secret
- Copy the secret (it will only be shown once)
Save Credentials
Choose where to save your credentials:
.env- Save to.envfile in your project root.env.local- Save to.env.localfile (ideal for Next.js projects).json- Save togithub-credentials.jsonfileprint to the console- Display credentials in terminal without saving
Validation
Unlike other providers, GitHub OAuth App setup does not enforce strict validation on the Client ID format. However, GitHub Client IDs typically:- OAuth Apps: Start with
Iv1.followed by 16 hexadecimal characters - GitHub Apps: Use numeric Client IDs
CLI Options
When running OAuth Init, you can use various flags to customize behavior:Comparison
| Feature | GitHub App | OAuth App |
|---|---|---|
| Setup Speed | Fast (one-click) | Slower (manual form) |
| Automation | Fully automated | Manual credential copy |
| Permissions | Preset (contents, metadata) | Configured in GitHub |
| Local Server | Required (port 3004) | Not required |
| Best For | Quick setup, development | Production, custom permissions |