Edited cli to save output to file