Raspberry Pi Imager is not only a window with buttons. It also has a command-line mode, which fits scripts and a stack of cards that all need the same image.
sudo rpi-imager --cli --sha256 <hash> raspios.img.xz /dev/sdb
The first argument after the options is the image, as a path or a URL. The second is the storage device to write to, for example /dev/mmcblk0 or /dev/sdb. With --sha256, Imager checks that the image matches the hash you give before it writes anything.
A few more documented options for the same mode:
--disable-verifyskips the verification after writing.--disable-ejectdoes not eject the device after verification.--first-run-script <file>adds afirstrun.shto the image, for a setup that needs no screen at first boot.--cloudinit-userdataand--cloudinit-networkconfigadd cloud-init files.
The caveats matter here. Command-line mode needs root on Linux and macOS and does not ask for confirmation before it erases the device, so check the device name twice. By default it refuses to write to system drives, and --enable-writing-system-drives overrides that, which I would leave alone. On Raspberry Pi OS the command is rpi-imager, with the rpi-imager-cli package providing a version that is always in command-line mode. Run rpi-imager --help to see the options your version has.
Further reading: Imager command-line options