Implement record command.