In that case, just do what rviz does: It sends a message to a topic (usually /move_base_simple/goal). You can do the same via rostopic pub.