Steps to follow.
- Export all the passwords from the TPM tool into a CSV file. Refer - https://teampasswordmanager.com/docs/export_import/
- Download the lastpass cli tool. Refer - https://github.com/lastpass/lastpass-cli
- login to the account using cli. "lpass login (username)"
- Run the script after updating the path to the CSV file and also the folder on lastpass under which passwords need to be synced.