Move publish script into Cli object