Adds cleanup functionality to CLI