add download function to command line interface