diff --git a/plugins/genpass/genpass.plugin.zsh b/plugins/genpass/genpass.plugin.zsh
index e7f86bf7a1a4dd46ba0426e9152f21b4212dad37..f1ad80bbad395c0c1d5aa140c6aaf7e192d48e67 100644
--- a/plugins/genpass/genpass.plugin.zsh
+++ b/plugins/genpass/genpass.plugin.zsh
@@ -75,6 +75,12 @@ genpass-xkcd() {
   # Generates a 128-bit XKCD-style passphrase
   # EG, 9-mien-flood-Patti-buxom-dozes-ickier-pay-ailed-Foster
   # Can take a numerical argument for generating extra passwords
+
+  if (( ! $+commands[shuf] )); then
+    echo >&2 "$0: \`shuf\` command not found. Install coreutils (\`brew install coreutils\` on macOS)."
+    return 1
+  fi
+
   local -i i num
 
   [[ $1 =~ '^[0-9]+$' ]] && num=$1 || num=1