Skip to content


Repository files navigation


Build Status

This is a simple password generator written in golang. This tool is based and inspired from , thanks Vargo.

Some improvements

  • A simple command interface for users
  • Clipboard support for Linux(Xorg/Wayland), macOS, Windows etc.

Build and Usage

Just run make build to build genpasswd(require go version > 1.11). The genpasswd has many params, including:

    	Allows characters to repeat (default true)
  -copies int
    	Generate copies of password (default 1)
  -digits int
    	Number of digits to include in the password (default 4)
  -length intv
    	Specify the password length (default 16)
    	Do not copy to clipboard
    	Excludes uppercase letters from the results (default true)
  -symbols int
    	Number of digits to include in the password (default 4)
    	Print version and exit

Running in Docker

Run make docker_image to build Docker image for gopasswd, if u wanna running this tool in contrainer.

Then, type docker run --rm genpasswd:0.0.1 to run genpasswd after build is completed.

That's it, have fun!

-- from original go-password library.


This library implements generation of random passwords with provided requirements as described by AgileBits 1Password in pure Golang. The algorithm is commonly used when generating website passwords.

The library uses crypto/rand for added randomness.

Sample example passwords this library may generate:



$ go get -u


package main

import (


func main() {
  // Generate a password that is 64 characters long with 10 digits, 10 symbols,
  // allowing upper and lower case letters, disallowing repeat characters.
  res, err := password.Generate(64, 10, 10, false, false)
  if err != nil {

See the GoDoc for more information.


This code is licensed under the MIT license.