A modern TUI-inspired Diceware passphrase generator written in Go with Lip Gloss.
$ go build -o diceware ./cmd/diceware
$ go install ./cmd/diceware$ docker build -t diceware .$ diceware -versionGenerate passphrases:
$ diceware -i wordlists/wordlist-basque-diceware.txt -n 7 -interval 2sJoin the words with something other than a space:
$ diceware -i wordlists/wordlist-basque-diceware.txt -sep - -plain
malko-beira-soldadu-plastifikatu-ekuazio-datxadiceware -i <wordlist-file|-> [flags]
-i wordlist file, or - for stdin (required)
-n number of passphrases to generate (default 1)
-w number of words per passphrase (default 6)
-sep string placed between words (default " ")
-interval refresh interval in live mode (default 5s)
-once generate once and exit (default false)
-plain print only the passphrases and exit (default false)
-version print the version and exit
-h print help and exitWhen standard output is not a terminal the live view is skipped and only the
passphrases are printed, so a pipe or a redirect behaves like -plain without
the flag. Colors follow NO_COLOR.
The wordlist reader and the generator are importable without the CLI:
$ go get go.hasteful.org/dicewarepackage main
import (
"fmt"
"go.hasteful.org/diceware"
)
func main() {
words, err := diceware.LoadWords("wordlists/wordlist-basque-diceware.txt")
if err != nil {
panic(err)
}
phrases, err := diceware.GenerateList(words, 1, 6, " ")
if err != nil {
panic(err)
}
fmt.Println(phrases[0])
}If you're interested in using your own wordlists with diceware, the EFF wordlists are a good starting point:
$ curl -fsSL https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt | diceware -i - -w 6 -plain
freeing dispose unaware amicably implosion wieldableLicensed under the MIT License. See LICENSE for details.
Copyright (c) 2026-present hasteful
