Update CLI to save on Ctrl-C and on exit.