is it possible to import csv in Magento 2 from ssh command?
You could add your own command in magento 2 and mimic what happens in magento's backend.
I did it this way and it works well.
Take a look at magento/module-import-export/Controller/Adminhtml/Import/Validate.php
for the validation part and
for the consumer.
In order to initalize the importer you have to pass some configuration data.
Here's an example:
[ "entity" => "catalog_product", "behavior" => "append", "validation_strategy" => "validation-stop-on-errors", "allowed_error_count" => 10, "_import_field_separator" => ",", "_import_multiple_value_separator" => ",", "import_images_file_dir" => "" ]
I hope this gives you a good starting point.
There is a module with which you can integrate a corresponding shell command: https://github.com/cedricblondeau/magento2-module-catalog-import-command
You can simply install it with composer and enable it like this:
composer require cedricblondeau/magento2-module-catalog-import-command php bin/magento module:enable CedricBlondeau_CatalogImportCommand php bin/magento setup:upgrade
Usage is pretty straigth forward:
php bin/magento catalog:import -i pub/media/import -b add_update catalogdata.csv
where catalogdata.csv is in your magento webroot directory and
-i designates the directory where your images are stored.
It's still working well with Magento 2.3.2. I've been using it since ver. 2.2.2, hope it helps.