cli: add retain and dont-retain commands