Generators & commands

Development 0.2.0.dev · Reviewed 2026-09-07

Use a generator for the feature you want, review its changes, and run the host checks afterward.

Before running a generator

Install the RubyGems package using the quickstart, then run these commands from your Rails app’s root directory. The host must have the Rails authentication generator’s account, session and authentication files. Make your host changes reviewable before generating migrations.

Choose a command

Command after bin/railsWhat it changes
generate add_auth:installChecks host files, writes configuration if absent and runs doctor. Enables no features.
generate add_auth:session_upgradeAdds session migrations, lifecycle wiring, password sign-in and session-management routes.
generate add_auth:email_linkInvokes session adoption and token persistence, adds delivery/binding migrations and email routes.
generate add_auth:challenge turnstileWrites provider configuration for Turnstile.
generate add_auth:challenge recaptcha --version=v2Writes reCAPTCHA configuration for the selected version.
generate add_auth:views --only=email_linkCopies sign-in partials and dedicated layouts, preserving existing files.
generate add_auth:views --only=sessionsCopies session-management views, preserving existing files.

Inspect the host with doctor

Shell
bin/rails add_auth:doctor

Doctor checks enabled session, email, passkey, reauthentication, recovery, notification and challenge wiring, plus generated-file drift. Fix reported issues and run it again. It does not replace delivered-email/browser checks or establish production readiness.

Recover pending delivery

Shell
bin/rails add_auth:deliver_pending

Schedule at least once a minute for deployed hosts. See delivery operations for retry, cancellation and monitoring responsibilities.

After generation

Review the file and migration diff, run bin/rails db:migrate, restart the app and check the actual route. Rerunning supported generators is intended to preserve your edits; inspect conflicts in customized Rails hosts rather than assuming an exact template match.

Something unclear? Suggest a correction Release status

Search documentation

Type to find a guide.

Use Tab to move through results. Escape closes search.