{"id":24434040,"url":"https://github.com/itspriddle/bashword","last_synced_at":"2025-09-11T02:32:58.386Z","repository":{"id":38281749,"uuid":"399913090","full_name":"itspriddle/bashword","owner":"itspriddle","description":"Pure Bash password/passphrase generator","archived":false,"fork":false,"pushed_at":"2024-02-02T12:01:09.000Z","size":812,"stargazers_count":13,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T22:17:04.507Z","etag":null,"topics":["bash","linux","macos","password","password-generator","windows","wsl"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itspriddle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-25T18:03:08.000Z","updated_at":"2025-03-20T19:02:51.000Z","dependencies_parsed_at":"2025-01-20T16:53:08.064Z","dependency_job_id":null,"html_url":"https://github.com/itspriddle/bashword","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fbashword","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fbashword/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fbashword/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fbashword/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itspriddle","download_url":"https://codeload.github.com/itspriddle/bashword/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372947,"owners_count":21419722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","linux","macos","password","password-generator","windows","wsl"],"created_at":"2025-01-20T16:53:06.232Z","updated_at":"2025-04-23T04:51:30.981Z","avatar_url":"https://github.com/itspriddle.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bashword -- pure Bash password generator\n\n`bashword` is a password generator written in\n[Bash](https://www.gnu.org/software/bash/). It has no dependencies other than\nBash and is designed to work on the versions shipped with macOS, Linux, and\nWindows WSL.\n\nAttempts have been made to ensure `bashword` generates random results, but it\nis not meant to be a cryptographically secure program. It is mainly intended\nto supplement a password manager like [1Password](https://1password.com),\n[LastPass](https://www.lastpass.com), or [BitWarden](https://bitwarden.com) by\nproviding a quick way to generate a password that the manager can auto-save.\n\nThe main goal of `bashword` is to encourage healthy password practices by\nproviding an easy to use tool that can be very quickly installed across a\nvariety of modern computers.\n\n## Usage\n\nBy default, `bashword` generates passwords 20 characters in length that\ninclude at least: one number, one symbol, one lower case character, and one\nupper case character.\n\nPassphrases can be generated from a word list using the `--passphrase` option.\nBy default passphrases are 3 words separated by `-` using words between 5 and\n8 characters.\n\nPINs can be generated using the `--pin` option. By default PINs are 4 digits\nlong.\n\n### Options\n\n*-LENGTH*, *--length LENGTH*  \n    For passwords and PINs, this option specifies the total number of\n    characters used, and defaults to 20 for passwords and 4 for PINs. When\n    used along with options `-s`, `-n`, `-u`, or `-l`, an error is emitted if\n    they would prevent the specified length from being met (i.e. `-s 20` would\n    exceed a LENGTH of 10).  For passphrases, this option specifies the total\n    number of words used, and defaults to 3.\n\n*-p*, *--passphrase*  \n    Generates a passphrase using dictionary words instead of a password of\n    random characters.\n\n*-P*, *--pin*  \n    Generates a numeric PIN.\n\n*-n [COUNT]*, *--numbers [COUNT]*  \n    For passwords, this option specifies the number of numbers to include in\n    the generated password. If no COUNT is specified, at least one number is\n    guaranteed to be included. For passphrases and PINs, this option has no\n    effect.\n\n*-N*, *--no-numbers*  \n    For passwords, this option forces the password to include no numbers at\n    all. For passphrases and PINs, this options has no effect.\n\n*-s [COUNT]*, *--symbols [COUNT]*  \n    For passwords, this option specifies the number of symbols to include in\n    the generated password. If no COUNT is specified, at least one symbol is\n    guaranteed to be included. For passphrases and PINs, this option has no\n    effect.\n\n*-S*, *--no-symbols*  \n    For passwords, this option forces the password to include no symbols at\n    all. For passphrases and PINs, this option has no effect.\n\n*-d CHAR*, *--delimiter CHAR*  \n    For passphrases, this option is the character that is used between\n    words. For passwords and PINs, this option has no effect.\n\n*-F PATH*, *--dictionary-file PATH*  \n    For passphrases, this option specifies the path to a dictionary file\n    used to select words for the passphrase, and defaults to\n    `/usr/share/dict/words`. If the default file cannot be found, a\n    temporary wordlist will be downloaded from GitHub (see Word Lists\n    below). For passwords and PINs, this option has no effect.\n\n*-u [COUNT]*, *--upcase [COUNT]*  \n    For passwords, this option specifies the number of uppercase letters to\n    include in the generated password. If no COUNT is specified, at least one\n    uppercase letter is guaranteed to be included. By default, passwords\n    include at least one uppercase character. For passphrases, this option\n    specifies the number of uppercase words to include in the generated\n    passphrase. If no COUNT is specified, at least one uppercase word is\n    guaranteed to be included. By default, passphrases do not include an\n    uppercase word. For passwords and PINs, this option has no effect.\n\n*-U*, *--no-upcase*  \n    For passwords, this option forces the password to have no uppercase\n    characters at all. For passphrases, this option forces the passphrase to\n    include no uppercase words at all. For PINs, this option has no effect.\n\n*-l [COUNT]*, *--lower [COUNT]*  \n    For passwords, this option specifies the number of lowercase characters to\n    include in the generated password. If no COUNT is supplied, at least one\n    lowercase character is guaranteed to be provided. By default passwords\n    include at least one lowercase character. For passphrases, this option\n    specifies the number of lowercase words to include in the generated\n    passphrase. If no COUNT is specified, at least one lowercase word is\n    guaranteed to be included. By default, passphrases do not include an\n    uppercase word. For PINs, this option has no effect.\n\n*-L*, *--no-lower*  \n    For passwords, this option forces the password to have no lowercase\n    characters at all. For passphrases, this option forces the passphrase to\n    include no lowercase words at all. For PINs, this option has no effect.\n\n*-m LENGTH*, *--min-word-length LENGTH*  \n    For passphrases, this option will choose words in the passphrase at\n    least LENGTH characters long. Defaults to 5. For passwords and PINs,\n    this option is has no effect.\n\n*-M LENGTH*, *--max-word-length LENGTH*  \n    For passphrases, this option will choose words in the passphrase at\n    most LENGTH characters long. Defaults to 8. For passwords and PINs,\n    this option is has no effect.\n\n*-w LENGTH*, *--word-length LENGTH*  \n    For passphrases, this option will choose words in the passphrase at\n    exactly LENGTH characters long. This is the same as specifying a min\n    and max word length of the same value. For passwords and PINs, this\n    option is has no effect.\n\n*-c COUNT*, *--count COUNT*  \n    If set, generate COUNT passwords, passphrases, or PINs. Default is 1.\n    Optional.\n\n*-h*, *--help*  \n    Prints help text and exits.\n\n*-V*, *--version*  \n    Prints the bashword version and exits.\n\n### Examples\n\nGenerate a 20 character password with digits and symbols\n\n    $ bashword\n\nGenerate a 30 character password with digits and symbols\n\n    $ bashword -30\n\nGenerate a 10 character password with only alphanumeric characters\n\n    $ bashword -S -10\n\nGenerate a 3 word passphrase\n\n    $ bashword -p\n\nGenerate a 5 word passphrase using ~/list.txt\n\n    $ bashword -p -F ~/list.txt -5\n\nGenerate passwords for the given users\n\n    $ { echo user1; echo user2; echo user3 } | paste - \u003c(bashword -c 3)\n\n### Configuration\n\nbashword defaults can be configured by setting the following environment\nvariables (typically in `~/.profile` or `~/.bash_profile` for Bash users, or\n`~/.zshenv` for ZSH users). Configuring bashword is completely optional.\n\n- `$BASHWORD_DEFAULT_PASSWORD_LENGTH`: The default password length to use.\n- `$BASHWORD_PASSWORD_MIN_LENGTH`: The minimum password length allowed.\n- `$BASHWORD_DEFAULT_PASSPHRASE_WORD_LIST`: The default word list file to use\n  for generating passphrase words.\n- `$BASHWORD_DEFAULT_PASSPHRASE_MIN_WORD_LENGTH`: The default minimum word\n  length for words selected for passphrases.\n- `$BASHWORD_DEFAULT_PASSPHRASE_MAX_WORD_LENGTH`: The default maximum word\n  length for words selected for passphrases.\n- `$BASHWORD_DEFAULT_PASSPHRASE_WORD_COUNT`: The default number of words\n  chosen for passphrases.\n- `$BASHWORD_DEFAULT_PASSPHRASE_DELIMITER`: The default character used between\n  passphrase words.\n- `$BASHWORD_DEFAULT_PIN_LENGTH`: The default length for PINs.\n\nFull example:\n\n    export BASHWORD_DEFAULT_PASSWORD_LENGTH=30\n    export BASHWORD_PASSWORD_MIN_LENGTH=6\n    export BASHWORD_DEFAULT_PASSPHRASE_WORD_LIST=\"$HOME/.words\"\n    export BASHWORD_DEFAULT_PASSPHRASE_MIN_WORD_LENGTH=4\n    export BASHWORD_DEFAULT_PASSPHRASE_MAX_WORD_LENGTH=4\n    export BASHWORD_DEFAULT_PASSPHRASE_WORD_COUNT=5\n    export BASHWORD_DEFAULT_PASSPHRASE_DELIMITER=\":\"\n    export BASHWORD_DEFAULT_PIN_LENGTH=6\n\n### Word Lists\n\nBy default passphrases are generated using `/usr/share/dict/words`. If that\nfile does not exist, one will be downloaded automatically from GitHub under\n`/tmp/bashwords-words`.\n\n## Installation\n\n`bashword` includes the main [`bin/bashword`](./bin/bashword) bash script and\nan optional man page\n[`share/man/man1/bashword.1`](./share/man/man1/bashword.1).\n\nTo install `bashword`, the bash script needs to be copied to a directory in\nyour `$PATH`. If you want `man bashword` to work, the man page needs to be\ncopied to a directory in your `$MANPATH`.\n\n### Install globally via Homebrew on macOS\n\nOn macOS, `bashword` can be installed via Homebrew with:\n\n    brew install itspriddle/brews/bashword\n\n### Install globally via make\n\nmacOS and most Linux distributions add `/usr/local/bin` to `$PATH` and\n`/usr/local/share/man` to `$MANPATH`. If you are the only user on the\nmachine, or if you want to make `bashword` available for all users, you can\ninstall it globally as follows:\n\n    git clone https://github.com/itspriddle/bashword /tmp/bashword\n    cd /tmp/bashword\n    sudo make install PREFIX=/usr/local\n    cd \n    rm -rf /tmp/bashword\n\n### Install locally via make\n\nIf you don't want a global installation, another common pattern is to install\nto `~/.local`. This is enabled on Ubuntu by default.\n\n    mkdir -p ~/.local/src\n    git clone https://github.com/itspriddle/bashword ~/.local/src/bashword\n    cd ~/.local/src/bashword\n    make install PREFIX=~/.local\n\nTo test, verify that `bashword -V` works and that `man bashword` prints the\nman page.\n\nIf you see `bashword: command not found`, you need to update your `$PATH`. If\nyou are using Bash, add the following to `~/.bash_profile`, or if you are\nusing ZSH, add it to `~/.zshenv`:\n\n    export PATH=\"$HOME/.local/bin:$PATH\"\n\nIf `man bashword` reports `No manual entry for bashword`, you need to update\nyour `$MANPATH`. This can be done by adding the following to `~/.manpath`\n(note, change USER to your username):\n\n    MANDATORY_MANPATH /home/USER/.manpath\n\n### Copy the script manually\n\nThe `bashword` script can also be downloaded manually and saved to any\ndirectory in your `$PATH` (such as `/usr/local/bin` or `~/.local/bin` as\ndescribed above).\n\n    curl -s -L https://github.com/itspriddle/bashword/raw/master/bin/bashword \u003e /tmp/bashword\n    sudo mv /tmp/bashword /usr/local/bin\n    sudo chmod +x /usr/local/bin/bashword\n    bashword -V\n\n## Development\n\n### Tests\n\nTests for this project are written using\n[Bats](https://github.com/bats-core/bats-core) and are in the\n[`test/`](./test) directory. To install Bats and run the test suite run:\n\n    make test-bats\n\nBash files are also checked with [ShellCheck](https://www.shellcheck.net). To\nrun ShellCheck:\n\n    make test-shellcheck\n\nTo run Bats tests and ShellCheck:\n\n    make test\n\n### Documentation\n\nDocumentation for this project exists in:\n\n- This README file\n- The [`bin/bashword`](./bin/bashword) script's comments at the top of the\n  file (shown when `bashword --help` is used)\n- The Markdown file at [`doc/man/bashword.1.md`](./doc/man/bashword.1.md) that\n  the man page is generated from\n\nIf documentation is updated it should be done in all of the places above.\n\nThe man page is written in Markdown in the\n[`doc/man/bashword.1.md`](./doc/man/bashword.1.md) file. The\n[kramdown-man](https://github.com/postmodern/kramdown-man) Ruby Gem is used to\ngenerate a roff file that `man` uses.\n\nIf you have Ruby installed, the kramdown-man gem can be installed as follows:\n\n    gem install kramdown-man\n\nThe roff file can be generated using:\n\n    make share/man/man1/bashword.1\n\nThis will regenerate `share/man/man1/bashword.1` from the contents of\n`doc/man/bashword.1.md`. Both files should be committed to the repo.\n\n## Bug Reports\n\nIssues can be reported on GitHub:\n\n\u003chttps://github.com/itspriddle/bashword/issues\u003e\n\n## Author\n\nJoshua Priddle \u003cjpriddle@me.com\u003e\n\n\u003chttps://github.com/itspriddle/bashword#readme\u003e\n\n## License\n\nMIT License. See [LICENSE](./LICENSE) in this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitspriddle%2Fbashword","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitspriddle%2Fbashword","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitspriddle%2Fbashword/lists"}