How to Change Your WordPress Comments Settings with WP-CLI

You can change these 3 options with the following commands.

wp option update default_pingback_flag closed
wp option update default_ping_status closed
wp option update default_comment_status closed

And turn them back on with open. You can find out all the option keys with this command.

wp option list --fields=option_name

Use pipe and grep to get what you are looking for. For example, every option related to comments like this.

wp option list --fields=option_name | grep comment
comments_notify
default_comment_status
comment_moderation
comment_max_links
comment_registration
close_comments_for_old_posts
close_comments_days_old
thread_comments
thread_comments_depth
page_comments
comments_per_page
default_comments_page
comment_order
widget_recent-comments
wpcom_publish_comments_with_markdown
show_comments_cookies_opt_in
comment_previously_approved
finished_updating_comment_type
zero-spam-comments

I hope this helps.