docs/wc-cli/cli-faq.md
If you are getting a 401 error like Error: Sorry, you cannot list resources. {"status":401}, you are trying to use the command unauthenticated. The WooCommerce CLI as of 3.0 requires you to provide a proper user to run the action as. Pass in your user ID using the --user flag.
Some ‘lists' are actually objects. For example, if you want to set categories for a product, the REST API expects an array of objects.
To set this you would use JSON like this:
wp wc product create --name='Product Name' --categories='[ { "id" : 21 } ]' --user=admin