In my .bashrc I define a function which I can use on the command line later:
.bashrc
function mycommand() { ssh user@123.456.789.0 cd testdir;./test
I'm using the following to execute commands on the remote from my local computer:
ssh -i ~/.ssh/$GIT_PRIVKEY user@$IP "bash -s" < localpath/script.sh $arg1 $arg2