From the man page of htpasswd we get this:
-i Read the password from stdin without verification (for script usage).
So just acording to your question something like this should work:
echo "test101" | htpasswd -c -i ~/temp/password admin
But the password will be visible in history and process list.
To automate creating a password from the command line i would write the plain password to a file and do something like that:
htpasswd -c -i ~/temp/password admin < ~/temp/pass_plain
Afterwards delete the pass_plain file.
Also make sure the pass_plain file is not readable by anyone else, also if its just there for a few seconds.