Search by

icebear / drush-uli-qr

Piokamie

Adds a --qr option to Drush's user:login (uli) that prints the one-time login link as an ANSI QR code, scannable with a phone camera straight off the terminal.

Package info

github.com/Piokamie/drush-uli-qr

pkg:composer/icebear/drush-uli-qr

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-08-19 16:09 UTC

This package is auto-updated.

Last update: 2026-09-19 16:28:25 UTC


README

Adds a --qr option to Drush's user:login (uli) command that prints the one-time login link as an ANSI QR code — scan it with a phone camera straight off the terminal.

drush uli --qr --uid=123 --uri=https://example.ngrok.app
 [notice] A one-time login link:

  █▀▀▀▀▀█ ▀▄█▀▄▀▀▄ █▀▀▀▀▀█
  █ ███ █ ▀▄▀█▄▀▄▀ █ ███ █      (scannable QR code,
  █ ▀▀▀ █ █▄▀ ▄▀▀█ █ ▀▀▀ █       ~45 columns wide)
  ▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀

https://example.ngrok.app/user/reset/123/…/login

Why

Getting a one-time login link onto a physical phone is annoying: messaging it to yourself often burns the link because messenger link previews (iMessage and friends) fetch it once — and uli links are single-use. Scanning a QR code off your terminal sidesteps that entirely.

Install

composer require --dev icebear/drush-uli-qr

That's it — Drush ≥ 12 auto-discovers the command hook via the package's PSR-4 Drush\Commands\… namespace. No module to enable, nothing to configure.

Because it lives in require-dev, production --no-dev installs skip it entirely and uli behaves exactly as stock.

Usage

drush uli --qr [--uid=… | --name=… | --mail=…] --uri=<base URL>

Everything user:login already does is unchanged; --qr only adds the QR code above the printed link.

--uri is important

The QR code is only useful if the phone can open the encoded link. Without --uri, the link is minted on your site's default local host (e.g. myproject.ddev.site, which publicly resolves to 127.0.0.1) — unreachable from a phone. The command warns when the minted host is localhost-only (localhost, 127.0.0.1, *.localhost, *.ddev.site, *.lndo.site).

Pass a base URL the phone can reach, e.g.:

  • a tunnel URL — ddev share / ngrok / Cloudflare Tunnel;
  • a LAN address or reverse-proxy origin, e.g. --uri=http://192.168.1.50:8899.

Requirements

License

MIT