move cli-specific logic from remove command