How can I externally generate a 12 pass phrase for my user suitable for Counterwallet?

You can use the same script as Counterwallet: