I've found this documentation about adding terms using WP CLI: https://developer.wordpress.org/cli/commands/menu/item/add-term/ and tried to find out how I can add an existing category to the main-menu, but no luck.
The documentation hasn't got an example of this one or isn't clear enough to me at the moment.
Hopefully anyone else did this one before and can tell me how to accomplish it. I've got now: (but this doesn't work)
wp menu item add-term main-menu category 1
Thanks in advance!
wp menu list
to list all the registered menus and make sure you have theMain Menu
registered as a menu. I just tested on a new WP instance with the twentytwentyone theme ( no full site editing ) with your exact CLI command:wp menu item add-term main-menu category 1
and it works