Adding publish command.
Adding implementation for publish.