OS X Keychain's Password Assistant feature via Terminal OS X Keychain's Password Assistant feature via Terminal bash bash

OS X Keychain's Password Assistant feature via Terminal


Could you not use a different password generator such as APG? That appears to do everything you want, and is available on MacPorts and Fink.


While no official Apple solution appears to exist, there is a reverse-engineered library, available as a command line tool, that recreates all of the functionality available in the GUI Password Assistant.

See this link (updated as of April 2014): https://bitbucket.org/anders/sf-pwgen or https://github.com/anders/pwgen

The developer, @anders-bergh, makes the source (including Xcode project) available, and provides a download of the binary, which can be executed in the Terminal (https://bitbucket.org/anders/sf-pwgen/downloads).

The binary can also be installed with brew:brew install sf-pwgen.

From the project page:

sf-pwgen is an example CLI application which generates passwords:

usage: ./sf-pwgen [options]Option:          Meaning:  -a, --algorithm  Available algorithms: memorable, random                   letters, alphanumeric, numbers.  -c, --count      The number of passwords to generate.                   The default is `memorable'.  -l, --length     Desired length of the generated passwords.  -L, --language   Generate passwords in a specified language.                   Languages: en, de, es, fr, it, nl, pt, jp.                   Note that this feature is broken and will                   produce garbage, bug: rdar://14889281  -v, --version    Print the version number and exit.  -h, --help       Prints this message.