Is there a way to generate a brain wallet from the command line or console?
Answer was here: https://en.bitcoin.it/wiki/Wallet_import_format 

To make brainwallet need to take a sha256 of password:

# echo -n 'yourbrainwalletpassword' | sha256sum 
8abe468e0d5a814c644d9517ae35b36666d554b7bd682fa28c39e90d0cb5f91a


I've write a little bash script:

declare -a base58=(
      1 2 3 4 5 6 7 8 9
    A B C D E F G H   J K L M N   P Q R S T U V W X Y Z
    a b c d e f g h i j k   m n o p q r s t u v w x y z
)

encodeBase58() {
    dc -e "16i ${1^^} [3A ~r d0&lt;x]dsxx +f" |
    while read -r n; do echo -n "${base58[n]}"; done
}

[ -z "$1" ] &amp;&amp; echo "Usage: ./script.sh privkey" &amp;&amp; exit 1

privkey="$1"

stage12="$(echo -n "$privkey" | sed -e 's/^/80/')"
stage35="$(echo $stage12 | xxd -r -p | sha256sum | awk '{print $1}' | xxd -r -p | sha256sum | awk '{print $1}'  | cut -b 1,2,3,4,5,6,7,8)"

echo "$(encodeBase58 "${stage12}${stage35}")"


Use this script against sha256 sum:

# bash script.sh 8abe468e0d5a814c644d9517ae35b36666d554b7bd682fa28c39e90d0cb5f91a
5JsPbHfVB7FeD6gGWoaQv6khRsasTJDK1tAiJ4TxgyWJLcjfgNa


Now, I can import privkey to the wallet.dat:

# bitcoind importprivkey 5JsPbHfVB7FeD6gGWoaQv6khRsasTJDK1tAiJ4TxgyWJLcjfgNa "yourbrainwalletpassword" 
# bitcoind getaddressesbyaccount "yourbrainwalletpassword" 
[ 
    "1Gu3HZDq6YEXfxwDC3A3EhDfEVAeCijbEt" 
] 


According to wiki, there are higher and lower borders.


  Nearly every 256-bit number is a valid private key. Specifically, any 256-bit number between 0x1 and 0xFFFF FFFF FFFF FFFF FFFF FFFF
  FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4141 is a valid private
  key.


However, I'm successfully import priv key

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 


After a while, bitcoind tell me:

error: {"code":-1,"message":"CKey::GetPrivKey() : i2d_ECPrivateKey failed"}


Hope it would be helpfull.

Thank you !