ctx publish: finish all functionalities of publish command