rewrite publish command for better messages.