Can I add password in it , so that it don't prompt for password . i know its not safe , but i need to add password
If you are asking to run rpc calls without supplying the needed rpc-user and password each time add them to your bitcoin.conf file:
rpcuser=hassan_pf
rpcpassword=nobodyknows
This is the preferred way since it won't show up in your bash history (opposed to using them as arguments when calling bitcoin-cli)
However if you are looking for a way to unlock your wallet so you can spent coins you should use the
walletpassphrase argument. The insecure way of doing this is:
bitcoin-cli walletpassphrase <mysecretpassphrase> <unlock time in seconds>
So if you want to unlock your wallet with passphrase "secretenough" for 5 minutes you should do:
bitcoin-cli walletpassphrase secretenough 300
However this means your passphrase is also stored in your bash history, something you might not want. As gmaxwell was referring to you can use the -stdin argument if you don't want this to happen. The way this works is:
bitcoin-cli -stdin walletpassphrase
Once entered pass every argument you want to supply on a seperate line like this:
Use CTRL-D after supplying all the arguments. This will unlock your wallet without the passphrase getting written to your bash history.