An alternative to making a shell script is to make an alias or a function instead. That way, it runs in your current shell session and you can access the history
command.
Additionally, you could always dump the output of the history command outside the shell script and then run the shell script on that file after you have dumped it.
My friend has deployed Phorge for himself and appears to be happy with it.