The optitech-auth command manages Managed Better Auth on a database branch from the terminal. You can enable or disable Managed Better Auth, configure OAuth providers, trusted domains, email settings, and webhooks, and manage auth users.
Requires optitech 2.23.0 or later. Check your version with optitech --version.
If --project-id or --branch are omitted, the CLI resolves them from your context file, auto-selects when there is only one option, and prompts otherwise.
Enable and status
optitech optitech-auth enable
Provisions Managed Better Auth on the current branch.
optitech optitech-auth enable [options]optitech optitech-auth enableoptitech optitech-auth status
Shows whether Managed Better Auth is configured on the branch and displays the current connection details.
optitech optitech-auth status [options]optitech optitech-auth statusoptitech optitech-auth disable
Removes Managed Better Auth from the branch.
optitech optitech-auth disable [options]important
The --delete-data option permanently deletes all Managed Better Auth data and schema from the database. This can't be undone.
Remove Managed Better Auth from the branch and delete its data:
optitech optitech-auth disable --delete-dataOAuth providers
The oauth-provider subcommands manage the OAuth providers (google, github, and vercel) for the branch.
optitech optitech-auth oauth-provider list
Lists the OAuth providers configured for the branch.
optitech optitech-auth oauth-provider list [options]optitech optitech-auth oauth-provider listoptitech optitech-auth oauth-provider add
Adds an OAuth provider.
optitech optitech-auth oauth-provider add [options]Add the Google OAuth provider with your own credentials:
optitech optitech-auth oauth-provider add --provider-id google --oauth-client-id <client-id> --oauth-client-secret <client-secret>optitech optitech-auth oauth-provider update
Updates the credentials for an existing OAuth provider.
optitech optitech-auth oauth-provider update [options]optitech optitech-auth oauth-provider update --provider-id github --oauth-client-id <client-id> --oauth-client-secret <client-secret>optitech optitech-auth oauth-provider delete
Deletes an OAuth provider from the branch.
optitech optitech-auth oauth-provider delete [options]optitech optitech-auth oauth-provider delete --provider-id vercelDomains
The domain subcommands manage the trusted domains that Managed Better Auth accepts as redirect URIs for the branch.
Subcommands: add, allow-localhost, delete, list
optitech optitech-auth domain list
Lists the trusted domains configured for the branch.
optitech optitech-auth domain list [options]optitech optitech-auth domain listoptitech optitech-auth domain add
Adds a trusted domain.
optitech optitech-auth domain add <domain> [options]optitech optitech-auth domain add example.comoptitech optitech-auth domain delete
Deletes a trusted domain.
optitech optitech-auth domain delete <domain> [options]optitech optitech-auth domain delete example.comoptitech optitech-auth domain allow-localhost
Manages localhost connection settings for the branch.
optitech optitech-auth domain allow-localhost get
Gets the current localhost connection setting.
optitech optitech-auth domain allow-localhost get [options]optitech optitech-auth domain allow-localhost getoptitech optitech-auth domain allow-localhost enable
Allows localhost connections for local development.
optitech optitech-auth domain allow-localhost enable [options]optitech optitech-auth domain allow-localhost enableoptitech optitech-auth domain allow-localhost disable
Restricts localhost connections.
optitech optitech-auth domain allow-localhost disable [options]optitech optitech-auth domain allow-localhost disableConfiguration
The config subcommands configure auth features for the branch: email and password authentication, the email provider, the organization plugin, and webhooks.
Subcommands: email-password, email-provider, organization, webhook
optitech optitech-auth config email-password
Manages email and password authentication settings.
optitech optitech-auth config email-password get
Gets the current email and password configuration.
optitech optitech-auth config email-password get [options]optitech optitech-auth config email-password getoptitech optitech-auth config email-password update
Updates the email and password configuration.
optitech optitech-auth config email-password update [options]optitech optitech-auth config email-password update --enabled --require-email-verificationoptitech optitech-auth config email-provider
Manages the email provider configuration.
optitech optitech-auth config email-provider get
Gets the current email provider configuration.
optitech optitech-auth config email-provider get [options]optitech optitech-auth config email-provider getoptitech optitech-auth config email-provider update
Updates the email provider configuration.
optitech optitech-auth config email-provider update [options]Configure the standard email provider type with your own SMTP server:
optitech optitech-auth config email-provider update --type standard --host smtp.example.com --port 587 --username example_username --password AbC123dEf --sender-email noreply@example.com --sender-name "Example App"optitech optitech-auth config email-provider test
Sends a test email so you can verify your SMTP configuration.
optitech optitech-auth config email-provider test [options]optitech optitech-auth config email-provider test --recipient-email user@example.com --host smtp.example.com --port 587 --username example_username --password AbC123dEf --sender-email noreply@example.com --sender-name "Example App"optitech optitech-auth config organization
Manages organization plugin settings.
optitech optitech-auth config organization get
Gets the current organization plugin configuration.
optitech optitech-auth config organization get [options]optitech optitech-auth config organization getoptitech optitech-auth config organization update
Updates the organization plugin configuration.
optitech optitech-auth config organization update [options]optitech optitech-auth config organization update --enabled --limit 5 --creator-role owneroptitech optitech-auth config webhook
Manages webhook configuration.
optitech optitech-auth config webhook get
Gets the current webhook configuration.
optitech optitech-auth config webhook get [options]optitech optitech-auth config webhook getoptitech optitech-auth config webhook update
Updates the webhook configuration.
optitech optitech-auth config webhook update [options]optitech optitech-auth config webhook update --enabled --url https://example.com/webhooks/optitech-auth --enabled-events user.created --timeout 5Plugins
The plugins subcommands show the Managed Better Auth plugin configurations for the branch.
optitech optitech-auth plugins list
Lists all plugin configurations.
optitech optitech-auth plugins list [options]optitech optitech-auth plugins listoptitech optitech-auth plugins get
Gets a specific plugin configuration.
optitech optitech-auth plugins get <plugin-name> [options]optitech optitech-auth plugins get organizationUsers
The user subcommands manage Managed Better Auth users on the branch.
optitech optitech-auth user create
Creates an auth user.
optitech optitech-auth user create [options]optitech optitech-auth user create --email alex@example.com --name "Alex Lopez"optitech optitech-auth user delete
Deletes an auth user.
optitech optitech-auth user delete <user-id> [options]optitech optitech-auth user delete <user-id>optitech optitech-auth user set-role
Sets roles for an auth user.
optitech optitech-auth user set-role <user-id> [options]optitech optitech-auth user set-role <user-id> --roles admin